-
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
resource/aws_s3_bucket: Checks for duplicate bucket in us-east-1
#26011
Conversation
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=TestAccS3Bucket_' PKG=s3 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 2 -run=TestAccS3Bucket_ -timeout 180m
=== RUN TestAccS3Bucket_Basic_basic
=== PAUSE TestAccS3Bucket_Basic_basic
=== RUN TestAccS3Bucket_Basic_emptyString
=== PAUSE TestAccS3Bucket_Basic_emptyString
=== RUN TestAccS3Bucket_Basic_generatedName
=== PAUSE TestAccS3Bucket_Basic_generatedName
=== RUN TestAccS3Bucket_Basic_namePrefix
=== PAUSE TestAccS3Bucket_Basic_namePrefix
=== RUN TestAccS3Bucket_Basic_forceDestroy
=== PAUSE TestAccS3Bucket_Basic_forceDestroy
=== RUN TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
=== PAUSE TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
=== RUN TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
=== PAUSE TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
=== RUN TestAccS3Bucket_Basic_acceleration
=== PAUSE TestAccS3Bucket_Basic_acceleration
=== RUN TestAccS3Bucket_Basic_keyEnabled
=== PAUSE TestAccS3Bucket_Basic_keyEnabled
=== RUN TestAccS3Bucket_Basic_requestPayer
=== PAUSE TestAccS3Bucket_Basic_requestPayer
=== RUN TestAccS3Bucket_disappears
=== PAUSE TestAccS3Bucket_disappears
=== RUN TestAccS3Bucket_Duplicate_basic
=== PAUSE TestAccS3Bucket_Duplicate_basic
=== RUN TestAccS3Bucket_Duplicate_UsEast1
=== PAUSE TestAccS3Bucket_Duplicate_UsEast1
=== RUN TestAccS3Bucket_Duplicate_UsEast1AltAccount
=== PAUSE TestAccS3Bucket_Duplicate_UsEast1AltAccount
=== RUN TestAccS3Bucket_Tags_basic
=== PAUSE TestAccS3Bucket_Tags_basic
=== RUN TestAccS3Bucket_Tags_withNoSystemTags
=== PAUSE TestAccS3Bucket_Tags_withNoSystemTags
=== RUN TestAccS3Bucket_Tags_withSystemTags
=== PAUSE TestAccS3Bucket_Tags_withSystemTags
=== RUN TestAccS3Bucket_Tags_ignoreTags
=== PAUSE TestAccS3Bucket_Tags_ignoreTags
=== RUN TestAccS3Bucket_Manage_lifecycleBasic
=== PAUSE TestAccS3Bucket_Manage_lifecycleBasic
=== RUN TestAccS3Bucket_Manage_lifecycleExpireMarkerOnly
=== PAUSE TestAccS3Bucket_Manage_lifecycleExpireMarkerOnly
=== RUN TestAccS3Bucket_Manage_lifecycleRuleExpirationEmptyBlock
=== PAUSE TestAccS3Bucket_Manage_lifecycleRuleExpirationEmptyBlock
=== RUN TestAccS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration
=== PAUSE TestAccS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration
=== RUN TestAccS3Bucket_Manage_lifecycleRemove
=== PAUSE TestAccS3Bucket_Manage_lifecycleRemove
=== RUN TestAccS3Bucket_Manage_objectLock
=== PAUSE TestAccS3Bucket_Manage_objectLock
=== RUN TestAccS3Bucket_Manage_objectLock_deprecatedEnabled
=== PAUSE TestAccS3Bucket_Manage_objectLock_deprecatedEnabled
=== RUN TestAccS3Bucket_Manage_objectLock_migrate
=== PAUSE TestAccS3Bucket_Manage_objectLock_migrate
=== RUN TestAccS3Bucket_Manage_objectLockWithVersioning
=== PAUSE TestAccS3Bucket_Manage_objectLockWithVersioning
=== RUN TestAccS3Bucket_Manage_objectLockWithVersioning_deprecatedEnabled
=== PAUSE TestAccS3Bucket_Manage_objectLockWithVersioning_deprecatedEnabled
=== RUN TestAccS3Bucket_Manage_versioning
=== PAUSE TestAccS3Bucket_Manage_versioning
=== RUN TestAccS3Bucket_Manage_versioningDisabled
=== PAUSE TestAccS3Bucket_Manage_versioningDisabled
=== RUN TestAccS3Bucket_Manage_MFADeleteDisabled
=== PAUSE TestAccS3Bucket_Manage_MFADeleteDisabled
=== RUN TestAccS3Bucket_Manage_versioningAndMFADeleteDisabled
=== PAUSE TestAccS3Bucket_Manage_versioningAndMFADeleteDisabled
=== RUN TestAccS3Bucket_Replication_basic
=== PAUSE TestAccS3Bucket_Replication_basic
=== RUN TestAccS3Bucket_Replication_multipleDestinationsEmptyFilter
=== PAUSE TestAccS3Bucket_Replication_multipleDestinationsEmptyFilter
=== RUN TestAccS3Bucket_Replication_multipleDestinationsNonEmptyFilter
=== PAUSE TestAccS3Bucket_Replication_multipleDestinationsNonEmptyFilter
=== RUN TestAccS3Bucket_Replication_twoDestination
=== PAUSE TestAccS3Bucket_Replication_twoDestination
=== RUN TestAccS3Bucket_Replication_ruleDestinationAccessControlTranslation
=== PAUSE TestAccS3Bucket_Replication_ruleDestinationAccessControlTranslation
=== RUN TestAccS3Bucket_Replication_ruleDestinationAddAccessControlTranslation
=== PAUSE TestAccS3Bucket_Replication_ruleDestinationAddAccessControlTranslation
=== RUN TestAccS3Bucket_Replication_withoutStorageClass
=== PAUSE TestAccS3Bucket_Replication_withoutStorageClass
=== RUN TestAccS3Bucket_Replication_expectVersioningValidationError
=== PAUSE TestAccS3Bucket_Replication_expectVersioningValidationError
=== RUN TestAccS3Bucket_Replication_withoutPrefix
=== PAUSE TestAccS3Bucket_Replication_withoutPrefix
=== RUN TestAccS3Bucket_Replication_schemaV2
=== PAUSE TestAccS3Bucket_Replication_schemaV2
=== RUN TestAccS3Bucket_Replication_schemaV2SameRegion
=== PAUSE TestAccS3Bucket_Replication_schemaV2SameRegion
=== RUN TestAccS3Bucket_Replication_RTC_valid
=== PAUSE TestAccS3Bucket_Replication_RTC_valid
=== RUN TestAccS3Bucket_Security_updateACL
=== PAUSE TestAccS3Bucket_Security_updateACL
=== RUN TestAccS3Bucket_Security_updateGrant
=== PAUSE TestAccS3Bucket_Security_updateGrant
=== RUN TestAccS3Bucket_Security_aclToGrant
=== PAUSE TestAccS3Bucket_Security_aclToGrant
=== RUN TestAccS3Bucket_Security_grantToACL
=== PAUSE TestAccS3Bucket_Security_grantToACL
=== RUN TestAccS3Bucket_Security_corsUpdate
=== PAUSE TestAccS3Bucket_Security_corsUpdate
=== RUN TestAccS3Bucket_Security_corsDelete
=== PAUSE TestAccS3Bucket_Security_corsDelete
=== RUN TestAccS3Bucket_Security_corsEmptyOrigin
=== PAUSE TestAccS3Bucket_Security_corsEmptyOrigin
=== RUN TestAccS3Bucket_Security_corsSingleMethodAndEmptyOrigin
=== PAUSE TestAccS3Bucket_Security_corsSingleMethodAndEmptyOrigin
=== RUN TestAccS3Bucket_Security_logging
=== PAUSE TestAccS3Bucket_Security_logging
=== RUN TestAccS3Bucket_Security_enableDefaultEncryptionWhenTypical
=== PAUSE TestAccS3Bucket_Security_enableDefaultEncryptionWhenTypical
=== RUN TestAccS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed
=== PAUSE TestAccS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed
=== RUN TestAccS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled
=== PAUSE TestAccS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled
=== RUN TestAccS3Bucket_Security_policy
=== PAUSE TestAccS3Bucket_Security_policy
=== RUN TestAccS3Bucket_Web_simple
=== PAUSE TestAccS3Bucket_Web_simple
=== RUN TestAccS3Bucket_Web_redirect
=== PAUSE TestAccS3Bucket_Web_redirect
=== RUN TestAccS3Bucket_Web_routingRules
=== PAUSE TestAccS3Bucket_Web_routingRules
=== CONT TestAccS3Bucket_Basic_basic
=== CONT TestAccS3Bucket_Manage_MFADeleteDisabled
--- PASS: TestAccS3Bucket_Manage_MFADeleteDisabled (29.01s)
=== CONT TestAccS3Bucket_Web_routingRules
--- PASS: TestAccS3Bucket_Basic_basic (29.09s)
=== CONT TestAccS3Bucket_Web_redirect
--- PASS: TestAccS3Bucket_Web_routingRules (46.74s)
=== CONT TestAccS3Bucket_Web_simple
--- PASS: TestAccS3Bucket_Web_redirect (68.90s)
=== CONT TestAccS3Bucket_Security_policy
--- PASS: TestAccS3Bucket_Web_simple (67.11s)
=== CONT TestAccS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled
--- PASS: TestAccS3Bucket_Security_policy (59.42s)
=== CONT TestAccS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed
--- PASS: TestAccS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled (46.62s)
=== CONT TestAccS3Bucket_Security_enableDefaultEncryptionWhenTypical
--- PASS: TestAccS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed (46.44s)
=== CONT TestAccS3Bucket_Security_logging
--- PASS: TestAccS3Bucket_Security_enableDefaultEncryptionWhenTypical (28.45s)
=== CONT TestAccS3Bucket_Security_corsSingleMethodAndEmptyOrigin
--- PASS: TestAccS3Bucket_Security_logging (31.04s)
=== CONT TestAccS3Bucket_Security_corsEmptyOrigin
--- PASS: TestAccS3Bucket_Security_corsSingleMethodAndEmptyOrigin (25.82s)
=== CONT TestAccS3Bucket_Security_corsDelete
--- PASS: TestAccS3Bucket_Security_corsEmptyOrigin (27.67s)
=== CONT TestAccS3Bucket_Security_corsUpdate
--- PASS: TestAccS3Bucket_Security_corsDelete (21.91s)
=== CONT TestAccS3Bucket_Security_grantToACL
--- PASS: TestAccS3Bucket_Security_corsUpdate (45.64s)
=== CONT TestAccS3Bucket_Security_aclToGrant
--- PASS: TestAccS3Bucket_Security_grantToACL (46.29s)
=== CONT TestAccS3Bucket_Security_updateGrant
--- PASS: TestAccS3Bucket_Security_aclToGrant (47.07s)
=== CONT TestAccS3Bucket_Security_updateACL
--- PASS: TestAccS3Bucket_Security_updateGrant (70.96s)
=== CONT TestAccS3Bucket_Tags_withNoSystemTags
--- PASS: TestAccS3Bucket_Security_updateACL (44.82s)
=== CONT TestAccS3Bucket_Replication_RTC_valid
--- PASS: TestAccS3Bucket_Tags_withNoSystemTags (90.31s)
=== CONT TestAccS3Bucket_Manage_versioningDisabled
--- PASS: TestAccS3Bucket_Manage_versioningDisabled (31.30s)
=== CONT TestAccS3Bucket_Replication_schemaV2SameRegion
--- PASS: TestAccS3Bucket_Replication_RTC_valid (109.23s)
=== CONT TestAccS3Bucket_Manage_versioning
--- PASS: TestAccS3Bucket_Replication_schemaV2SameRegion (38.63s)
=== CONT TestAccS3Bucket_Replication_schemaV2
--- PASS: TestAccS3Bucket_Manage_versioning (64.42s)
=== CONT TestAccS3Bucket_Manage_objectLockWithVersioning_deprecatedEnabled
--- PASS: TestAccS3Bucket_Manage_objectLockWithVersioning_deprecatedEnabled (37.59s)
=== CONT TestAccS3Bucket_Replication_withoutPrefix
--- PASS: TestAccS3Bucket_Replication_withoutPrefix (42.51s)
=== CONT TestAccS3Bucket_Manage_objectLockWithVersioning
--- PASS: TestAccS3Bucket_Manage_objectLockWithVersioning (29.42s)
=== CONT TestAccS3Bucket_Manage_objectLock_migrate
--- PASS: TestAccS3Bucket_Replication_schemaV2 (149.50s)
=== CONT TestAccS3Bucket_Replication_expectVersioningValidationError
--- PASS: TestAccS3Bucket_Replication_expectVersioningValidationError (12.78s)
=== CONT TestAccS3Bucket_Manage_objectLock_deprecatedEnabled
--- PASS: TestAccS3Bucket_Manage_objectLock_migrate (30.95s)
=== CONT TestAccS3Bucket_Replication_withoutStorageClass
--- PASS: TestAccS3Bucket_Manage_objectLock_deprecatedEnabled (24.81s)
=== CONT TestAccS3Bucket_Manage_objectLock
--- PASS: TestAccS3Bucket_Replication_withoutStorageClass (30.40s)
=== CONT TestAccS3Bucket_Replication_ruleDestinationAddAccessControlTranslation
--- PASS: TestAccS3Bucket_Manage_objectLock (40.41s)
=== CONT TestAccS3Bucket_Manage_lifecycleRemove
--- PASS: TestAccS3Bucket_Replication_ruleDestinationAddAccessControlTranslation (57.54s)
=== CONT TestAccS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration
--- PASS: TestAccS3Bucket_Manage_lifecycleRemove (36.29s)
=== CONT TestAccS3Bucket_Replication_ruleDestinationAccessControlTranslation
--- PASS: TestAccS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration (25.00s)
=== CONT TestAccS3Bucket_Manage_lifecycleRuleExpirationEmptyBlock
--- PASS: TestAccS3Bucket_Manage_lifecycleRuleExpirationEmptyBlock (21.79s)
=== CONT TestAccS3Bucket_Replication_twoDestination
--- PASS: TestAccS3Bucket_Replication_ruleDestinationAccessControlTranslation (52.75s)
=== CONT TestAccS3Bucket_Manage_lifecycleExpireMarkerOnly
--- PASS: TestAccS3Bucket_Replication_twoDestination (31.36s)
=== CONT TestAccS3Bucket_Manage_lifecycleBasic
--- PASS: TestAccS3Bucket_Manage_lifecycleExpireMarkerOnly (41.92s)
=== CONT TestAccS3Bucket_Tags_ignoreTags
--- PASS: TestAccS3Bucket_Manage_lifecycleBasic (40.52s)
=== CONT TestAccS3Bucket_Tags_withSystemTags
--- PASS: TestAccS3Bucket_Tags_ignoreTags (40.73s)
=== CONT TestAccS3Bucket_Replication_multipleDestinationsNonEmptyFilter
--- PASS: TestAccS3Bucket_Replication_multipleDestinationsNonEmptyFilter (31.62s)
=== CONT TestAccS3Bucket_Manage_versioningAndMFADeleteDisabled
--- PASS: TestAccS3Bucket_Manage_versioningAndMFADeleteDisabled (22.74s)
=== CONT TestAccS3Bucket_Basic_keyEnabled
--- PASS: TestAccS3Bucket_Basic_keyEnabled (25.59s)
=== CONT TestAccS3Bucket_Replication_multipleDestinationsEmptyFilter
--- PASS: TestAccS3Bucket_Tags_withSystemTags (125.25s)
=== CONT TestAccS3Bucket_Tags_basic
--- PASS: TestAccS3Bucket_Replication_multipleDestinationsEmptyFilter (31.54s)
=== CONT TestAccS3Bucket_disappears
--- PASS: TestAccS3Bucket_disappears (15.86s)
=== CONT TestAccS3Bucket_Basic_requestPayer
--- PASS: TestAccS3Bucket_Tags_basic (28.05s)
=== CONT TestAccS3Bucket_Replication_basic
--- PASS: TestAccS3Bucket_Basic_requestPayer (40.56s)
=== CONT TestAccS3Bucket_Duplicate_UsEast1AltAccount
acctest.go:604: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccS3Bucket_Duplicate_UsEast1AltAccount (0.00s)
=== CONT TestAccS3Bucket_Basic_forceDestroy
--- PASS: TestAccS3Bucket_Basic_forceDestroy (19.40s)
=== CONT TestAccS3Bucket_Duplicate_UsEast1
--- PASS: TestAccS3Bucket_Duplicate_UsEast1 (6.51s)
=== CONT TestAccS3Bucket_Basic_acceleration
--- PASS: TestAccS3Bucket_Replication_basic (63.08s)
=== CONT TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled (23.11s)
=== CONT TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
--- PASS: TestAccS3Bucket_Basic_acceleration (39.43s)
=== CONT TestAccS3Bucket_Duplicate_basic
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes (19.14s)
=== CONT TestAccS3Bucket_Basic_generatedName
--- PASS: TestAccS3Bucket_Duplicate_basic (12.45s)
=== CONT TestAccS3Bucket_Basic_emptyString
--- PASS: TestAccS3Bucket_Basic_generatedName (22.62s)
=== CONT TestAccS3Bucket_Basic_namePrefix
--- PASS: TestAccS3Bucket_Basic_emptyString (21.79s)
--- PASS: TestAccS3Bucket_Basic_namePrefix (22.40s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/s3 1232.757s
This functionality has been released in v4.24.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. |
The default behaviour of the S3 API is to not return an error in
us-east-1
if the current account owns an existing bucket with the same name. CallingCreateBucket
in this case will reset the bucket's ACL.Now checks for the existence of the bucket to prevent this unexpected behaviour and make it consistent with other regions.
Closes #13587
Output from acceptance testing: