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

resource/aws_s3_bucket: Lifecycle Rule Eventual Consistency #18511

Closed
bflad opened this issue Mar 31, 2021 · 2 comments
Closed

resource/aws_s3_bucket: Lifecycle Rule Eventual Consistency #18511

bflad opened this issue Mar 31, 2021 · 2 comments
Labels
partition/aws-us-gov Pertains to the aws-us-gov partition. service/s3 Issues and PRs that pertain to the s3 service. stale Old or inactive issues managed by automation, if no further action taken these will get closed. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Comments

@bflad
Copy link
Contributor

bflad commented Mar 31, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

The TestAccAWSS3Bucket_LifecycleBasic acceptance test is particularly flaky in AWS GovCloud (US), but typically fine in AWS Commercial. Example errors:

=== CONT  TestAccAWSS3Bucket_LifecycleBasic
    resource_aws_s3_bucket_test.go:1267: Step 3/4 error: Check failed: Check 5/14 error: aws_s3_bucket.bucket: Attribute 'lifecycle_rule.0.noncurrent_version_expiration.0.days' not found
--- FAIL: TestAccAWSS3Bucket_LifecycleBasic (45.47s)
=== CONT  TestAccAWSS3Bucket_LifecycleBasic
    resource_aws_s3_bucket_test.go:1267: Step 4/4 error: After applying this test step, the plan was not empty.
        stdout:


        An execution plan has been generated and is shown below.
        Resource actions are indicated with the following symbols:
          ~ update in-place

        Terraform will perform the following actions:

          # aws_s3_bucket.bucket will be updated in-place
          ~ resource "aws_s3_bucket" "bucket" {
                id                          = "tf-test-bucket-2465403739993944642"
                tags                        = {}
                # (9 unchanged attributes hidden)

              - lifecycle_rule {
                  - abort_incomplete_multipart_upload_days = 0 -> null
                  - enabled                                = true -> null
                  - id                                     = "id1" -> null
                  - prefix                                 = "path1/" -> null
                  - tags                                   = {} -> null

                  - noncurrent_version_expiration {
                      - days = 365 -> null
                    }

                  - noncurrent_version_transition {
                      - days          = 30 -> null
                      - storage_class = "STANDARD_IA" -> null
                    }
                  - noncurrent_version_transition {
                      - days          = 60 -> null
                      - storage_class = "GLACIER" -> null
                    }
                }
              - lifecycle_rule {
                  - abort_incomplete_multipart_upload_days = 0 -> null
                  - enabled                                = false -> null
                  - id                                     = "id2" -> null
                  - prefix                                 = "path2/" -> null
                  - tags                                   = {} -> null

                  - noncurrent_version_expiration {
                      - days = 365 -> null
                    }
                }
              - lifecycle_rule {
                  - abort_incomplete_multipart_upload_days = 0 -> null
                  - enabled                                = true -> null
                  - id                                     = "id3" -> null
                  - prefix                                 = "path3/" -> null
                  - tags                                   = {} -> null

                  - noncurrent_version_transition {
                      - days          = 0 -> null
                      - storage_class = "GLACIER" -> null
                    }
                }

                # (1 unchanged block hidden)
            }

        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccAWSS3Bucket_LifecycleBasic (73.04s)

If it was a simple attribute type, it could likely be mitigated with an attribute waiter, but the TypeSet usage likely complicates this issue since the comparison operations may not align well if the configuration and state values canonicalize differently.

Affected Resource(s)

  • aws_s3_bucket

References

