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

r/aws_ssoadmin_account_assignments - new resource #23292

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

Conversation

mattrobinsonsre
Copy link
Contributor

@mattrobinsonsre mattrobinsonsre commented Feb 19, 2022

  • 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

Closes #18739

Replaces #22543 - rebuilt against v4.

The purpose of this resource is to address the scalability of aws_ssoadmin_account_assignment with large numbers of assignments. The AWS SSO API rate limit is very low and defining a resource for each principal assignment doesn't scale.

Implementation of this resource in place of multiple aws_ssoadmin_account_assignment incantations reduces the plan time for our infra from ~20 minutes to ~2 minutes.

Output from acceptance testing:

$ make testacc PKG=ssoadmin
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ssoadmin/... -v -count 1 -parallel 20   -timeout 180m
=== RUN   TestAccSSOAdminAccountAssignment_Basic_group
=== PAUSE TestAccSSOAdminAccountAssignment_Basic_group
=== RUN   TestAccSSOAdminAccountAssignment_Basic_user
=== PAUSE TestAccSSOAdminAccountAssignment_Basic_user
=== RUN   TestAccSSOAdminAccountAssignment_disappears
=== PAUSE TestAccSSOAdminAccountAssignment_disappears
=== RUN   TestAccSSOAdminAccountAssignments_Basic_group
=== PAUSE TestAccSSOAdminAccountAssignments_Basic_group
=== RUN   TestAccSSOAdminAccountAssignments_Basic_user
=== PAUSE TestAccSSOAdminAccountAssignments_Basic_user
=== RUN   TestAccSSOAdminInstancesDataSource_basic
=== PAUSE TestAccSSOAdminInstancesDataSource_basic
=== RUN   TestAccSSOAdminManagedPolicyAttachment_basic
=== PAUSE TestAccSSOAdminManagedPolicyAttachment_basic
=== RUN   TestAccSSOAdminManagedPolicyAttachment_forceNew
=== PAUSE TestAccSSOAdminManagedPolicyAttachment_forceNew
=== RUN   TestAccSSOAdminManagedPolicyAttachment_disappears
--- PASS: TestAccSSOAdminManagedPolicyAttachment_disappears (27.91s)
=== RUN   TestAccSSOAdminManagedPolicyAttachment_Disappears_permissionSet
--- PASS: TestAccSSOAdminManagedPolicyAttachment_Disappears_permissionSet (18.53s)
=== RUN   TestAccSSOAdminManagedPolicyAttachment_multipleManagedPolicies
=== PAUSE TestAccSSOAdminManagedPolicyAttachment_multipleManagedPolicies
=== RUN   TestAccSSOAdminPermissionSetDataSource_arn
=== PAUSE TestAccSSOAdminPermissionSetDataSource_arn
=== RUN   TestAccSSOAdminPermissionSetDataSource_name
=== PAUSE TestAccSSOAdminPermissionSetDataSource_name
=== RUN   TestAccSSOAdminPermissionSetDataSource_nonExistent
=== PAUSE TestAccSSOAdminPermissionSetDataSource_nonExistent
=== RUN   TestAccSSOAdminPermissionSetInlinePolicy_basic
=== PAUSE TestAccSSOAdminPermissionSetInlinePolicy_basic
=== RUN   TestAccSSOAdminPermissionSetInlinePolicy_update
=== PAUSE TestAccSSOAdminPermissionSetInlinePolicy_update
=== RUN   TestAccSSOAdminPermissionSetInlinePolicy_disappears
--- PASS: TestAccSSOAdminPermissionSetInlinePolicy_disappears (20.30s)
=== RUN   TestAccSSOAdminPermissionSetInlinePolicy_Disappears_permissionSet
--- PASS: TestAccSSOAdminPermissionSetInlinePolicy_Disappears_permissionSet (20.05s)
=== RUN   TestAccSSOAdminPermissionSet_basic
=== PAUSE TestAccSSOAdminPermissionSet_basic
=== RUN   TestAccSSOAdminPermissionSet_tags
--- PASS: TestAccSSOAdminPermissionSet_tags (55.21s)
=== RUN   TestAccSSOAdminPermissionSet_updateDescription
=== PAUSE TestAccSSOAdminPermissionSet_updateDescription
=== RUN   TestAccSSOAdminPermissionSet_updateRelayState
=== PAUSE TestAccSSOAdminPermissionSet_updateRelayState
=== RUN   TestAccSSOAdminPermissionSet_updateSessionDuration
=== PAUSE TestAccSSOAdminPermissionSet_updateSessionDuration
=== RUN   TestAccSSOAdminPermissionSet_RelayState_updateSessionDuration
=== PAUSE TestAccSSOAdminPermissionSet_RelayState_updateSessionDuration
=== RUN   TestAccSSOAdminPermissionSet_mixedPolicyAttachments
=== PAUSE TestAccSSOAdminPermissionSet_mixedPolicyAttachments
=== CONT  TestAccSSOAdminAccountAssignment_Basic_group
=== CONT  TestAccSSOAdminPermissionSetDataSource_nonExistent
=== CONT  TestAccSSOAdminPermissionSet_updateRelayState
=== CONT  TestAccSSOAdminPermissionSet_basic
=== CONT  TestAccSSOAdminPermissionSet_updateDescription
=== CONT  TestAccSSOAdminManagedPolicyAttachment_basic
=== CONT  TestAccSSOAdminPermissionSetDataSource_arn
=== CONT  TestAccSSOAdminAccountAssignment_disappears
=== CONT  TestAccSSOAdminAccountAssignments_Basic_group
=== CONT  TestAccSSOAdminPermissionSetInlinePolicy_update
=== CONT  TestAccSSOAdminManagedPolicyAttachment_multipleManagedPolicies
=== CONT  TestAccSSOAdminAccountAssignment_Basic_user
=== CONT  TestAccSSOAdminPermissionSetDataSource_name
=== CONT  TestAccSSOAdminPermissionSetInlinePolicy_basic
=== CONT  TestAccSSOAdminPermissionSet_mixedPolicyAttachments
=== CONT  TestAccSSOAdminManagedPolicyAttachment_forceNew
=== CONT  TestAccSSOAdminPermissionSet_updateSessionDuration
=== CONT  TestAccSSOAdminAccountAssignments_Basic_user
=== CONT  TestAccSSOAdminPermissionSet_RelayState_updateSessionDuration
=== CONT  TestAccSSOAdminInstancesDataSource_basic
--- PASS: TestAccSSOAdminPermissionSetDataSource_nonExistent (10.53s)
--- PASS: TestAccSSOAdminInstancesDataSource_basic (22.39s)
--- PASS: TestAccSSOAdminPermissionSetDataSource_arn (30.25s)
--- PASS: TestAccSSOAdminPermissionSet_basic (33.43s)
--- PASS: TestAccSSOAdminAccountAssignment_disappears (41.19s)
--- PASS: TestAccSSOAdminPermissionSetDataSource_name (43.32s)
--- PASS: TestAccSSOAdminPermissionSetInlinePolicy_basic (43.53s)
--- PASS: TestAccSSOAdminAccountAssignments_Basic_group (46.83s)
--- PASS: TestAccSSOAdminAccountAssignment_Basic_user (47.01s)
--- PASS: TestAccSSOAdminManagedPolicyAttachment_basic (50.46s)
--- PASS: TestAccSSOAdminPermissionSet_updateSessionDuration (54.33s)
--- PASS: TestAccSSOAdminPermissionSet_updateDescription (54.34s)
--- PASS: TestAccSSOAdminPermissionSet_updateRelayState (54.41s)
--- PASS: TestAccSSOAdminPermissionSet_RelayState_updateSessionDuration (54.94s)
--- PASS: TestAccSSOAdminPermissionSetInlinePolicy_update (60.59s)
--- PASS: TestAccSSOAdminPermissionSet_mixedPolicyAttachments (61.51s)
--- PASS: TestAccSSOAdminManagedPolicyAttachment_forceNew (70.69s)
--- PASS: TestAccSSOAdminAccountAssignment_Basic_group (76.75s)
--- PASS: TestAccSSOAdminAccountAssignments_Basic_user (76.81s)
--- PASS: TestAccSSOAdminManagedPolicyAttachment_multipleManagedPolicies (91.68s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin	237.127s

…icorp/terraform-provider-aws/blob/main/docs/contributing --->

<!--- Please keep this note for the community --->

* Please vote on this pull request by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) 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

<!--- Thank you for keeping this note for the community --->

<!--- If your PR fully resolves and should automatically close the linked issue, use Closes. Otherwise, use Relates --->
Closes hashicorp#18739

Output from acceptance testing:

<!--
Replace TestAccXXX with a pattern that matches the tests affected by this PR.

Replace ec2 with the service package corresponding to your tests.

For more information on the `-run` flag, see the `go test` documentation at https://tip.golang.org/cmd/go/#hdr-Testing_flags.
-->
```
$ make testacc PKG=ssoadmin
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ssoadmin/... -v -count 1 -parallel 20   -timeout 180m
=== RUN   TestAccSSOAdminAccountAssignment_Basic_group
=== PAUSE TestAccSSOAdminAccountAssignment_Basic_group
=== RUN   TestAccSSOAdminAccountAssignment_Basic_user
=== PAUSE TestAccSSOAdminAccountAssignment_Basic_user
=== RUN   TestAccSSOAdminAccountAssignment_disappears
=== PAUSE TestAccSSOAdminAccountAssignment_disappears
=== RUN   TestAccSSOAdminAccountAssignments_Basic_group
=== PAUSE TestAccSSOAdminAccountAssignments_Basic_group
=== RUN   TestAccSSOAdminAccountAssignments_Basic_user
=== PAUSE TestAccSSOAdminAccountAssignments_Basic_user
=== RUN   TestAccSSOAdminInstancesDataSource_basic
=== PAUSE TestAccSSOAdminInstancesDataSource_basic
=== RUN   TestAccSSOAdminManagedPolicyAttachment_basic
=== PAUSE TestAccSSOAdminManagedPolicyAttachment_basic
=== RUN   TestAccSSOAdminManagedPolicyAttachment_forceNew
=== PAUSE TestAccSSOAdminManagedPolicyAttachment_forceNew
=== RUN   TestAccSSOAdminManagedPolicyAttachment_disappears
--- PASS: TestAccSSOAdminManagedPolicyAttachment_disappears (27.91s)
=== RUN   TestAccSSOAdminManagedPolicyAttachment_Disappears_permissionSet
--- PASS: TestAccSSOAdminManagedPolicyAttachment_Disappears_permissionSet (18.53s)
=== RUN   TestAccSSOAdminManagedPolicyAttachment_multipleManagedPolicies
=== PAUSE TestAccSSOAdminManagedPolicyAttachment_multipleManagedPolicies
=== RUN   TestAccSSOAdminPermissionSetDataSource_arn
=== PAUSE TestAccSSOAdminPermissionSetDataSource_arn
=== RUN   TestAccSSOAdminPermissionSetDataSource_name
=== PAUSE TestAccSSOAdminPermissionSetDataSource_name
=== RUN   TestAccSSOAdminPermissionSetDataSource_nonExistent
=== PAUSE TestAccSSOAdminPermissionSetDataSource_nonExistent
=== RUN   TestAccSSOAdminPermissionSetInlinePolicy_basic
=== PAUSE TestAccSSOAdminPermissionSetInlinePolicy_basic
=== RUN   TestAccSSOAdminPermissionSetInlinePolicy_update
=== PAUSE TestAccSSOAdminPermissionSetInlinePolicy_update
=== RUN   TestAccSSOAdminPermissionSetInlinePolicy_disappears
--- PASS: TestAccSSOAdminPermissionSetInlinePolicy_disappears (20.30s)
=== RUN   TestAccSSOAdminPermissionSetInlinePolicy_Disappears_permissionSet
--- PASS: TestAccSSOAdminPermissionSetInlinePolicy_Disappears_permissionSet (20.05s)
=== RUN   TestAccSSOAdminPermissionSet_basic
=== PAUSE TestAccSSOAdminPermissionSet_basic
=== RUN   TestAccSSOAdminPermissionSet_tags
--- PASS: TestAccSSOAdminPermissionSet_tags (55.21s)
=== RUN   TestAccSSOAdminPermissionSet_updateDescription
=== PAUSE TestAccSSOAdminPermissionSet_updateDescription
=== RUN   TestAccSSOAdminPermissionSet_updateRelayState
=== PAUSE TestAccSSOAdminPermissionSet_updateRelayState
=== RUN   TestAccSSOAdminPermissionSet_updateSessionDuration
=== PAUSE TestAccSSOAdminPermissionSet_updateSessionDuration
=== RUN   TestAccSSOAdminPermissionSet_RelayState_updateSessionDuration
=== PAUSE TestAccSSOAdminPermissionSet_RelayState_updateSessionDuration
=== RUN   TestAccSSOAdminPermissionSet_mixedPolicyAttachments
=== PAUSE TestAccSSOAdminPermissionSet_mixedPolicyAttachments
=== CONT  TestAccSSOAdminAccountAssignment_Basic_group
=== CONT  TestAccSSOAdminPermissionSetDataSource_nonExistent
=== CONT  TestAccSSOAdminPermissionSet_updateRelayState
=== CONT  TestAccSSOAdminPermissionSet_basic
=== CONT  TestAccSSOAdminPermissionSet_updateDescription
=== CONT  TestAccSSOAdminManagedPolicyAttachment_basic
=== CONT  TestAccSSOAdminPermissionSetDataSource_arn
=== CONT  TestAccSSOAdminAccountAssignment_disappears
=== CONT  TestAccSSOAdminAccountAssignments_Basic_group
=== CONT  TestAccSSOAdminPermissionSetInlinePolicy_update
=== CONT  TestAccSSOAdminManagedPolicyAttachment_multipleManagedPolicies
=== CONT  TestAccSSOAdminAccountAssignment_Basic_user
=== CONT  TestAccSSOAdminPermissionSetDataSource_name
=== CONT  TestAccSSOAdminPermissionSetInlinePolicy_basic
=== CONT  TestAccSSOAdminPermissionSet_mixedPolicyAttachments
=== CONT  TestAccSSOAdminManagedPolicyAttachment_forceNew
=== CONT  TestAccSSOAdminPermissionSet_updateSessionDuration
=== CONT  TestAccSSOAdminAccountAssignments_Basic_user
=== CONT  TestAccSSOAdminPermissionSet_RelayState_updateSessionDuration
=== CONT  TestAccSSOAdminInstancesDataSource_basic
--- PASS: TestAccSSOAdminPermissionSetDataSource_nonExistent (10.53s)
--- PASS: TestAccSSOAdminInstancesDataSource_basic (22.39s)
--- PASS: TestAccSSOAdminPermissionSetDataSource_arn (30.25s)
--- PASS: TestAccSSOAdminPermissionSet_basic (33.43s)
--- PASS: TestAccSSOAdminAccountAssignment_disappears (41.19s)
--- PASS: TestAccSSOAdminPermissionSetDataSource_name (43.32s)
--- PASS: TestAccSSOAdminPermissionSetInlinePolicy_basic (43.53s)
--- PASS: TestAccSSOAdminAccountAssignments_Basic_group (46.83s)
--- PASS: TestAccSSOAdminAccountAssignment_Basic_user (47.01s)
--- PASS: TestAccSSOAdminManagedPolicyAttachment_basic (50.46s)
--- PASS: TestAccSSOAdminPermissionSet_updateSessionDuration (54.33s)
--- PASS: TestAccSSOAdminPermissionSet_updateDescription (54.34s)
--- PASS: TestAccSSOAdminPermissionSet_updateRelayState (54.41s)
--- PASS: TestAccSSOAdminPermissionSet_RelayState_updateSessionDuration (54.94s)
--- PASS: TestAccSSOAdminPermissionSetInlinePolicy_update (60.59s)
--- PASS: TestAccSSOAdminPermissionSet_mixedPolicyAttachments (61.51s)
--- PASS: TestAccSSOAdminManagedPolicyAttachment_forceNew (70.69s)
--- PASS: TestAccSSOAdminAccountAssignment_Basic_group (76.75s)
--- PASS: TestAccSSOAdminAccountAssignments_Basic_user (76.81s)
--- PASS: TestAccSSOAdminManagedPolicyAttachment_multipleManagedPolicies (91.68s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin	237.127s

```
@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. provider Pertains to the provider itself, rather than any interaction with AWS. service/ssoadmin Issues and PRs that pertain to the ssoadmin service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. labels Feb 19, 2022
@mattrobinsonsre mattrobinsonsre changed the title <!--- See what makes a good Pull Request at : https://github.com/hash… Adding resource aws_ssoadmin_account_assignments Feb 19, 2022
@mattrobinsonsre mattrobinsonsre changed the title Adding resource aws_ssoadmin_account_assignments r/aws_ssoadmin_account_assignments - new resource Feb 19, 2022
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Mar 3, 2022
@poolski
Copy link

poolski commented Sep 9, 2022

Any news on this PR? We'd love to see this implemented!

@tiagoasousa
Copy link

Could this be merged? seems very useful

@Satak
Copy link

Satak commented Feb 4, 2023

This would be great. AWS SSO needs a bit update and new resources to fully manage sso in large enterprise scale environments.

@gdavison gdavison self-assigned this Feb 15, 2023
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. provider Pertains to the provider itself, rather than any interaction with AWS. service/ssoadmin Issues and PRs that pertain to the ssoadmin service. size/XL Managed by automation to categorize the size of a PR. 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.

Assignment multiple users or groups via aws_ssoadmin_account_assignment
6 participants