-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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 eventual consistency protection to efs_file_system_policy #21734
Conversation
There was no retry logic around putting an EFS file system policy, which would lead to errors when the same TF both creates a new IAM principal (e.g., role) and tries to specify that principal in an EFS FS policy in the same run. This adds retry logic when AWS returns an error about an invalid principal in line with standard recommendations. Fixes hashicorp#21716
Please merge this. |
Please merge This |
Please merge this - we need it for our project too. |
@hc-github-team-terraform-aws Please, review the issue. |
Please merge this. |
I need this too. |
# Conflicts: # internal/service/efs/file_system_policy.go
There was a problem hiding this 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=TestAccEFSFileSystemPolicy_' PKG=efs ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/efs/... -v -count 1 -parallel 2 -run=TestAccEFSFileSystemPolicy_ -timeout 180m
=== RUN TestAccEFSFileSystemPolicy_basic
=== PAUSE TestAccEFSFileSystemPolicy_basic
=== RUN TestAccEFSFileSystemPolicy_disappears
=== PAUSE TestAccEFSFileSystemPolicy_disappears
=== RUN TestAccEFSFileSystemPolicy_policyBypass
=== PAUSE TestAccEFSFileSystemPolicy_policyBypass
=== RUN TestAccEFSFileSystemPolicy_equivalentPolicies
=== PAUSE TestAccEFSFileSystemPolicy_equivalentPolicies
=== RUN TestAccEFSFileSystemPolicy_equivalentPoliciesIAMPolicyDoc
=== PAUSE TestAccEFSFileSystemPolicy_equivalentPoliciesIAMPolicyDoc
=== CONT TestAccEFSFileSystemPolicy_basic
=== CONT TestAccEFSFileSystemPolicy_equivalentPolicies
--- PASS: TestAccEFSFileSystemPolicy_equivalentPolicies (69.53s)
=== CONT TestAccEFSFileSystemPolicy_policyBypass
--- PASS: TestAccEFSFileSystemPolicy_basic (87.85s)
=== CONT TestAccEFSFileSystemPolicy_equivalentPoliciesIAMPolicyDoc
--- PASS: TestAccEFSFileSystemPolicy_policyBypass (84.45s)
=== CONT TestAccEFSFileSystemPolicy_disappears
--- PASS: TestAccEFSFileSystemPolicy_equivalentPoliciesIAMPolicyDoc (67.84s)
--- PASS: TestAccEFSFileSystemPolicy_disappears (44.57s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/efs 204.523s
@joelthompson Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.15.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! |
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. |
There was no retry logic around putting an EFS file system policy, which
would lead to errors when the same TF both creates a new IAM principal
(e.g., role) and tries to specify that principal in an EFS FS policy in
the same run. This adds retry logic when AWS returns an error about an
invalid principal in line with standard recommendations.
Community Note
Closes #21716
Output from acceptance testing: