-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Allow AWS Local Zones (LocalZone) as locationType F_aws_s3 directory_bucket_enchancements #40944
Allow AWS Local Zones (LocalZone) as locationType F_aws_s3 directory_bucket_enchancements #40944
Conversation
Community NoteVoting for Prioritization
For Submitters
|
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.
Welcome @romsrb 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
% make testacc TESTARGS='-run=TestAccS3DirectoryBucket_' PKG=s3 ACCTEST_PARALLELISM=4 make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... TF_ACC=1 go1.23.5 test ./internal/service/s3/... -v -count 1 -parallel 4 -run=TestAccS3DirectoryBucket_ -timeout 360m -vet=off 2025/02/26 16:55:51 Initializing Terraform AWS Provider... === RUN TestAccS3DirectoryBucket_basic === PAUSE TestAccS3DirectoryBucket_basic === RUN TestAccS3DirectoryBucket_disappears === PAUSE TestAccS3DirectoryBucket_disappears === RUN TestAccS3DirectoryBucket_forceDestroy === PAUSE TestAccS3DirectoryBucket_forceDestroy === RUN TestAccS3DirectoryBucket_forceDestroyWithUnusualKeyBytes === PAUSE TestAccS3DirectoryBucket_forceDestroyWithUnusualKeyBytes === CONT TestAccS3DirectoryBucket_basic === CONT TestAccS3DirectoryBucket_forceDestroy === CONT TestAccS3DirectoryBucket_disappears === CONT TestAccS3DirectoryBucket_forceDestroyWithUnusualKeyBytes --- PASS: TestAccS3DirectoryBucket_disappears (15.56s) --- PASS: TestAccS3DirectoryBucket_forceDestroy (15.58s) --- PASS: TestAccS3DirectoryBucket_forceDestroyWithUnusualKeyBytes (15.64s) --- PASS: TestAccS3DirectoryBucket_basic (17.87s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/s3 23.684s
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=TestAccS3DirectoryBucket_\|TestAccS3Bucket_Basic\|TestAccS3Bucket_disappears' PKG=s3 ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/s3/... -v -count 1 -parallel 3 -run=TestAccS3DirectoryBucket_\|TestAccS3Bucket_Basic\|TestAccS3Bucket_disappears -timeout 360m -vet=off
2025/02/27 10:58:13 Initializing Terraform AWS Provider...
=== RUN TestAccS3Bucket_Basic_basic
=== PAUSE TestAccS3Bucket_Basic_basic
=== RUN TestAccS3Bucket_Basic_emptyString
=== PAUSE TestAccS3Bucket_Basic_emptyString
=== RUN TestAccS3Bucket_Basic_nameGenerated
=== PAUSE TestAccS3Bucket_Basic_nameGenerated
=== RUN TestAccS3Bucket_Basic_namePrefix
=== PAUSE TestAccS3Bucket_Basic_namePrefix
=== RUN TestAccS3Bucket_Basic_forceDestroy
=== PAUSE TestAccS3Bucket_Basic_forceDestroy
=== RUN TestAccS3Bucket_Basic_forceDestroyWithUnusualKeyBytes
=== PAUSE TestAccS3Bucket_Basic_forceDestroyWithUnusualKeyBytes
=== RUN TestAccS3Bucket_Basic_forceDestroyWithObjectVersions
=== PAUSE TestAccS3Bucket_Basic_forceDestroyWithObjectVersions
=== RUN TestAccS3Bucket_Basic_forceDestroyWithObjectVersionsUnusualKeyBytes
=== PAUSE TestAccS3Bucket_Basic_forceDestroyWithObjectVersionsUnusualKeyBytes
=== 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 TestAccS3DirectoryBucket_basic
=== PAUSE TestAccS3DirectoryBucket_basic
=== RUN TestAccS3DirectoryBucket_disappears
=== PAUSE TestAccS3DirectoryBucket_disappears
=== RUN TestAccS3DirectoryBucket_forceDestroy
=== PAUSE TestAccS3DirectoryBucket_forceDestroy
=== RUN TestAccS3DirectoryBucket_forceDestroyWithUnusualKeyBytes
=== PAUSE TestAccS3DirectoryBucket_forceDestroyWithUnusualKeyBytes
=== RUN TestAccS3DirectoryBucket_defaultDataRedundancy
=== PAUSE TestAccS3DirectoryBucket_defaultDataRedundancy
=== CONT TestAccS3Bucket_Basic_basic
=== CONT TestAccS3Bucket_Basic_acceleration
=== CONT TestAccS3DirectoryBucket_disappears
--- PASS: TestAccS3DirectoryBucket_disappears (15.11s)
=== CONT TestAccS3DirectoryBucket_defaultDataRedundancy
--- PASS: TestAccS3Bucket_Basic_basic (18.13s)
=== CONT TestAccS3DirectoryBucket_forceDestroyWithUnusualKeyBytes
--- PASS: TestAccS3DirectoryBucket_forceDestroyWithUnusualKeyBytes (14.10s)
=== CONT TestAccS3DirectoryBucket_forceDestroy
--- PASS: TestAccS3DirectoryBucket_defaultDataRedundancy (17.42s)
=== CONT TestAccS3Bucket_disappears
--- PASS: TestAccS3Bucket_Basic_acceleration (34.48s)
=== CONT TestAccS3DirectoryBucket_basic
--- PASS: TestAccS3Bucket_disappears (13.04s)
=== CONT TestAccS3Bucket_Basic_requestPayer
--- PASS: TestAccS3DirectoryBucket_forceDestroy (14.68s)
=== CONT TestAccS3Bucket_Basic_forceDestroyWithUnusualKeyBytes
--- PASS: TestAccS3DirectoryBucket_basic (17.63s)
=== CONT TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithUnusualKeyBytes (14.04s)
=== CONT TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled (18.72s)
=== CONT TestAccS3Bucket_Basic_forceDestroyWithObjectVersionsUnusualKeyBytes
--- PASS: TestAccS3Bucket_Basic_requestPayer (29.54s)
=== CONT TestAccS3Bucket_Basic_forceDestroyWithObjectVersions
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes (14.32s)
=== CONT TestAccS3Bucket_Basic_namePrefix
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithObjectVersionsUnusualKeyBytes (18.28s)
=== CONT TestAccS3Bucket_Basic_forceDestroy
--- PASS: TestAccS3Bucket_Basic_namePrefix (17.33s)
=== CONT TestAccS3Bucket_Basic_keyEnabled
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithObjectVersions (18.93s)
=== CONT TestAccS3Bucket_Basic_nameGenerated
--- PASS: TestAccS3Bucket_Basic_forceDestroy (14.32s)
=== CONT TestAccS3Bucket_Basic_emptyString
--- PASS: TestAccS3Bucket_Basic_nameGenerated (17.60s)
--- PASS: TestAccS3Bucket_Basic_keyEnabled (19.90s)
--- PASS: TestAccS3Bucket_Basic_emptyString (18.15s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/s3 127.105s
Acceptance test output: % make testacc TESTARGS='-run=TestAccS3DirectoryBucket_upgradeDefaultDataRedundancy' PKG=s3 make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... TF_ACC=1 go1.23.5 test ./internal/service/s3/... -v -count 1 -parallel 20 -run=TestAccS3DirectoryBucket_upgradeDefaultDataRedundancy -timeout 360m -vet=off 2025/02/27 11:10:55 Initializing Terraform AWS Provider... === RUN TestAccS3DirectoryBucket_upgradeDefaultDataRedundancy === PAUSE TestAccS3DirectoryBucket_upgradeDefaultDataRedundancy === CONT TestAccS3DirectoryBucket_upgradeDefaultDataRedundancy --- PASS: TestAccS3DirectoryBucket_upgradeDefaultDataRedundancy (51.84s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/s3 57.463s
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 🚀
@romsrb Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.89.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! |
Description
Adds support for
SingleLocalZone
Changes below include:
LocalZone
to create a directory bucket and DataRedundancy =SingleLocalZone
LocalZone
LocationInfoModel
from directory_bucket.go tomodels
folder so that the struct values can be used bydata_redundancy_plan_modifier
as well.Changes above do not impact when location type = "AvailabilityZone"
Relations
Closes #0000
References
Output from Acceptance Testing
make testacc TESTS=TestAccS3DirectoryBucket_LocationTypeValidation PKG=s3
Output :
make testacc TESTS=TestAccS3DirectoryBucket_dataRedundancyValidation PKG=s3
Output :
make testacc TESTS=TestAccS3DirectoryBucket_dataRedundancyEmpty PKG=s3
Output:
make testacc TESTS=TestAccS3DirectoryBucket_DataRedundancyPlanModifier_Basic PKG=s3
Output :
make testacc TESTS=TestAccS3DirectoryBucket_LocationTypeValidation_Unexpected PKG=s3
Output:
Below are the testing scenarios performed locally on AZ and LZ AWS accounts.
Invalid Data Redundancy value for Bucket configuration.
SingleAvailabilityZone
, bucket creation was successful.SingleLocalZone
, bucket creation failed with the following error :Invalid Data Redundancy value for Bucket configuration.
LocalZone
and DR asSingleLocalZone
, bucket creation failed with the below error :Invalid Data Redundancy value for Bucket configuration.
- Added AvailabilityZone in location type, bucket creation failed with the following error :
InvalidRequest: Invalid Type value for Location configuration.
- Removed location Type and DataRedundancy(DR) from the terraform config, bucket creation failed with the following error :
InvalidRequest: Invalid Data Redundancy value for Bucket configuration.
, since passing it as null sets the default values for both LocationType and DataRedundancy- Added LocalZone in location type: bucket created successfully.
- Passed DR value as
SingleLocalZone
and LocationType asLocalZone
, bucket creation was successful.- Passed DR value as
SingleAvailabilityZone
, bucket creation failed with the following error :InvalidRequest: Invalid Type value for Location configuration.
...