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_ingestion resource #37291

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

Conversation

davelemons
Copy link

Description

This PR adds a resource for aws_appfabric_ingestion

Relations

Relates #34549

References

AppFabric Ingestion Docs

Output from Acceptance Testing

% make testacc TESTS=TestAccAppFabricIngestion PKG=appfabric      
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/appfabric/... -v -count 1 -parallel 20 -run='TestAccAppFabricIngestion'  -timeout 360m
=== RUN   TestAccAppFabricIngestion_basic
=== PAUSE TestAccAppFabricIngestion_basic
=== RUN   TestAccAppFabricIngestion_disappears
=== PAUSE TestAccAppFabricIngestion_disappears
=== CONT  TestAccAppFabricIngestion_basic
=== CONT  TestAccAppFabricIngestion_disappears
--- PASS: TestAccAppFabricIngestion_disappears (17.49s)
--- PASS: TestAccAppFabricIngestion_basic (18.88s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/appfabric  30.538s

Copy link

github-actions bot commented May 6, 2024

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

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 6, 2024
@breathingdust breathingdust added the partner Contribution from a partner. label May 8, 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, excellent start. Couple of minor things

  1. Update Function
  2. Tests -- hard coding needs to be removed and more tests need to be added.
  3. change log file is required.

},
},
"arn": schema.StringAttribute{
Optional: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

can you consider a framework attribute?

Optional: true,
Computed: true,
},
"app_bundle_identifier": 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.

Alphabetical order should be considered, for ex...app_bundle before arn..

return
}

in := &appfabric.CreateIngestionInput{
Copy link
Contributor

Choose a reason for hiding this comment

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

you can consider using framework expand function to auto expand which is the preferred way.

return
}

plan.App = flex.StringToFramework(ctx, out.Ingestion.App)
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using Framework function to simplify this.

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

func (r *resourceIngestion) 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.

Read comes before update. Please re-arrange the sequence if possible.

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

func (r *resourceIngestion) 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.

We need to revisit this a bit, consider looking at other update services like bedrock / bedrockagent examples and refactor if possible plz.

Copy link
Author

Choose a reason for hiding this comment

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

Good callout...the AppFabric resources don't have specific update calls so, I was following the advice from Skaff about using the same logic in create. Bedrock Agent has a specific update call. What is the recommendation for services without an update, or do you have a similar service I could look at?

return
}

state.App = flex.StringToFramework(ctx, out.App)
Copy link
Contributor

Choose a reason for hiding this comment

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

We can consider using the framework flatten to auto this.

{
ResourceName: resourceName,
ImportState: true,
ImportStateIdFunc: testAccIngestionImportStateIDFunc(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.

Guess we can remove this test

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.

Kindly follow existing standards.

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.

@davelemons
Copy link
Author

I believe I have all of the items addressed. There is no update API, so I changed it to a no-op, let me know if there is anything else I should do there. It's a pretty simple service and I'm struggling to think of other tests to add at this point and open to some suggestions/pointers of additional tests to add. Also, I'm not sure why it's seeing GO V1 usage...I should be using V2 for everything.

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. 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