@bflad bflad added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/s3 Issues and PRs that pertain to the s3 service. partition/aws-us-gov Pertains to the aws-us-gov partition. labels Mar 31, 2021
bflad pushed a commit that referenced this issue Apr 2, 2021
Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSS3Bucket_acceleration (77.72s)
--- PASS: TestAccAWSS3Bucket_AclToGrant (67.81s)
--- PASS: TestAccAWSS3Bucket_basic (43.99s)
--- PASS: TestAccAWSS3Bucket_Bucket_EmptyString (44.40s)
--- PASS: TestAccAWSS3Bucket_bucketKeyEnabled (43.09s)
--- PASS: TestAccAWSS3Bucket_Cors_Delete (31.97s)
--- PASS: TestAccAWSS3Bucket_Cors_EmptyOrigin (40.73s)
--- PASS: TestAccAWSS3Bucket_Cors_Update (75.47s)
--- PASS: TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled (71.37s)
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed (40.40s)
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical (43.33s)
--- PASS: TestAccAWSS3Bucket_forceDestroy (31.28s)
--- PASS: TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes (34.81s)
--- PASS: TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled (37.66s)
--- PASS: TestAccAWSS3Bucket_generatedName (37.26s)
--- PASS: TestAccAWSS3Bucket_GrantToAcl (68.73s)
--- PASS: TestAccAWSS3Bucket_ignoreTags (68.51s)
--- PASS: TestAccAWSS3Bucket_LifecycleBasic (91.66s)
--- PASS: TestAccAWSS3Bucket_LifecycleExpireMarkerOnly (71.82s)
--- PASS: TestAccAWSS3Bucket_LifecycleRule_AbortIncompleteMultipartUploadDays_NoExpiration (38.91s)
--- PASS: TestAccAWSS3Bucket_LifecycleRule_Expiration_EmptyConfigurationBlock (31.06s)
--- PASS: TestAccAWSS3Bucket_Logging (63.26s)
--- PASS: TestAccAWSS3Bucket_namePrefix (46.80s)
--- PASS: TestAccAWSS3Bucket_objectLock (68.55s)
--- PASS: TestAccAWSS3Bucket_Policy (100.51s)
--- PASS: TestAccAWSS3Bucket_Replication (141.65s)
--- PASS: TestAccAWSS3Bucket_Replication_MultipleDestinations_EmptyFilter (49.89s)
--- PASS: TestAccAWSS3Bucket_Replication_MultipleDestinations_NonEmptyFilter (49.86s)
--- PASS: TestAccAWSS3Bucket_Replication_MultipleDestinations_TwoDestination (46.15s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation (87.62s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AddAccessControlTranslation (86.86s)
--- PASS: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (14.78s)
--- PASS: TestAccAWSS3Bucket_ReplicationSchemaV2 (163.32s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutPrefix (51.27s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutStorageClass (45.50s)
--- PASS: TestAccAWSS3Bucket_RequestPayer (70.57s)
--- PASS: TestAccAWSS3Bucket_SameRegionReplicationSchemaV2 (56.90s)
--- PASS: TestAccAWSS3Bucket_shouldFailNotFound (20.04s)
--- PASS: TestAccAWSS3Bucket_tagsWithNoSystemTags (140.95s)
--- PASS: TestAccAWSS3Bucket_tagsWithSystemTags (177.22s)
--- PASS: TestAccAWSS3Bucket_UpdateAcl (78.18s)
--- PASS: TestAccAWSS3Bucket_UpdateGrant (108.69s)
--- PASS: TestAccAWSS3Bucket_Versioning (103.73s)
--- PASS: TestAccAWSS3Bucket_Website_Simple (106.81s)
--- PASS: TestAccAWSS3Bucket_WebsiteRedirect (110.01s)
--- PASS: TestAccAWSS3Bucket_WebsiteRoutingRules (73.38s)

--- PASS: TestAccAWSS3BucketObject_acl (97.64s)
--- PASS: TestAccAWSS3BucketObject_bucketBucketKeyEnabled (47.14s)
--- PASS: TestAccAWSS3BucketObject_content (33.47s)
--- PASS: TestAccAWSS3BucketObject_contentBase64 (31.68s)
--- PASS: TestAccAWSS3BucketObject_defaultBucketSSE (40.86s)
--- PASS: TestAccAWSS3BucketObject_empty (32.54s)
--- PASS: TestAccAWSS3BucketObject_etagEncryption (33.10s)
--- PASS: TestAccAWSS3BucketObject_ignoreTags (69.05s)
--- PASS: TestAccAWSS3BucketObject_kms (38.94s)
--- PASS: TestAccAWSS3BucketObject_metadata (90.62s)
--- PASS: TestAccAWSS3BucketObject_noNameNoKey (2.10s)
--- PASS: TestAccAWSS3BucketObject_NonVersioned (31.53s)
--- PASS: TestAccAWSS3BucketObject_objectBucketKeyEnabled (38.89s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockLegalHoldStartWithNone (91.67s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockLegalHoldStartWithOn (60.02s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockRetentionStartWithNone (92.71s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockRetentionStartWithSet (116.24s)
--- PASS: TestAccAWSS3BucketObject_source (33.40s)
--- PASS: TestAccAWSS3BucketObject_sse (38.30s)
--- PASS: TestAccAWSS3BucketObject_storageClass (150.35s)
--- PASS: TestAccAWSS3BucketObject_tags (123.37s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingMultipleSlashes (126.89s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingSingleSlash (126.64s)
--- PASS: TestAccAWSS3BucketObject_tagsMultipleSlashes (117.47s)
--- PASS: TestAccAWSS3BucketObject_updates (60.84s)
--- PASS: TestAccAWSS3BucketObject_updateSameFile (60.72s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (61.90s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioningViaAccessPoint (76.09s)
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (31.05s)

--- PASS: TestAccDataSourceAWSS3BucketObject_allParams (37.71s)
--- PASS: TestAccDataSourceAWSS3BucketObject_basic (39.61s)
--- PASS: TestAccDataSourceAWSS3BucketObject_basicViaAccessPoint (39.30s)
--- PASS: TestAccDataSourceAWSS3BucketObject_bucketKeyEnabled (41.45s)
--- PASS: TestAccDataSourceAWSS3BucketObject_kmsEncrypted (38.94s)
--- PASS: TestAccDataSourceAWSS3BucketObject_LeadingSlash (67.65s)
--- PASS: TestAccDataSourceAWSS3BucketObject_MultipleSlashes (66.64s)
--- PASS: TestAccDataSourceAWSS3BucketObject_ObjectLockLegalHoldOff (37.55s)
--- PASS: TestAccDataSourceAWSS3BucketObject_ObjectLockLegalHoldOn (38.33s)
--- PASS: TestAccDataSourceAWSS3BucketObject_readableBody (35.63s)
--- PASS: TestAccDataSourceAWSS3BucketObject_SingleSlashAsKey (31.84s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- FAIL: TestAccAWSS3Bucket_LifecycleBasic (45.90s) # #18511
--- PASS: TestAccAWSS3Bucket_AclToGrant (72.45s)
--- PASS: TestAccAWSS3Bucket_basic (39.51s)
--- PASS: TestAccAWSS3Bucket_Bucket_EmptyString (40.99s)
--- PASS: TestAccAWSS3Bucket_bucketKeyEnabled (57.24s)
--- PASS: TestAccAWSS3Bucket_Cors_Delete (33.66s)
--- PASS: TestAccAWSS3Bucket_Cors_EmptyOrigin (43.24s)
--- PASS: TestAccAWSS3Bucket_Cors_Update (76.55s)
--- PASS: TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled (83.35s)
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed (50.07s)
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical (59.66s)
--- PASS: TestAccAWSS3Bucket_forceDestroy (41.90s)
--- PASS: TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes (41.74s)
--- PASS: TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled (43.77s)
--- PASS: TestAccAWSS3Bucket_generatedName (39.92s)
--- PASS: TestAccAWSS3Bucket_GrantToAcl (76.18s)
--- PASS: TestAccAWSS3Bucket_ignoreTags (69.36s)
--- PASS: TestAccAWSS3Bucket_LifecycleExpireMarkerOnly (52.92s)
--- PASS: TestAccAWSS3Bucket_LifecycleRule_AbortIncompleteMultipartUploadDays_NoExpiration (42.01s)
--- PASS: TestAccAWSS3Bucket_LifecycleRule_Expiration_EmptyConfigurationBlock (33.30s)
--- PASS: TestAccAWSS3Bucket_Logging (54.19s)
--- PASS: TestAccAWSS3Bucket_namePrefix (41.12s)
--- PASS: TestAccAWSS3Bucket_objectLock (82.24s)
--- PASS: TestAccAWSS3Bucket_Policy (109.36s)
--- PASS: TestAccAWSS3Bucket_Replication (167.07s)
--- PASS: TestAccAWSS3Bucket_Replication_MultipleDestinations_TwoDestination (64.85s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation (105.07s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AddAccessControlTranslation (68.50s)
--- PASS: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (21.57s)
--- PASS: TestAccAWSS3Bucket_ReplicationSchemaV2 (177.48s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutPrefix (64.72s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutStorageClass (51.92s)
--- PASS: TestAccAWSS3Bucket_RequestPayer (79.18s)
--- PASS: TestAccAWSS3Bucket_SameRegionReplicationSchemaV2 (70.20s)
--- PASS: TestAccAWSS3Bucket_shouldFailNotFound (28.74s)
--- PASS: TestAccAWSS3Bucket_tagsWithNoSystemTags (146.42s)
--- PASS: TestAccAWSS3Bucket_tagsWithSystemTags (195.57s)
--- PASS: TestAccAWSS3Bucket_UpdateAcl (69.73s)
--- PASS: TestAccAWSS3Bucket_UpdateGrant (113.18s)
--- PASS: TestAccAWSS3Bucket_Versioning (110.36s)
--- PASS: TestAccAWSS3Bucket_Website_Simple (105.63s)
--- PASS: TestAccAWSS3Bucket_WebsiteRedirect (122.37s)
--- PASS: TestAccAWSS3Bucket_WebsiteRoutingRules (83.63s)
--- SKIP: TestAccAWSS3Bucket_acceleration (0.00s)
--- SKIP: TestAccAWSS3Bucket_Replication_MultipleDestinations_EmptyFilter (31.31s)
--- SKIP: TestAccAWSS3Bucket_Replication_MultipleDestinations_NonEmptyFilter (29.41s)

--- PASS: TestAccAWSS3BucketObject_acl (80.47s)
--- PASS: TestAccAWSS3BucketObject_bucketBucketKeyEnabled (43.37s)
--- PASS: TestAccAWSS3BucketObject_content (35.12s)
--- PASS: TestAccAWSS3BucketObject_contentBase64 (33.84s)
--- PASS: TestAccAWSS3BucketObject_defaultBucketSSE (43.09s)
--- PASS: TestAccAWSS3BucketObject_empty (36.84s)
--- PASS: TestAccAWSS3BucketObject_etagEncryption (34.47s)
--- PASS: TestAccAWSS3BucketObject_ignoreTags (68.34s)
--- PASS: TestAccAWSS3BucketObject_kms (32.07s)
--- PASS: TestAccAWSS3BucketObject_metadata (78.86s)
--- PASS: TestAccAWSS3BucketObject_noNameNoKey (3.25s)
--- PASS: TestAccAWSS3BucketObject_objectBucketKeyEnabled (35.73s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockLegalHoldStartWithNone (94.04s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockLegalHoldStartWithOn (69.24s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockRetentionStartWithNone (90.95s)
--- PASS: TestAccAWSS3BucketObject_ObjectLockRetentionStartWithSet (122.98s)
--- PASS: TestAccAWSS3BucketObject_source (34.57s)
--- PASS: TestAccAWSS3BucketObject_sse (31.84s)
--- PASS: TestAccAWSS3BucketObject_storageClass (126.89s)
--- PASS: TestAccAWSS3BucketObject_tags (111.75s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingMultipleSlashes (117.49s)
--- PASS: TestAccAWSS3BucketObject_tagsLeadingSingleSlash (115.91s)
--- PASS: TestAccAWSS3BucketObject_tagsMultipleSlashes (114.99s)
--- PASS: TestAccAWSS3BucketObject_updates (69.26s)
--- PASS: TestAccAWSS3BucketObject_updateSameFile (66.18s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioning (67.47s)
--- PASS: TestAccAWSS3BucketObject_updatesWithVersioningViaAccessPoint (70.95s)
--- PASS: TestAccAWSS3BucketObject_withContentCharacteristics (33.42s)
--- SKIP: TestAccAWSS3BucketObject_NonVersioned (0.05s)

--- PASS: TestAccDataSourceAWSS3BucketObject_allParams (38.87s)
--- PASS: TestAccDataSourceAWSS3BucketObject_basic (42.58s)
--- PASS: TestAccDataSourceAWSS3BucketObject_basicViaAccessPoint (38.88s)
--- PASS: TestAccDataSourceAWSS3BucketObject_bucketKeyEnabled (38.86s)
--- PASS: TestAccDataSourceAWSS3BucketObject_kmsEncrypted (41.60s)
--- PASS: TestAccDataSourceAWSS3BucketObject_LeadingSlash (72.16s)
--- PASS: TestAccDataSourceAWSS3BucketObject_MultipleSlashes (76.35s)
--- PASS: TestAccDataSourceAWSS3BucketObject_ObjectLockLegalHoldOff (41.74s)
--- PASS: TestAccDataSourceAWSS3BucketObject_ObjectLockLegalHoldOn (38.42s)
--- PASS: TestAccDataSourceAWSS3BucketObject_readableBody (38.45s)
--- PASS: TestAccDataSourceAWSS3BucketObject_SingleSlashAsKey (34.70s)
```
@github-actions
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Mar 22, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2023
Copy link

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 have found a problem that seems similar to this, 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 Jan 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
partition/aws-us-gov Pertains to the aws-us-gov partition. service/s3 Issues and PRs that pertain to the s3 service. stale Old or inactive issues managed by automation, if no further action taken these will get closed. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

No branches or pull requests

1 participant