Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/app fabric app authorization #37468

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

markoskandylis
Copy link
Contributor

Description

This PR adds a resource for aws_appfabric_app_authorization

https://docs.aws.amazon.com/appfabric/latest/api/API_CreateAppAuthorization.html

Relations

Relates #34549

References

Output from Acceptance Testing

make testacc TESTARGS='-run=TestAccAppFabric_serial/AppAuthorization' PKG=appfabric  ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/appfabric/... -v -count 1 -parallel 1  -run=TestAccAppFabric_serial/AppAuthorization -timeout 360m
=== RUN   TestAccAppFabric_serial
=== PAUSE TestAccAppFabric_serial
=== CONT  TestAccAppFabric_serial
=== RUN   TestAccAppFabric_serial/AppAuthorization
=== RUN   TestAccAppFabric_serial/AppAuthorization/tags
=== PAUSE TestAccAppFabric_serial/AppAuthorization/tags
=== RUN   TestAccAppFabric_serial/AppAuthorization/basic
=== PAUSE TestAccAppFabric_serial/AppAuthorization/basic
=== RUN   TestAccAppFabric_serial/AppAuthorization/disappears
=== PAUSE TestAccAppFabric_serial/AppAuthorization/disappears
=== RUN   TestAccAppFabric_serial/AppAuthorization/apiKeyUpdate
=== PAUSE TestAccAppFabric_serial/AppAuthorization/apiKeyUpdate
=== RUN   TestAccAppFabric_serial/AppAuthorization/oath2Update
=== PAUSE TestAccAppFabric_serial/AppAuthorization/oath2Update
=== CONT  TestAccAppFabric_serial/AppAuthorization/tags
=== CONT  TestAccAppFabric_serial/AppAuthorization/apiKeyUpdate
=== CONT  TestAccAppFabric_serial/AppAuthorization/oath2Update
=== CONT  TestAccAppFabric_serial/AppAuthorization/disappears
=== CONT  TestAccAppFabric_serial/AppAuthorization/basic
--- PASS: TestAccAppFabric_serial (98.97s)
    --- PASS: TestAccAppFabric_serial/AppAuthorization (0.00s)
        --- PASS: TestAccAppFabric_serial/AppAuthorization/tags (32.37s)
        --- PASS: TestAccAppFabric_serial/AppAuthorization/apiKeyUpdate (22.05s)
        --- PASS: TestAccAppFabric_serial/AppAuthorization/oath2Update (22.09s)
        --- PASS: TestAccAppFabric_serial/AppAuthorization/disappears (10.40s)
        --- PASS: TestAccAppFabric_serial/AppAuthorization/basic (12.05s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/appfabric	104.407s

...

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. tags Pertains to resource tagging. generators Relates to code generators. service/appfabric Issues and PRs that pertain to the appfabric service. and removed size/XL Managed by automation to categorize the size of a PR. labels May 13, 2024
@terraform-aws-provider terraform-aws-provider bot added needs-triage Waiting for first response or review from a maintainer. partner Contribution from a partner. labels May 13, 2024
@markoskandylis markoskandylis marked this pull request as ready for review May 13, 2024 14:46
@markoskandylis
Copy link
Contributor Author

After fixing the tests:
make testacc TESTARGS='-run=TestAccAppFabric_serial/AppAuthorization' PKG=appfabric ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/appfabric/... -v -count 1 -parallel 1 -run=TestAccAppFabric_serial/AppAuthorization -timeout 360m
=== RUN TestAccAppFabric_serial
=== PAUSE TestAccAppFabric_serial
=== CONT TestAccAppFabric_serial
=== RUN TestAccAppFabric_serial/AppAuthorization
=== RUN TestAccAppFabric_serial/AppAuthorization/disappears
=== PAUSE TestAccAppFabric_serial/AppAuthorization/disappears
=== RUN TestAccAppFabric_serial/AppAuthorization/apiKeyUpdate
=== PAUSE TestAccAppFabric_serial/AppAuthorization/apiKeyUpdate
=== RUN TestAccAppFabric_serial/AppAuthorization/oath2Update
=== PAUSE TestAccAppFabric_serial/AppAuthorization/oath2Update
=== RUN TestAccAppFabric_serial/AppAuthorization/tags
=== PAUSE TestAccAppFabric_serial/AppAuthorization/tags
=== RUN TestAccAppFabric_serial/AppAuthorization/basic
=== PAUSE TestAccAppFabric_serial/AppAuthorization/basic
=== CONT TestAccAppFabric_serial/AppAuthorization/disappears
=== CONT TestAccAppFabric_serial/AppAuthorization/tags
=== CONT TestAccAppFabric_serial/AppAuthorization/basic
=== CONT TestAccAppFabric_serial/AppAuthorization/oath2Update
=== CONT TestAccAppFabric_serial/AppAuthorization/apiKeyUpdate
--- PASS: TestAccAppFabric_serial (97.39s)
--- PASS: TestAccAppFabric_serial/AppAuthorization (0.00s)
--- PASS: TestAccAppFabric_serial/AppAuthorization/disappears (10.64s)
--- PASS: TestAccAppFabric_serial/AppAuthorization/tags (31.34s)
--- PASS: TestAccAppFabric_serial/AppAuthorization/basic (11.82s)
--- PASS: TestAccAppFabric_serial/AppAuthorization/oath2Update (21.69s)
--- PASS: TestAccAppFabric_serial/AppAuthorization/apiKeyUpdate (21.90s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/appfabric 102.808s

@justinretzolk justinretzolk added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels May 13, 2024
Copy link
Contributor

@meetreks meetreks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent code, job well done. Just some minor edits to follow.

// SPDX-License-Identifier: MPL-2.0

package appfabric

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good

func (r *appAuthorizationResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
Attributes: map[string]schema.Attribute{
"app": schema.StringAttribute{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider adding a ENUM as it accepts only valid values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation doesnt have all the valid values thats why i didnt add Enums


resource "aws_appfabric_app_authorization" "test" {
app_bundle_identifier = aws_appfabric_app_bundle.arn
app = "TERRAFORMCLOUD"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a valid value? As per this doco - looks like itts noto a valid value -- https://docs.aws.amazon.com/appfabric/latest/api/API_CreateAppAuthorization.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes its Valid the docs doenst have all the possible names that was tested



resource "aws_appfabric_app_authorization" "test" {
app_bundle_identifier = aws_appfabric_app_bundle.arn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the resource for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still on creation the tests will be updated with the team that is working on that resource will make a pull request

}
}

func testAccAppAuthorizationConfig_basic() string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return requires formatting..

@@ -0,0 +1,27 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this file included?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a way to test the cases see example on Security lake, and bedrock knowledge base. @ewbankkit will that be the way forward for tests or we should default to the old tests

```terraform
resource "aws_appfabric_app_authorization" "example" {
app = "TERRAFORMCLOUD"
app_bundle_identifier = aws_appfabric_app_bundle.arn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include a resource for app_bundle.arn and the formatting is incorrect. You might want to consider aws_appfabric_app_bundle.test.arn

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the resource is not ready yet waiting for the pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. generators Relates to code generators. new-resource Introduces a new resource. partner Contribution from a partner. service/appfabric Issues and PRs that pertain to the appfabric service. tags Pertains to resource tagging. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants