-
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
Independent S3 Bucket Replication Configuration Resource #20777
Independent S3 Bucket Replication Configuration Resource #20777
Conversation
Blocking out general structure for new independent resource for managing the s3 bucket replication configuration settings Pulling over logic from resource s3 bucket to start with
…thub.com:dkujawski/terraform-provider-aws into dk-FCC-332-bi-directional-s3-replication-support
Rename resource names to reflect new position in configuration scope of the independent resource. Use literal strings instead of fmt.Sprint in hcl concatination
Ensure that the source bucket name is configured in the HCL Ensure that when importing the bucket name is passed in to the process as the import id value
Relocate replication testing helper functions out of the s3 bucket tests and into the replication configuration testing file. Remove s3 bucket existance checks from replication testing per does not apply to the replication resource logic.
Adding schema for ExistingObjectReplication configuration Adding read logic to identify ExistingObjectReplication configurations added to replication rules Adding update logic to include ExistingObjectReplicaiton configuration in the PutBucketReplicaiton input
In order for ExistingObjectReplication to work on s3 buckets, a request to AWS Technical Support needs to be made. Once they allow the configuration the test will operate as expected.
new schema definition for "replication_time" along with update and read logic. tracking upstream changes, adopt "waiter" module
Metrics are a requirement for the Replication Time Control functionality. Adding it here. Restructure the configuration read logic for Replication Time to be more correct and inline with expected data structures Update tests to reflect changes
Update the the source_selection_criteria configuration to include the replica_modificaions. Refactored sse_kms_encrypted_objects schema to map closer to the actual AWS SDK structure.
Hashicorp, please MERGE this!!!! |
Updated tests to reflect upstream changes and V2 related requirements from AWS.
|
…onal-s3-replication-support
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.
Hi @dkujawski -- overall this is looking pretty great! With the service package refactor, some naming conventions have changed just a bit in our test files so I'm going to give a quick re-look and push up a commit to get those inline and have this ready for merging for this week's release
Hi again @dkujawski -- I've come across strange test errors when running against terraform CLI 0.14.0 so i'm going to double-check if there's any additional work needed, as the tests are certainly all passing when using the latest version of terraform (1.0.11) and as far back as 0.14.7 Example test errors (terraform CLI 0.14.0:
Update: since the errors are coming from 0.1.4.0 but look to be fixed in later versions of 0.14.x, we'll consider them as upstream and not hold off on the merge |
This functionality has been released in v3.66.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 #20360
S3 Bucket Replication Configuration
Currently the S3 bucket replication configuration is managed as an internal object of the
aws_s3_bucket
resource. When attempting to configure multi-directional replication between many buckets, a circular dependency error is detected and triggered by Terraform.The Fix
aws_s3_bucket_replication_configuration
to define replication configurations between s3 buckets.Proposed HCL representations
Here are implementation examples showing what the HCL will look like. The first code blocks define the
aws_s3_bucket
configurations assumed to be present in the rest of the examples. Note thelifecycle
additions needed to avoid conflicts between existing replication configuration blocks that may exist in theaws_s3_bucket
and the new independentaws_s3_bucket_replication_configuration
resource.Align with the Go SDK v2 structs for PutBucketReplicationInput
In this example we are working to map the structures as they are defined in the Go AWS SDK v2. Following the lead of AWS may be the safest way forward to avoid any potential drift and take advantage of any forward thinking that they have built into the current API.
New Functionality
Considerations
Imperfections
Note: These imperfections are expected to be resolved in the next major version release when the internal configuration blocks are set to a read-only state.
aws_s3_bucket
and this newaws_s3_bucket_replication_configuration resource
.Related issues
#16539
#12223
#4418
Output from acceptance testing: