-
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 read after creation for 404 status code #11894
Conversation
Reference: #11891 Previously in the acceptance testing (inconsistently across various testing due to eventual consistency): ``` --- FAIL: TestAccAWSAthenaNamedQuery_basic (3.56s) testing.go:640: Step 0 error: errors during apply: Error: Provider produced inconsistent result after apply When applying changes to aws_s3_bucket.test, provider "aws" produced an unexpected new value for was present, but now absent. This is a bug in the provider, which should be reported in the provider's own issue tracker. --- FAIL: TestAccAWSCodeBuildProject_Environment_Certificate (7.72s) testing.go:640: Step 0 error: errors during apply: Error: Provider produced inconsistent result after apply When applying changes to aws_s3_bucket.test, provider "aws" produced an unexpected new value for was present, but now absent. This is a bug in the provider, which should be reported in the provider's own issue tracker. ``` The HeadBucket/HeadObject S3 APIs work differently than other AWS APIs where they can exclusively return only status code information and not a relevant error code. This update accounts for that discrepency by retrying on 404 status codes on the resource read immediately after bucket creation. Output from acceptance testing (failures from other eventual consistency issues): ``` --- PASS: TestAccAWSS3Bucket_shouldFailNotFound (18.57s) --- PASS: TestAccAWSS3Bucket_Cors_Delete (31.55s) --- PASS: TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes (33.16s) --- PASS: TestAccAWSS3Bucket_forceDestroy (34.90s) --- PASS: TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled (36.16s) --- PASS: TestAccAWSS3Bucket_basic (36.41s) --- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed (36.72s) --- PASS: TestAccAWSS3Bucket_Cors_EmptyOrigin (37.42s) --- PASS: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (39.28s) --- PASS: TestAccAWSS3Bucket_objectLock (62.84s) --- FAIL: TestAccAWSS3Bucket_Cors_Update (70.43s) testing.go:640: Step 2 error: After applying this step, the plan was not empty: --- PASS: TestAccAWSS3Bucket_namePrefix (34.06s) --- PASS: TestAccAWSS3Bucket_ReplicationWithoutStorageClass (74.89s) --- PASS: TestAccAWSS3Bucket_Logging (75.40s) --- PASS: TestAccAWSS3Bucket_ReplicationWithoutPrefix (77.09s) --- PASS: TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled (59.98s) --- PASS: TestAccAWSS3Bucket_LifecycleExpireMarkerOnly (80.69s) --- FAIL: TestAccAWSS3Bucket_RequestPayer (50.88s) testing.go:640: Step 2 error: Check failed: Check 2/3 error: aws_s3_bucket.bucket: Attribute 'request_payer' expected "Requester", got "BucketOwner" --- FAIL: TestAccAWSS3Bucket_acceleration (21.28s) testing.go:640: Step 0 error: Check failed: Check 2/2 error: aws_s3_bucket.bucket: Attribute 'acceleration_status' expected "Enabled", got "" --- FAIL: TestAccAWSS3Bucket_LifecycleBasic (86.20s) testing.go:640: Step 3 error: After applying this step and refreshing, the plan was not empty: --- PASS: TestAccAWSS3Bucket_WebsiteRoutingRules (60.54s) --- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical (62.41s) --- PASS: TestAccAWSS3Bucket_UpdateAcl (61.70s) --- PASS: TestAccAWSS3Bucket_region (30.65s) --- PASS: TestAccAWSS3Bucket_Versioning (105.29s) --- PASS: TestAccAWSS3Bucket_generatedName (35.22s) --- PASS: TestAccAWSS3Bucket_Bucket_EmptyString (34.39s) --- PASS: TestAccAWSS3Bucket_Policy (76.26s) --- PASS: TestAccAWSS3Bucket_WebsiteRedirect (83.43s) --- PASS: TestAccAWSS3Bucket_Website_Simple (83.85s) --- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation (149.59s) --- PASS: TestAccAWSS3Bucket_tagsWithNoSystemTags (112.51s) --- PASS: TestAccAWSS3Bucket_ReplicationSchemaV2 (234.41s) --- PASS: TestAccAWSS3Bucket_Replication (242.83s) --- PASS: TestAccAWSS3Bucket_tagsWithSystemTags (182.05s) ``` Re-run of failed tests: ``` --- PASS: TestAccAWSS3Bucket_RequestPayer (59.87s) --- PASS: TestAccAWSS3Bucket_Cors_Update (61.90s) --- PASS: TestAccAWSS3Bucket_acceleration (62.81s) --- PASS: TestAccAWSS3Bucket_LifecycleBasic (89.19s) ```
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 🚀
Output from acceptance testing:
--- PASS: TestAccAWSS3BucketObject_noNameNoKey (6.83s)
--- FAIL: TestAccAWSS3BucketNotification_Queue (16.72s)
--- PASS: TestAccAWSS3BucketObject_empty (20.85s)
--- PASS: TestAccAWSS3BucketMetric_WithEmptyFilter (21.29s)
--- PASS: TestAccAWSS3BucketObject_source (21.74s)
--- PASS: TestAccAWSS3BucketObject_content (21.93s)
--- PASS: TestAccAWSS3BucketInventory_basic (22.46s)
--- PASS: TestAccAWSS3BucketMetric_basic (22.48s)
--- PASS: TestAccAWSS3BucketInventory_encryptWithSSES3 (22.48s)
--- PASS: TestAccAWSS3BucketNotification_Topic (23.36s)
--- PASS: TestAccAWSS3BucketObject_etagEncryption (18.10s)
--- PASS: TestAccAWSS3BucketNotification_Topic_Multiple (25.69s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterPrefixAndMultipleTags (32.60s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterPrefix (34.17s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterSingleTag (34.32s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterMultipleTags (34.30s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterPrefixAndSingleTag (34.45s)
--- PASS: TestAccAWSS3BucketNotification_update (36.18s)
--- PASS: TestAccAWSS3BucketObject_contentBase64 (19.60s)
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (16.75s)
--- PASS: TestAccAWSS3BucketObject_NonVersioned (18.22s)
--- PASS: TestAccAWSS3BucketInventory_encryptWithSSEKMS (40.49s)
--- PASS: TestAccAWSS3BucketObject_sse (21.18s)
--- PASS: TestAccAWSS3BucketNotification_LambdaFunction (45.33s)
--- PASS: TestAccAWSS3BucketNotification_LambdaFunction_LambdaFunctionArn_Alias (46.17s)
--- PASS: TestAccAWSS3BucketObject_updateSameFile (31.16s)
--- PASS: TestAccAWSS3BucketObject_updates (33.59s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (33.23s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_bucketDisappears (16.76s)
--- PASS: TestAccAWSS3BucketObject_kms (39.17s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_disappears (22.34s)
--- PASS: TestAccAWSS3BucketPolicy_basic (26.47s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_basic (24.51s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockLegalHoldStartWithOn (33.71s)
--- PASS: TestAccAWSS3BucketObject_acl (46.34s)
--- PASS: TestAccAWSS3BucketObject_metadata (48.04s)
--- PASS: TestAccAWSS3BucketPolicy_policyUpdate (38.40s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockLegalHoldStartWithNone (44.35s)
--- PASS: TestAccAWSS3Bucket_basic (24.09s)
--- PASS: TestAccAWSS3Bucket_Bucket_EmptyString (21.05s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockRetentionStartWithNone (48.40s)
--- PASS: TestAccAWSS3Bucket_namePrefix (22.25s)
--- PASS: TestAccAWSS3BucketObject_tags (59.05s)
--- PASS: TestAccAWSS3Bucket_generatedName (23.51s)
--- PASS: TestAccAWSS3MultiBucket_withTags (28.75s)
--- PASS: TestAccAWSS3BucketObject_storageClass (67.72s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingSlash (60.87s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_BlockPublicAcls (50.10s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_BlockPublicPolicy (49.64s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockRetentionStartWithSet (61.29s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_IgnorePublicAcls (47.13s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_RestrictPublicBuckets (48.85s)
--- PASS: TestAccAWSS3Bucket_shouldFailNotFound (16.46s)
--- PASS: TestAccAWSS3Bucket_RequestPayer (33.57s)
--- PASS: TestAccAWSS3Bucket_UpdateAcl (33.56s)
--- PASS: TestAccAWSS3Bucket_acceleration (40.15s)
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed (22.26s)
--- PASS: TestAccAWSS3Bucket_Cors_Delete (19.94s)
--- PASS: TestAccAWSS3Bucket_Cors_EmptyOrigin (23.96s)
--- PASS: TestAccAWSS3Bucket_WebsiteRoutingRules (36.77s)
--- PASS: TestAccAWSS3Bucket_region (54.71s)
--- PASS: TestAccAWSS3Bucket_Policy (45.99s)
--- PASS: TestAccAWSS3Bucket_Logging (25.35s)
--- PASS: TestAccAWSS3Bucket_tagsWithNoSystemTags (64.28s)
--- PASS: TestAWSS3BucketName (0.01s)
--- PASS: TestBucketRegionalDomainName (0.00s)
--- PASS: TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled (35.55s)
--- PASS: TestAccAWSS3Bucket_Cors_Update (34.02s)
--- PASS: TestAccAWSS3Bucket_WebsiteRedirect (48.28s)
--- PASS: TestAccAWSS3Bucket_Website_Simple (49.69s)
--- FAIL: TestAccAWSS3Bucket_LifecycleBasic (29.86s)
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical (44.14s)
--- PASS: TestAccAWSS3Bucket_forceDestroy (13.86s)
--- PASS: TestAccAWSS3Bucket_Versioning (43.84s)
--- PASS: TestAccAWSS3Bucket_LifecycleExpireMarkerOnly (29.25s)
--- PASS: TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes (14.21s)
--- PASS: TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled (13.78s)
--- PASS: TestAccAWSS3Bucket_objectLock (22.69s)
--- FAIL: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (38.06s)
--- PASS: TestAccAWSS3Bucket_tagsWithSystemTags (93.72s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutStorageClass (60.15s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutPrefix (61.69s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation (122.71s)
--- PASS: TestAccAWSS3Bucket_ReplicationSchemaV2 (154.76s)
--- PASS: TestAccAWSS3Bucket_Replication (181.75s)
Re-run of failed tests:
--- PASS: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (54.07s)
--- PASS: TestAccAWSS3BucketNotification_Queue (31.31s)
--- PASS: TestAccAWSS3Bucket_LifecycleBasic (62.55s)
This has been released in version 2.48.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 for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Closes #11891
Release note for CHANGELOG:
Previously in the acceptance testing (inconsistently across various testing due to eventual consistency):
The HeadBucket/HeadObject S3 APIs work differently than other AWS APIs where they can exclusively return only status code information and not a relevant error code. This update accounts for that discrepency by retrying on 404 status codes on the resource read immediately after bucket creation.
Output from acceptance testing (failures from other eventual consistency issues):
Re-run of failed tests: