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

New resource for Detective Graph #22042

Merged
merged 10 commits into from
Dec 9, 2021
Merged

Conversation

coderGo93
Copy link
Contributor

Added a new resource, doc and tests for Detective Graph called aws_detective_graph

Community Note

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

Relates #11672

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAwsDetectiveGraph' PKG_NAME=internal/service/detective 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/detective/... -v -count 1 -parallel 20 -run=TestAccAwsDetectiveGraph -timeout 180m
=== RUN   TestAccAwsDetectiveGraph_basic
--- PASS: TestAccAwsDetectiveGraph_basic (23.30s)
=== RUN   TestAccAwsDetectiveGraph_WithTags
--- PASS: TestAccAwsDetectiveGraph_WithTags (37.13s)
=== RUN   TestAccAwsDetectiveGraph_disappears
--- PASS: TestAccAwsDetectiveGraph_disappears (14.47s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/detective  77.034s


...

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. generators Relates to code generators. provider Pertains to the provider itself, rather than any interaction with AWS. service/detective Issues and PRs that pertain to the detective service. tags Pertains to resource tagging. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Dec 3, 2021
@zhelding zhelding self-assigned this Dec 6, 2021
@justinretzolk justinretzolk added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 7, 2021
@zhelding zhelding removed their assignment Dec 7, 2021
@zhelding zhelding self-requested a review December 7, 2021 22:45
Copy link
Contributor

@zhelding zhelding left a comment

Choose a reason for hiding this comment

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

Hi @coderGo93! Thanks so much for the PR.

I've gone ahead and made a handful of comments, mostly small in scope.

The major change required is to add support for modifying the tags of a Detective graph in-place, i.e. the addition of a resourceGraphUpdate function. Adding and removing tags from a Detective graph does not in fact force a new resource, so we need update support for this resource.

internal/service/detective/graph.go Outdated Show resolved Hide resolved
internal/service/detective/graph.go Outdated Show resolved Hide resolved
website/docs/r/detective_graph.html.markdown Outdated Show resolved Hide resolved
internal/service/detective/graph_test.go Outdated Show resolved Hide resolved
internal/service/detective/graph_test.go Outdated Show resolved Hide resolved
internal/service/detective/graph_test.go Outdated Show resolved Hide resolved
internal/service/detective/graph_test.go Outdated Show resolved Hide resolved
internal/service/detective/graph_test.go Outdated Show resolved Hide resolved
website/docs/r/detective_graph.html.markdown Outdated Show resolved Hide resolved
internal/service/detective/graph_test.go Outdated Show resolved Hide resolved
@zhelding
Copy link
Contributor

zhelding commented Dec 9, 2021

Hi @coderGo93! Thanks for your fixes.

I've gone ahead and made a few final additional tweaks -- namely:

  • Added in the CustomizeDIff: verify.SetTagsDiff handler to properly detect tag diffs
  • Added a -ListTags flag to detective/generate.go and used the generated ListTags function in resourceGraphRead instead of calling the AWS operation directly
  • Renamed the tagging acceptance test configs for clarity
  • Swapped out diag.FromErr(fmt.Errorf()) with the simpler equivalent diag.Errorf()
  • Clarified docs a bit more re: provisioning multiple Detective graphs

I'm going to wait for our final CI checks to pass while I look over the code once more, but then I think this is good to merge!

@zhelding zhelding removed their request for review December 9, 2021 19:26
@zhelding zhelding merged commit 200c37c into hashicorp:main Dec 9, 2021
@github-actions github-actions bot added this to the v3.69.0 milestone Dec 9, 2021
@github-actions
Copy link

This functionality has been released in v3.69.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Jun 3, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. generators Relates to code generators. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/detective Issues and PRs that pertain to the detective 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

3 participants