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

feat: add notification_settings to RolesAnywhere trust_anchor #39108

Conversation

DanielRieske
Copy link
Contributor

Description

This PR adds the notification_settings attributes to aws_rolesanywhere_trust_anchor and a general cleanup of the service.

Notification settings has some unique behavior that the reviewer needs to be aware of

  • The API always returns 2 default entries if unset.
  • This attribute cannot be updated and has to be recreated if a user-wants to update it.
  • If a user sets it, then based on the event argument within the API default will be overwritten.

This means that the field needs to be computed, forceNew & differences for the computed arguments need to be suppressed so it does not trigger a force recreation.

Also fixed a bug within aws_rolesanywhere_profile that while roles_arns is required an empty list is an acceptable value for the API. Made the argument optional and used our flex functions to create an empty list if unset.

Relations

Closes #37532
Closes #39102

References

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccRolesAnywhere' PKG=rolesanywhere  
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/rolesanywhere/... -v -count 1 -parallel 20  -run=TestAccRolesAnywhere -timeout 360m
=== RUN   TestAccRolesAnywhereProfile_basic
=== PAUSE TestAccRolesAnywhereProfile_basic
=== RUN   TestAccRolesAnywhereProfile_noRoleArns
=== PAUSE TestAccRolesAnywhereProfile_noRoleArns
=== RUN   TestAccRolesAnywhereProfile_tags
=== PAUSE TestAccRolesAnywhereProfile_tags
=== RUN   TestAccRolesAnywhereProfile_disappears
=== PAUSE TestAccRolesAnywhereProfile_disappears
=== RUN   TestAccRolesAnywhereProfile_enabled
=== PAUSE TestAccRolesAnywhereProfile_enabled
=== RUN   TestAccRolesAnywhereTrustAnchor_basic
=== PAUSE TestAccRolesAnywhereTrustAnchor_basic
=== RUN   TestAccRolesAnywhereTrustAnchor_notificationSettings
=== PAUSE TestAccRolesAnywhereTrustAnchor_notificationSettings
=== RUN   TestAccRolesAnywhereTrustAnchor_tags
=== PAUSE TestAccRolesAnywhereTrustAnchor_tags
=== RUN   TestAccRolesAnywhereTrustAnchor_disappears
=== PAUSE TestAccRolesAnywhereTrustAnchor_disappears
=== RUN   TestAccRolesAnywhereTrustAnchor_certificateBundle
=== PAUSE TestAccRolesAnywhereTrustAnchor_certificateBundle
=== RUN   TestAccRolesAnywhereTrustAnchor_enabled
=== PAUSE TestAccRolesAnywhereTrustAnchor_enabled
=== CONT  TestAccRolesAnywhereProfile_basic
=== CONT  TestAccRolesAnywhereTrustAnchor_notificationSettings
=== CONT  TestAccRolesAnywhereProfile_disappears
=== CONT  TestAccRolesAnywhereProfile_tags
=== CONT  TestAccRolesAnywhereTrustAnchor_basic
=== CONT  TestAccRolesAnywhereTrustAnchor_certificateBundle
=== CONT  TestAccRolesAnywhereTrustAnchor_enabled
=== CONT  TestAccRolesAnywhereProfile_enabled
=== CONT  TestAccRolesAnywhereTrustAnchor_disappears
=== CONT  TestAccRolesAnywhereTrustAnchor_tags
=== CONT  TestAccRolesAnywhereProfile_noRoleArns
--- PASS: TestAccRolesAnywhereTrustAnchor_certificateBundle (22.53s)
--- PASS: TestAccRolesAnywhereProfile_basic (27.60s)
--- PASS: TestAccRolesAnywhereTrustAnchor_disappears (31.56s)
--- PASS: TestAccRolesAnywhereProfile_disappears (34.60s)
--- PASS: TestAccRolesAnywhereTrustAnchor_basic (37.02s)
--- PASS: TestAccRolesAnywhereProfile_noRoleArns (37.26s)
--- PASS: TestAccRolesAnywhereTrustAnchor_notificationSettings (42.94s)
--- PASS: TestAccRolesAnywhereTrustAnchor_enabled (49.41s)
--- PASS: TestAccRolesAnywhereProfile_enabled (54.42s)
--- PASS: TestAccRolesAnywhereProfile_tags (58.47s)
--- PASS: TestAccRolesAnywhereTrustAnchor_tags (65.84s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/rolesanywhere      70.959s

@DanielRieske DanielRieske requested a review from a team as a code owner September 1, 2024 10:24
Copy link

github-actions bot commented Sep 1, 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 tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. generators Relates to code generators. service/rolesanywhere Issues and PRs that pertain to the rolesanywhere service. needs-triage Waiting for first response or review from a maintainer. external-maintainer Contribution from a trusted external contributor. labels Sep 1, 2024
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Sep 3, 2024
@ewbankkit ewbankkit self-assigned this Sep 3, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 3, 2024
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccRolesAnywhere' PKG=rolesanywhere ACCTEST_PARALLELISM=2
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/rolesanywhere/... -v -count 1 -parallel 2  -run=TestAccRolesAnywhere -timeout 360m
=== RUN   TestAccRolesAnywhereProfile_basic
=== PAUSE TestAccRolesAnywhereProfile_basic
=== RUN   TestAccRolesAnywhereProfile_tags
=== PAUSE TestAccRolesAnywhereProfile_tags
=== RUN   TestAccRolesAnywhereProfile_disappears
=== PAUSE TestAccRolesAnywhereProfile_disappears
=== RUN   TestAccRolesAnywhereProfile_enabled
=== PAUSE TestAccRolesAnywhereProfile_enabled
=== RUN   TestAccRolesAnywhereTrustAnchor_basic
=== PAUSE TestAccRolesAnywhereTrustAnchor_basic
=== RUN   TestAccRolesAnywhereTrustAnchor_tags
=== PAUSE TestAccRolesAnywhereTrustAnchor_tags
=== RUN   TestAccRolesAnywhereTrustAnchor_disappears
=== PAUSE TestAccRolesAnywhereTrustAnchor_disappears
=== RUN   TestAccRolesAnywhereTrustAnchor_certificateBundle
=== PAUSE TestAccRolesAnywhereTrustAnchor_certificateBundle
=== RUN   TestAccRolesAnywhereTrustAnchor_enabled
=== PAUSE TestAccRolesAnywhereTrustAnchor_enabled
=== CONT  TestAccRolesAnywhereProfile_basic
=== CONT  TestAccRolesAnywhereTrustAnchor_tags
--- PASS: TestAccRolesAnywhereProfile_basic (12.59s)
=== CONT  TestAccRolesAnywhereProfile_enabled
--- PASS: TestAccRolesAnywhereTrustAnchor_tags (33.94s)
=== CONT  TestAccRolesAnywhereTrustAnchor_basic
--- PASS: TestAccRolesAnywhereProfile_enabled (26.31s)
=== CONT  TestAccRolesAnywhereProfile_disappears
--- PASS: TestAccRolesAnywhereProfile_disappears (9.95s)
=== CONT  TestAccRolesAnywhereProfile_tags
--- PASS: TestAccRolesAnywhereTrustAnchor_basic (17.17s)
=== CONT  TestAccRolesAnywhereTrustAnchor_certificateBundle
--- PASS: TestAccRolesAnywhereTrustAnchor_certificateBundle (11.12s)
=== CONT  TestAccRolesAnywhereTrustAnchor_enabled
--- PASS: TestAccRolesAnywhereProfile_tags (28.17s)
=== CONT  TestAccRolesAnywhereTrustAnchor_disappears
--- PASS: TestAccRolesAnywhereTrustAnchor_enabled (25.16s)
--- PASS: TestAccRolesAnywhereTrustAnchor_disappears (15.24s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rolesanywhere	97.502s

@ewbankkit
Copy link
Contributor

@DanielRieske Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 89589c6 into hashicorp:main Sep 3, 2024
39 checks passed
@github-actions github-actions bot added this to the v5.66.0 milestone Sep 3, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 5, 2024
Copy link

github-actions bot commented Sep 5, 2024

This functionality has been released in v5.66.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!

Copy link

github-actions bot commented Oct 7, 2024

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 Oct 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
external-maintainer Contribution from a trusted external contributor. generators Relates to code generators. service/rolesanywhere Issues and PRs that pertain to the rolesanywhere service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
2 participants