-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
resource/aws_s3_bucket: Retry on PutBucketEncryption 409 Errors #11795
resource/aws_s3_bucket: Retry on PutBucketEncryption 409 Errors #11795
Conversation
Is there a potential timeline when this will be merged with main? |
References: * hashicorp#11789 The AWS S3 service has eventual consistency considerations. If a PutBucketEncryption call is made to AWS to apply server side encryption configuration just after an S3 bucket is first created, AWS may return an HTTP 409 (Conflict) error with an OperationAborted error code. Calls to the PutBucketEncryption API are already retried for up to 2 minutes in the event that AWS returns a NoSuchBucket error. With the changes in this commit, PutBucketEncryption calls would additionally be retried within the 2 minute limit for any OperationAborted errors. Output for acceptance testing: ``` > make testacc TEST=./aws TESTARGS='-run=TestAccAWSS3Bucket_' ... --- PASS: TestAccAWSS3Bucket_shouldFailNotFound (19.30s) --- PASS: TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes (25.24s) --- PASS: TestAccAWSS3Bucket_forceDestroy (26.90s) --- PASS: TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled (27.81s) --- PASS: TestAccAWSS3Bucket_basic (30.60s) --- PASS: TestAccAWSS3Bucket_Cors_Delete (30.88s) --- PASS: TestAccAWSS3Bucket_Cors_EmptyOrigin (30.98s) --- PASS: TestAccAWSS3Bucket_Logging (38.10s) --- PASS: TestAccAWSS3Bucket_LifecycleBasic (65.19s) --- PASS: TestAccAWSS3Bucket_objectLock (46.23s) --- PASS: TestAccAWSS3Bucket_LifecycleExpireMarkerOnly (46.72s) --- PASS: TestAccAWSS3Bucket_Cors_Update (47.07s) --- PASS: TestAccAWSS3Bucket_generatedName (26.43s) --- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical (54.26s) --- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed (27.75s) --- PASS: TestAccAWSS3Bucket_Versioning (63.99s) --- PASS: TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled (45.61s) --- PASS: TestAccAWSS3Bucket_Policy (65.74s) --- PASS: TestAccAWSS3Bucket_namePrefix (27.11s) --- PASS: TestAccAWSS3Bucket_WebsiteRoutingRules (45.35s) --- PASS: TestAccAWSS3Bucket_ReplicationWithoutStorageClass (75.75s) --- PASS: TestAccAWSS3Bucket_RequestPayer (46.16s) --- PASS: TestAccAWSS3Bucket_ReplicationWithoutPrefix (77.93s) --- PASS: TestAccAWSS3Bucket_acceleration (48.22s) --- PASS: TestAccAWSS3Bucket_Bucket_EmptyString (27.29s) --- PASS: TestAccAWSS3Bucket_WebsiteRedirect (63.41s) --- PASS: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (43.06s) --- PASS: TestAccAWSS3Bucket_UpdateAcl (44.57s) --- PASS: TestAccAWSS3Bucket_Website_Simple (63.58s) --- PASS: TestAccAWSS3Bucket_region (55.40s) --- PASS: TestAccAWSS3Bucket_tagsWithNoSystemTags (81.89s) --- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation (157.61s) --- PASS: TestAccAWSS3Bucket_tagsWithSystemTags (129.33s) --- PASS: TestAccAWSS3Bucket_ReplicationSchemaV2 (226.86s) --- PASS: TestAccAWSS3Bucket_Replication (251.12s) ```
7e539b5
to
a7765b1
Compare
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 🚀.
% ACCTEST_PARALLELISM=5 make testacc TESTARGS='-run=TestAccAWSS3Bucket_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 5 -run=TestAccAWSS3Bucket_ -timeout 180m
=== RUN TestAccAWSS3Bucket_Basic_basic
=== PAUSE TestAccAWSS3Bucket_Basic_basic
=== RUN TestAccAWSS3Bucket_Basic_emptyString
=== PAUSE TestAccAWSS3Bucket_Basic_emptyString
=== RUN TestAccAWSS3Bucket_Tags_withNoSystemTags
=== PAUSE TestAccAWSS3Bucket_Tags_withNoSystemTags
=== RUN TestAccAWSS3Bucket_Tags_withSystemTags
=== PAUSE TestAccAWSS3Bucket_Tags_withSystemTags
=== RUN TestAccAWSS3Bucket_Tags_ignoreTags
=== PAUSE TestAccAWSS3Bucket_Tags_ignoreTags
=== RUN TestAccAWSS3Bucket_Tags_basic
=== PAUSE TestAccAWSS3Bucket_Tags_basic
=== RUN TestAccAWSS3Bucket_Basic_namePrefix
=== PAUSE TestAccAWSS3Bucket_Basic_namePrefix
=== RUN TestAccAWSS3Bucket_Basic_generatedName
=== PAUSE TestAccAWSS3Bucket_Basic_generatedName
=== RUN TestAccAWSS3Bucket_Basic_acceleration
=== PAUSE TestAccAWSS3Bucket_Basic_acceleration
=== RUN TestAccAWSS3Bucket_Basic_requestPayer
=== PAUSE TestAccAWSS3Bucket_Basic_requestPayer
=== RUN TestAccAWSS3Bucket_Security_policy
=== PAUSE TestAccAWSS3Bucket_Security_policy
=== RUN TestAccAWSS3Bucket_Security_updateACL
=== PAUSE TestAccAWSS3Bucket_Security_updateACL
=== RUN TestAccAWSS3Bucket_Security_updateGrant
=== PAUSE TestAccAWSS3Bucket_Security_updateGrant
=== RUN TestAccAWSS3Bucket_Security_ACLToGrant
=== PAUSE TestAccAWSS3Bucket_Security_ACLToGrant
=== RUN TestAccAWSS3Bucket_Security_GrantToACL
=== PAUSE TestAccAWSS3Bucket_Security_GrantToACL
=== RUN TestAccAWSS3Bucket_Web_simple
=== PAUSE TestAccAWSS3Bucket_Web_simple
=== RUN TestAccAWSS3Bucket_Web_redirect
=== PAUSE TestAccAWSS3Bucket_Web_redirect
=== RUN TestAccAWSS3Bucket_Web_routingRules
=== PAUSE TestAccAWSS3Bucket_Web_routingRules
=== RUN TestAccAWSS3Bucket_Security_enableDefaultEncryptionWhenTypical
=== PAUSE TestAccAWSS3Bucket_Security_enableDefaultEncryptionWhenTypical
=== RUN TestAccAWSS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed
=== PAUSE TestAccAWSS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed
=== RUN TestAccAWSS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled
=== PAUSE TestAccAWSS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled
=== RUN TestAccAWSS3Bucket_Basic_keyEnabled
=== PAUSE TestAccAWSS3Bucket_Basic_keyEnabled
=== RUN TestAccAWSS3Bucket_Basic_shouldFailNotFound
=== PAUSE TestAccAWSS3Bucket_Basic_shouldFailNotFound
=== RUN TestAccAWSS3Bucket_Manage_versioning
=== PAUSE TestAccAWSS3Bucket_Manage_versioning
=== RUN TestAccAWSS3Bucket_Security_corsUpdate
=== PAUSE TestAccAWSS3Bucket_Security_corsUpdate
=== RUN TestAccAWSS3Bucket_Security_corsDelete
=== PAUSE TestAccAWSS3Bucket_Security_corsDelete
=== RUN TestAccAWSS3Bucket_Security_corsEmptyOrigin
=== PAUSE TestAccAWSS3Bucket_Security_corsEmptyOrigin
=== RUN TestAccAWSS3Bucket_Security_logging
=== PAUSE TestAccAWSS3Bucket_Security_logging
=== RUN TestAccAWSS3Bucket_Manage_lifecycleBasic
=== PAUSE TestAccAWSS3Bucket_Manage_lifecycleBasic
=== RUN TestAccAWSS3Bucket_Manage_lifecycleExpireMarkerOnly
=== PAUSE TestAccAWSS3Bucket_Manage_lifecycleExpireMarkerOnly
=== RUN TestAccAWSS3Bucket_Manage_lifecycleRuleExpirationEmptyConfigurationBlock
=== PAUSE TestAccAWSS3Bucket_Manage_lifecycleRuleExpirationEmptyConfigurationBlock
=== RUN TestAccAWSS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration
=== PAUSE TestAccAWSS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration
=== RUN TestAccAWSS3Bucket_Replication_basic
=== PAUSE TestAccAWSS3Bucket_Replication_basic
=== RUN TestAccAWSS3Bucket_Replication_multipleDestinationsEmptyFilter
=== PAUSE TestAccAWSS3Bucket_Replication_multipleDestinationsEmptyFilter
=== RUN TestAccAWSS3Bucket_Replication_multipleDestinationsNonEmptyFilter
=== PAUSE TestAccAWSS3Bucket_Replication_multipleDestinationsNonEmptyFilter
=== RUN TestAccAWSS3Bucket_Replication_twoDestination
=== PAUSE TestAccAWSS3Bucket_Replication_twoDestination
=== RUN TestAccAWSS3Bucket_Replication_configurationRuleDestinationAccessControlTranslation
=== PAUSE TestAccAWSS3Bucket_Replication_configurationRuleDestinationAccessControlTranslation
=== RUN TestAccAWSS3Bucket_Replication_configurationRuleDestinationAddAccessControlTranslation
=== PAUSE TestAccAWSS3Bucket_Replication_configurationRuleDestinationAddAccessControlTranslation
=== RUN TestAccAWSS3Bucket_Replication_withoutStorageClass
=== PAUSE TestAccAWSS3Bucket_Replication_withoutStorageClass
=== RUN TestAccAWSS3Bucket_Replication_expectVersioningValidationError
=== PAUSE TestAccAWSS3Bucket_Replication_expectVersioningValidationError
=== RUN TestAccAWSS3Bucket_Replication_withoutPrefix
=== PAUSE TestAccAWSS3Bucket_Replication_withoutPrefix
=== RUN TestAccAWSS3Bucket_Replication_schemaV2
=== PAUSE TestAccAWSS3Bucket_Replication_schemaV2
=== RUN TestAccAWSS3Bucket_Replication_schemaV2SameRegion
=== PAUSE TestAccAWSS3Bucket_Replication_schemaV2SameRegion
=== RUN TestAccAWSS3Bucket_Manage_objectLock
=== PAUSE TestAccAWSS3Bucket_Manage_objectLock
=== RUN TestAccAWSS3Bucket_Basic_forceDestroy
=== PAUSE TestAccAWSS3Bucket_Basic_forceDestroy
=== RUN TestAccAWSS3Bucket_Basic_forceDestroyWithEmptyPrefixes
=== PAUSE TestAccAWSS3Bucket_Basic_forceDestroyWithEmptyPrefixes
=== RUN TestAccAWSS3Bucket_Basic_forceDestroyWithObjectLockEnabled
=== PAUSE TestAccAWSS3Bucket_Basic_forceDestroyWithObjectLockEnabled
=== CONT TestAccAWSS3Bucket_Basic_basic
=== CONT TestAccAWSS3Bucket_Security_corsUpdate
=== CONT TestAccAWSS3Bucket_Replication_configurationRuleDestinationAccessControlTranslation
=== CONT TestAccAWSS3Bucket_Replication_schemaV2
=== CONT TestAccAWSS3Bucket_Replication_schemaV2SameRegion
--- PASS: TestAccAWSS3Bucket_Basic_basic (40.67s)
=== CONT TestAccAWSS3Bucket_Replication_withoutPrefix
--- PASS: TestAccAWSS3Bucket_Replication_schemaV2SameRegion (47.04s)
=== CONT TestAccAWSS3Bucket_Replication_expectVersioningValidationError
--- PASS: TestAccAWSS3Bucket_Security_corsUpdate (57.57s)
=== CONT TestAccAWSS3Bucket_Replication_withoutStorageClass
--- PASS: TestAccAWSS3Bucket_Replication_expectVersioningValidationError (11.46s)
=== CONT TestAccAWSS3Bucket_Replication_configurationRuleDestinationAddAccessControlTranslation
--- PASS: TestAccAWSS3Bucket_Replication_configurationRuleDestinationAccessControlTranslation (68.57s)
=== CONT TestAccAWSS3Bucket_Basic_forceDestroyWithEmptyPrefixes
--- PASS: TestAccAWSS3Bucket_Replication_withoutPrefix (37.64s)
=== CONT TestAccAWSS3Bucket_Basic_forceDestroyWithObjectLockEnabled
--- PASS: TestAccAWSS3Bucket_Basic_forceDestroyWithEmptyPrefixes (24.08s)
=== CONT TestAccAWSS3Bucket_Basic_forceDestroy
--- PASS: TestAccAWSS3Bucket_Replication_withoutStorageClass (38.60s)
=== CONT TestAccAWSS3Bucket_Manage_objectLock
--- PASS: TestAccAWSS3Bucket_Basic_forceDestroyWithObjectLockEnabled (29.05s)
=== CONT TestAccAWSS3Bucket_Replication_multipleDestinationsEmptyFilter
--- PASS: TestAccAWSS3Bucket_Basic_forceDestroy (26.08s)
=== CONT TestAccAWSS3Bucket_Manage_lifecycleRuleExpirationEmptyConfigurationBlock
--- PASS: TestAccAWSS3Bucket_Replication_configurationRuleDestinationAddAccessControlTranslation (71.29s)
=== CONT TestAccAWSS3Bucket_Replication_basic
--- PASS: TestAccAWSS3Bucket_Manage_lifecycleRuleExpirationEmptyConfigurationBlock (23.00s)
=== CONT TestAccAWSS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration
--- PASS: TestAccAWSS3Bucket_Replication_multipleDestinationsEmptyFilter (39.91s)
=== CONT TestAccAWSS3Bucket_Security_logging
--- PASS: TestAccAWSS3Bucket_Manage_objectLock (54.57s)
=== CONT TestAccAWSS3Bucket_Manage_lifecycleExpireMarkerOnly
--- PASS: TestAccAWSS3Bucket_Replication_schemaV2 (157.94s)
=== CONT TestAccAWSS3Bucket_Manage_lifecycleBasic
--- PASS: TestAccAWSS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration (31.86s)
=== CONT TestAccAWSS3Bucket_Security_updateGrant
--- PASS: TestAccAWSS3Bucket_Security_logging (40.49s)
=== CONT TestAccAWSS3Bucket_Manage_versioning
--- PASS: TestAccAWSS3Bucket_Manage_lifecycleExpireMarkerOnly (53.46s)
=== CONT TestAccAWSS3Bucket_Basic_shouldFailNotFound
--- PASS: TestAccAWSS3Bucket_Manage_lifecycleBasic (81.80s)
=== CONT TestAccAWSS3Bucket_Basic_keyEnabled
--- PASS: TestAccAWSS3Bucket_Replication_basic (124.49s)
=== CONT TestAccAWSS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled
--- PASS: TestAccAWSS3Bucket_Security_updateGrant (86.57s)
=== CONT TestAccAWSS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed
--- PASS: TestAccAWSS3Bucket_Manage_versioning (80.14s)
=== CONT TestAccAWSS3Bucket_Security_enableDefaultEncryptionWhenTypical
--- PASS: TestAccAWSS3Bucket_Basic_keyEnabled (36.64s)
=== CONT TestAccAWSS3Bucket_Web_routingRules
--- PASS: TestAccAWSS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed (29.50s)
=== CONT TestAccAWSS3Bucket_Web_redirect
--- PASS: TestAccAWSS3Bucket_Security_enableDefaultEncryptionWhenTypical (32.81s)
=== CONT TestAccAWSS3Bucket_Security_corsEmptyOrigin
--- PASS: TestAccAWSS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled (53.51s)
=== CONT TestAccAWSS3Bucket_Web_simple
--- PASS: TestAccAWSS3Bucket_Security_corsEmptyOrigin (30.32s)
=== CONT TestAccAWSS3Bucket_Security_GrantToACL
--- PASS: TestAccAWSS3Bucket_Web_routingRules (55.20s)
=== CONT TestAccAWSS3Bucket_Basic_namePrefix
--- PASS: TestAccAWSS3Bucket_Basic_shouldFailNotFound (15.03s)
=== CONT TestAccAWSS3Bucket_Security_ACLToGrant
--- PASS: TestAccAWSS3Bucket_Basic_namePrefix (29.62s)
=== CONT TestAccAWSS3Bucket_Security_updateACL
--- PASS: TestAccAWSS3Bucket_Web_redirect (76.85s)
=== CONT TestAccAWSS3Bucket_Security_policy
--- PASS: TestAccAWSS3Bucket_Security_GrantToACL (50.24s)
=== CONT TestAccAWSS3Bucket_Security_corsDelete
--- PASS: TestAccAWSS3Bucket_Web_simple (78.60s)
=== CONT TestAccAWSS3Bucket_Basic_requestPayer
--- PASS: TestAccAWSS3Bucket_Security_ACLToGrant (48.85s)
=== CONT TestAccAWSS3Bucket_Basic_generatedName
--- PASS: TestAccAWSS3Bucket_Security_corsDelete (25.23s)
=== CONT TestAccAWSS3Bucket_Basic_acceleration
--- PASS: TestAccAWSS3Bucket_Security_updateACL (54.63s)
=== CONT TestAccAWSS3Bucket_Tags_withSystemTags
--- PASS: TestAccAWSS3Bucket_Basic_generatedName (30.39s)
=== CONT TestAccAWSS3Bucket_Replication_multipleDestinationsNonEmptyFilter
--- PASS: TestAccAWSS3Bucket_Basic_requestPayer (54.13s)
=== CONT TestAccAWSS3Bucket_Tags_basic
--- PASS: TestAccAWSS3Bucket_Security_policy (77.88s)
=== CONT TestAccAWSS3Bucket_Tags_ignoreTags
--- PASS: TestAccAWSS3Bucket_Replication_multipleDestinationsNonEmptyFilter (40.13s)
=== CONT TestAccAWSS3Bucket_Tags_withNoSystemTags
--- PASS: TestAccAWSS3Bucket_Basic_acceleration (55.15s)
=== CONT TestAccAWSS3Bucket_Basic_emptyString
--- PASS: TestAccAWSS3Bucket_Tags_basic (33.29s)
=== CONT TestAccAWSS3Bucket_Replication_twoDestination
--- PASS: TestAccAWSS3Bucket_Tags_ignoreTags (57.36s)
--- PASS: TestAccAWSS3Bucket_Basic_emptyString (29.70s)
--- PASS: TestAccAWSS3Bucket_Replication_twoDestination (50.23s)
--- PASS: TestAccAWSS3Bucket_Tags_withSystemTags (144.96s)
--- PASS: TestAccAWSS3Bucket_Tags_withNoSystemTags (102.58s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 567.226s
@camlow325 Thanks for the contribution 🎉 👏. |
This functionality has been released in v3.57.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. |
Community Note
Closes #11789
Release note for CHANGELOG:
The AWS S3 service has eventual consistency considerations. If a PutBucketEncryption call is made to AWS to apply server side encryption configuration just after an S3 bucket is first created, AWS may return an HTTP 409 (Conflict) error with an
OperationAborted
error code.Calls to the PutBucketEncryption API are already retried for up to 2 minutes in the event that AWS returns a
NoSuchBucket
error. With the changes in this commit, PutBucketEncryption calls would additionally be retried within the 2 minute limit for anyOperationAborted
errors.Output from acceptance testing: