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

service/iam: retry attaching policy on ConcurrentModificationException #34378

Merged
merged 20 commits into from
Nov 14, 2023

Conversation

flichtenheld
Copy link
Contributor

Description

Seems like AWS IAM now returns ConcurrentModification when previously this was not a problem.
Just retry the operation like we do in other parts of the code.

Relations

Closes #34371

References

Output from Acceptance Testing

Fixes hashicorp#34371

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
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/S Managed by automation to categorize the size of a PR. service/iam Issues and PRs that pertain to the iam service. labels Nov 13, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 13, 2023
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 @flichtenheld 👋

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 bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 13, 2023
% make testacc TESTARGS='-run=TestAccIAMGroupPolicyAttachment_' PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20  -run=TestAccIAMGroupPolicyAttachment_ -timeout 360m
=== RUN   TestAccIAMGroupPolicyAttachment_basic
=== PAUSE TestAccIAMGroupPolicyAttachment_basic
=== RUN   TestAccIAMGroupPolicyAttachment_disappears
=== PAUSE TestAccIAMGroupPolicyAttachment_disappears
=== CONT  TestAccIAMGroupPolicyAttachment_basic
=== CONT  TestAccIAMGroupPolicyAttachment_disappears
--- PASS: TestAccIAMGroupPolicyAttachment_disappears (21.23s)
--- PASS: TestAccIAMGroupPolicyAttachment_basic (38.74s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	44.687s
% make testacc TESTARGS='-run=TestAccIAMUserPolicyAttachment_' PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20  -run=TestAccIAMUserPolicyAttachment_ -timeout 360m
=== RUN   TestAccIAMUserPolicyAttachment_basic
=== PAUSE TestAccIAMUserPolicyAttachment_basic
=== RUN   TestAccIAMUserPolicyAttachment_disappears
=== PAUSE TestAccIAMUserPolicyAttachment_disappears
=== CONT  TestAccIAMUserPolicyAttachment_basic
=== CONT  TestAccIAMUserPolicyAttachment_disappears
--- PASS: TestAccIAMUserPolicyAttachment_disappears (23.71s)
--- PASS: TestAccIAMUserPolicyAttachment_basic (41.76s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	47.241s
% make testacc TESTARGS='-run=TestAccIAMRolePolicyAttachment_' PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20  -run=TestAccIAMRolePolicyAttachment_ -timeout 360m
=== RUN   TestAccIAMRolePolicyAttachment_basic
=== PAUSE TestAccIAMRolePolicyAttachment_basic
=== RUN   TestAccIAMRolePolicyAttachment_disappears
=== PAUSE TestAccIAMRolePolicyAttachment_disappears
=== RUN   TestAccIAMRolePolicyAttachment_Disappears_role
=== PAUSE TestAccIAMRolePolicyAttachment_Disappears_role
=== CONT  TestAccIAMRolePolicyAttachment_basic
=== CONT  TestAccIAMRolePolicyAttachment_Disappears_role
=== CONT  TestAccIAMRolePolicyAttachment_disappears
--- PASS: TestAccIAMRolePolicyAttachment_Disappears_role (28.46s)
--- PASS: TestAccIAMRolePolicyAttachment_disappears (28.48s)
--- PASS: TestAccIAMRolePolicyAttachment_basic (47.56s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	53.610s
% make testacc TESTARGS='-run=TestAccIAMPolicyAttachment_' PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20  -run=TestAccIAMPolicyAttachment_ -timeout 360m
=== RUN   TestAccIAMPolicyAttachment_basic
=== PAUSE TestAccIAMPolicyAttachment_basic
=== RUN   TestAccIAMPolicyAttachment_disappears
=== PAUSE TestAccIAMPolicyAttachment_disappears
=== RUN   TestAccIAMPolicyAttachment_paginatedEntities
=== PAUSE TestAccIAMPolicyAttachment_paginatedEntities
=== CONT  TestAccIAMPolicyAttachment_basic
=== CONT  TestAccIAMPolicyAttachment_paginatedEntities
=== CONT  TestAccIAMPolicyAttachment_disappears
--- PASS: TestAccIAMPolicyAttachment_disappears (30.25s)
--- PASS: TestAccIAMPolicyAttachment_basic (40.91s)
--- PASS: TestAccIAMPolicyAttachment_paginatedEntities (78.31s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	84.067s
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=TestAccIAMGroupPolicyAttachment_' PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20  -run=TestAccIAMGroupPolicyAttachment_ -timeout 360m
=== RUN   TestAccIAMGroupPolicyAttachment_basic
=== PAUSE TestAccIAMGroupPolicyAttachment_basic
=== RUN   TestAccIAMGroupPolicyAttachment_disappears
=== PAUSE TestAccIAMGroupPolicyAttachment_disappears
=== CONT  TestAccIAMGroupPolicyAttachment_basic
=== CONT  TestAccIAMGroupPolicyAttachment_disappears
--- PASS: TestAccIAMGroupPolicyAttachment_disappears (21.23s)
--- PASS: TestAccIAMGroupPolicyAttachment_basic (38.74s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	44.687s
% make testacc TESTARGS='-run=TestAccIAMUserPolicyAttachment_' PKG=iam   
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20  -run=TestAccIAMUserPolicyAttachment_ -timeout 360m
=== RUN   TestAccIAMUserPolicyAttachment_basic
=== PAUSE TestAccIAMUserPolicyAttachment_basic
=== RUN   TestAccIAMUserPolicyAttachment_disappears
=== PAUSE TestAccIAMUserPolicyAttachment_disappears
=== CONT  TestAccIAMUserPolicyAttachment_basic
=== CONT  TestAccIAMUserPolicyAttachment_disappears
--- PASS: TestAccIAMUserPolicyAttachment_disappears (23.71s)
--- PASS: TestAccIAMUserPolicyAttachment_basic (41.76s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	47.241s
% make testacc TESTARGS='-run=TestAccIAMRolePolicyAttachment_' PKG=iam   
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20  -run=TestAccIAMRolePolicyAttachment_ -timeout 360m
=== RUN   TestAccIAMRolePolicyAttachment_basic
=== PAUSE TestAccIAMRolePolicyAttachment_basic
=== RUN   TestAccIAMRolePolicyAttachment_disappears
=== PAUSE TestAccIAMRolePolicyAttachment_disappears
=== RUN   TestAccIAMRolePolicyAttachment_Disappears_role
=== PAUSE TestAccIAMRolePolicyAttachment_Disappears_role
=== CONT  TestAccIAMRolePolicyAttachment_basic
=== CONT  TestAccIAMRolePolicyAttachment_Disappears_role
=== CONT  TestAccIAMRolePolicyAttachment_disappears
--- PASS: TestAccIAMRolePolicyAttachment_Disappears_role (28.46s)
--- PASS: TestAccIAMRolePolicyAttachment_disappears (28.48s)
--- PASS: TestAccIAMRolePolicyAttachment_basic (47.56s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	53.610s
% make testacc TESTARGS='-run=TestAccIAMPolicyAttachment_' PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20  -run=TestAccIAMPolicyAttachment_ -timeout 360m
=== RUN   TestAccIAMPolicyAttachment_basic
=== PAUSE TestAccIAMPolicyAttachment_basic
=== RUN   TestAccIAMPolicyAttachment_disappears
=== PAUSE TestAccIAMPolicyAttachment_disappears
=== RUN   TestAccIAMPolicyAttachment_paginatedEntities
=== PAUSE TestAccIAMPolicyAttachment_paginatedEntities
=== CONT  TestAccIAMPolicyAttachment_basic
=== CONT  TestAccIAMPolicyAttachment_paginatedEntities
=== CONT  TestAccIAMPolicyAttachment_disappears
--- PASS: TestAccIAMPolicyAttachment_disappears (30.25s)
--- PASS: TestAccIAMPolicyAttachment_basic (40.91s)
--- PASS: TestAccIAMPolicyAttachment_paginatedEntities (78.31s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	84.067s
% make testacc TESTARGS='-run=TestAccIAMPolicy_' PKG=iam ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 3  -run=TestAccIAMPolicy_ -timeout 360m
=== RUN   TestAccIAMPolicy_basic
=== PAUSE TestAccIAMPolicy_basic
=== RUN   TestAccIAMPolicy_description
=== PAUSE TestAccIAMPolicy_description
=== RUN   TestAccIAMPolicy_tags
=== PAUSE TestAccIAMPolicy_tags
=== RUN   TestAccIAMPolicy_disappears
=== PAUSE TestAccIAMPolicy_disappears
=== RUN   TestAccIAMPolicy_namePrefix
=== PAUSE TestAccIAMPolicy_namePrefix
=== RUN   TestAccIAMPolicy_path
=== PAUSE TestAccIAMPolicy_path
=== RUN   TestAccIAMPolicy_policy
=== PAUSE TestAccIAMPolicy_policy
=== RUN   TestAccIAMPolicy_diffs
=== PAUSE TestAccIAMPolicy_diffs
=== RUN   TestAccIAMPolicy_policyDuplicateKeys
=== PAUSE TestAccIAMPolicy_policyDuplicateKeys
=== CONT  TestAccIAMPolicy_basic
=== CONT  TestAccIAMPolicy_path
=== CONT  TestAccIAMPolicy_diffs
--- PASS: TestAccIAMPolicy_path (32.52s)
=== CONT  TestAccIAMPolicy_policyDuplicateKeys
--- PASS: TestAccIAMPolicy_basic (32.57s)
=== CONT  TestAccIAMPolicy_policy
--- PASS: TestAccIAMPolicy_policyDuplicateKeys (3.11s)
=== CONT  TestAccIAMPolicy_disappears
=== CONT  TestAccIAMPolicy_namePrefix
--- PASS: TestAccIAMPolicy_disappears (23.77s)
--- PASS: TestAccIAMPolicy_policy (54.94s)
=== CONT  TestAccIAMPolicy_tags
--- PASS: TestAccIAMPolicy_namePrefix (32.54s)
=== CONT  TestAccIAMPolicy_description
--- PASS: TestAccIAMPolicy_description (32.88s)
--- PASS: TestAccIAMPolicy_tags (68.61s)
--- PASS: TestAccIAMPolicy_diffs (195.55s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	201.652s

@ewbankkit
Copy link
Contributor

@flichtenheld Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 52d1c04 into hashicorp:main Nov 14, 2023
36 checks passed
@github-actions github-actions bot added this to the v5.26.0 milestone Nov 14, 2023
Copy link

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

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 Dec 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/iam Issues and PRs that pertain to the iam service. size/S Managed by automation to categorize the size of a PR.
Projects
None yet
3 participants