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

add aws_appfabric_appbundle resource #37542

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

Conversation

walkoaw
Copy link

@walkoaw walkoaw commented May 15, 2024

Description

This PR adds a resource for aws_appfabric_appbundle

Relations

Relates #34549

References

AppFabric AppBundle Docs

Output from Acceptance Testing

% make testacc TESTS=TestAccAppFabricAppBundle PKG=appfabric                                                            
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.0 test ./internal/service/appfabric/... -v -count 1 -parallel 20 -run='TestAccAppFabricAppBundle'  -timeout 360m
=== RUN   TestAccAppFabricAppBundle_basic
=== PAUSE TestAccAppFabricAppBundle_basic
=== RUN   TestAccAppFabricAppBundle_disappears
=== PAUSE TestAccAppFabricAppBundle_disappears
=== CONT  TestAccAppFabricAppBundle_basic
=== CONT  TestAccAppFabricAppBundle_disappears
--- PASS: TestAccAppFabricAppBundle_disappears (12.62s)
--- PASS: TestAccAppFabricAppBundle_basic (15.10s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/appfabric  19.935s```

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. 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. labels May 15, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 15, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @walkoaw 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@justinretzolk justinretzolk added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels May 16, 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.

Good Code, well done. Some minor edits required.

Also -- need 2 more files one is for change log and another for documentation - you can check the contributor guide for the same.

"github.com/hashicorp/terraform-provider-aws/names"
)

func newResourceAppBundle(_ context.Context) (resource.ResourceWithConfigure, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add framework @frameworkresource so that service gen can pick it up.

resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
}

func (r *resourceAppBundle) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add NoOps marker

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
acctest.PreCheck(ctx, t)
testAccPreCheck(ctx, t)
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont understand this check, usually we run a precheck like this
PreCheck: func() {
acctest.PreCheck(ctx, t)
acctest.PreCheckPartitionHasService(t, names.servicendpointID)
},

{
ResourceName: resourceName,
ImportState: true,
ImportStateIdFunc: testAccAppBundleImportStateIDFunc(ctx, resourceName),
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this test trying to do? I guess we can ignore this test

}
}
`)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Add one more test called _full and ensure you can pass customer_managed_key_identifier and also ensure all fields are returned in the output. Idea is _basic test is too check minimum and _full test should check all fields possible (even optional fields)

Choose a reason for hiding this comment

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

There are no required fields, so I just had :
testAccCheckAppBundleExists(ctx, resourceName, &appbundle),

Choose a reason for hiding this comment

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

Could _basic be deleted altogether?

@@ -19,7 +19,15 @@ func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.Serv
}

func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource {
return []*types.ServicePackageFrameworkResource{}
return []*types.ServicePackageFrameworkResource{
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 auto generated?

Copy link
Author

Choose a reason for hiding this comment

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

I believe it was. Should it be deleted?

Copy link

Thank you for your contribution! 🚀

A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored.

For additional information refer to the AWS SDK for Go Versions page in the contributor guide.

@walkoaw
Copy link
Author

walkoaw commented May 29, 2024

All comments have been addressed and documentation has been added.

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.

Looks good . Some minor edits required

  1. As you have an optional field like "customer_managed_key_identifier": schema.StringAttribute{ Optional: true, }, then you need a test for the same.
  2. You need a couple of additional tests for tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generators Relates to code generators. new-resource Introduces a new resource. service/appfabric Issues and PRs that pertain to the appfabric service. size/XL Managed by automation to categorize the size of a PR. 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

4 participants