-
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
Add delete marker replication to v2 s3 config #19323
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.
Welcome @mkrant 👋
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 CONTRIBUTING 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! 😃
5a2c5b1
to
64b37e3
Compare
I could not find a better approach to keep this backwards compatible for V2 configurations due to the way the state is getting saved and diffed on subsequent This v1 versus v2 replication issue gets a little awkward given the different scenarios as described in the AWS docs. The following behaviors with this change are outlined below. V1 ConfigurationThe If using V1 configuration, including a
V2 ConfigurationThis change makes the If
If the |
fc86652
to
a991d47
Compare
This is not correct as of November 2020. Replication status can be set to "Enabled" in V2. Please refer to the documentation: https://docs.aws.amazon.com/AmazonS3/latest/userguide/delete-marker-replication.html Here's a link to the initial announcement: https://aws.amazon.com/about-aws/whats-new/2020/11/amazon-s3-replication-adds-support-for-replicating-delete-markers/ |
Unfortunately it does looks like tag-based replication is not supported. From the article: And double checking when running locally with tags and delete_marker_replication enabled, you get this error:
|
Oh, yes, you are absolutely right. I read your initial comment wrong: I was thinking of the |
I need this feature so I can deploy bucket changes. What is the hold up? |
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.
+1
What needs to be done to make this PR merged? |
+1 , Please prioritise this one, Its kinda a security feature we want to implement. |
Noted by issue 16250. This adds the option to Enable or Disable delete marker replication when working with v2 S3 replication config. Note that the v1 replication config does not support the ability to toggle delete marker replication; it is always on by default.
a991d47
to
8f969a1
Compare
@mkrant I changed the implementation to avoid this being a breaking change. A breaking change would require waiting until v4.0.0. Now, instead, use Also, I've broken down the s3 bucket acceptance tests into 6 subcategories:
This allows easier testing of individual areas. |
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.
Looks good! 🎉
Output from acceptance tests (us-west-2
):
--- PASS: TestAccAWSS3Bucket_Basic_acceleration (138.19s)
--- PASS: TestAccAWSS3Bucket_Basic_basic (35.65s)
--- PASS: TestAccAWSS3Bucket_Basic_emptyString (57.26s)
--- PASS: TestAccAWSS3Bucket_Basic_forceDestroy (67.05s)
--- PASS: TestAccAWSS3Bucket_Basic_forceDestroyWithEmptyPrefixes (58.40s)
--- PASS: TestAccAWSS3Bucket_Basic_forceDestroyWithObjectLockEnabled (70.77s)
--- PASS: TestAccAWSS3Bucket_Basic_generatedName (75.56s)
--- PASS: TestAccAWSS3Bucket_Basic_keyEnabled (84.51s)
--- PASS: TestAccAWSS3Bucket_Basic_namePrefix (63.89s)
--- PASS: TestAccAWSS3Bucket_Basic_requestPayer (122.71s)
--- PASS: TestAccAWSS3Bucket_Basic_shouldFailNotFound (46.28s)
--- PASS: TestAccAWSS3Bucket_Manage_lifecycleBasic (216.47s)
--- PASS: TestAccAWSS3Bucket_Manage_lifecycleExpireMarkerOnly (152.20s)
--- PASS: TestAccAWSS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration (27.88s)
--- PASS: TestAccAWSS3Bucket_Manage_lifecycleRuleExpirationEmptyConfigurationBlock (62.57s)
--- PASS: TestAccAWSS3Bucket_Manage_objectLock (138.68s)
--- PASS: TestAccAWSS3Bucket_Manage_versioning (182.56s)
--- PASS: TestAccAWSS3Bucket_Replication_basic (291.70s)
--- PASS: TestAccAWSS3Bucket_Replication_configurationRuleDestinationAccessControlTranslation (181.22s)
--- PASS: TestAccAWSS3Bucket_Replication_configurationRuleDestinationAddAccessControlTranslation (179.38s)
--- PASS: TestAccAWSS3Bucket_Replication_expectVersioningValidationError (23.68s)
--- PASS: TestAccAWSS3Bucket_Replication_multipleDestinationsEmptyFilter (106.88s)
--- PASS: TestAccAWSS3Bucket_Replication_multipleDestinationsNonEmptyFilter (106.46s)
--- PASS: TestAccAWSS3Bucket_Replication_schemaV2 (321.86s)
--- PASS: TestAccAWSS3Bucket_Replication_schemaV2SameRegion (103.40s)
--- PASS: TestAccAWSS3Bucket_Replication_twoDestination (105.07s)
--- PASS: TestAccAWSS3Bucket_Replication_withoutPrefix (104.26s)
--- PASS: TestAccAWSS3Bucket_Replication_withoutStorageClass (103.84s)
--- PASS: TestAccAWSS3Bucket_Security_ACLToGrant (106.82s)
--- PASS: TestAccAWSS3Bucket_Security_corsDelete (63.52s)
--- PASS: TestAccAWSS3Bucket_Security_corsEmptyOrigin (28.70s)
--- PASS: TestAccAWSS3Bucket_Security_corsUpdate (149.34s)
--- PASS: TestAccAWSS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled (141.29s)
--- PASS: TestAccAWSS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed (77.43s)
--- PASS: TestAccAWSS3Bucket_Security_enableDefaultEncryptionWhenTypical (85.97s)
--- PASS: TestAccAWSS3Bucket_Security_GrantToACL (111.13s)
--- PASS: TestAccAWSS3Bucket_Security_logging (101.73s)
--- PASS: TestAccAWSS3Bucket_Security_policy (128.88s)
--- PASS: TestAccAWSS3Bucket_Security_updateACL (101.50s)
--- PASS: TestAccAWSS3Bucket_Security_updateGrant (201.50s)
--- PASS: TestAccAWSS3Bucket_Tags_basic (79.92s)
--- PASS: TestAccAWSS3Bucket_Tags_ignoreTags (103.56s)
--- PASS: TestAccAWSS3Bucket_Tags_withNoSystemTags (148.48s)
--- PASS: TestAccAWSS3Bucket_Tags_withSystemTags (192.13s)
--- PASS: TestAccAWSS3Bucket_Web_redirect (145.03s)
--- PASS: TestAccAWSS3Bucket_Web_routingRules (140.28s)
--- PASS: TestAccAWSS3Bucket_Web_simple (172.93s)
Output from acceptance tests (GovCloud
):
Failure is unrelated to these changes (see #18511).
--- FAIL: TestAccAWSS3Bucket_Manage_lifecycleBasic (106.62s) // unrelated failure
--- PASS: TestAccAWSS3Bucket_Basic_basic (104.11s)
--- PASS: TestAccAWSS3Bucket_Basic_emptyString (56.33s)
--- PASS: TestAccAWSS3Bucket_Basic_forceDestroy (72.96s)
--- PASS: TestAccAWSS3Bucket_Basic_forceDestroyWithEmptyPrefixes (73.59s)
--- PASS: TestAccAWSS3Bucket_Basic_forceDestroyWithObjectLockEnabled (77.85s)
--- PASS: TestAccAWSS3Bucket_Basic_generatedName (102.78s)
--- PASS: TestAccAWSS3Bucket_Basic_keyEnabled (108.50s)
--- PASS: TestAccAWSS3Bucket_Basic_namePrefix (106.02s)
--- PASS: TestAccAWSS3Bucket_Basic_requestPayer (177.04s)
--- PASS: TestAccAWSS3Bucket_Basic_shouldFailNotFound (59.50s)
--- PASS: TestAccAWSS3Bucket_Manage_lifecycleExpireMarkerOnly (71.29s)
--- PASS: TestAccAWSS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration (62.48s)
--- PASS: TestAccAWSS3Bucket_Manage_lifecycleRuleExpirationEmptyConfigurationBlock (63.85s)
--- PASS: TestAccAWSS3Bucket_Manage_objectLock (135.36s)
--- PASS: TestAccAWSS3Bucket_Manage_versioning (240.26s)
--- PASS: TestAccAWSS3Bucket_Replication_basic (171.58s)
--- PASS: TestAccAWSS3Bucket_Replication_configurationRuleDestinationAccessControlTranslation (143.51s)
--- PASS: TestAccAWSS3Bucket_Replication_configurationRuleDestinationAddAccessControlTranslation (104.42s)
--- PASS: TestAccAWSS3Bucket_Replication_expectVersioningValidationError (40.57s)
--- PASS: TestAccAWSS3Bucket_Replication_schemaV2 (211.41s)
--- PASS: TestAccAWSS3Bucket_Replication_schemaV2SameRegion (96.91s)
--- PASS: TestAccAWSS3Bucket_Replication_twoDestination (100.33s)
--- PASS: TestAccAWSS3Bucket_Replication_withoutPrefix (88.99s)
--- PASS: TestAccAWSS3Bucket_Replication_withoutStorageClass (86.39s)
--- PASS: TestAccAWSS3Bucket_Security_ACLToGrant (131.14s)
--- PASS: TestAccAWSS3Bucket_Security_corsDelete (37.30s)
--- PASS: TestAccAWSS3Bucket_Security_corsEmptyOrigin (55.32s)
--- PASS: TestAccAWSS3Bucket_Security_corsUpdate (177.60s)
--- PASS: TestAccAWSS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled (174.39s)
--- PASS: TestAccAWSS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed (107.63s)
--- PASS: TestAccAWSS3Bucket_Security_enableDefaultEncryptionWhenTypical (107.23s)
--- PASS: TestAccAWSS3Bucket_Security_GrantToACL (151.27s)
--- PASS: TestAccAWSS3Bucket_Security_logging (66.27s)
--- PASS: TestAccAWSS3Bucket_Security_policy (237.23s)
--- PASS: TestAccAWSS3Bucket_Security_updateACL (151.13s)
--- PASS: TestAccAWSS3Bucket_Security_updateGrant (239.74s)
--- PASS: TestAccAWSS3Bucket_Tags_basic (91.77s)
--- PASS: TestAccAWSS3Bucket_Tags_ignoreTags (47.68s)
--- PASS: TestAccAWSS3Bucket_Tags_withNoSystemTags (187.23s)
--- PASS: TestAccAWSS3Bucket_Tags_withSystemTags (297.32s)
--- PASS: TestAccAWSS3Bucket_Web_redirect (239.80s)
--- PASS: TestAccAWSS3Bucket_Web_routingRules (177.38s)
--- PASS: TestAccAWSS3Bucket_Web_simple (239.61s)
--- SKIP: TestAccAWSS3Bucket_Basic_acceleration (1.31s)
--- SKIP: TestAccAWSS3Bucket_Replication_multipleDestinationsEmptyFilter (43.23s)
--- SKIP: TestAccAWSS3Bucket_Replication_multipleDestinationsNonEmptyFilter (42.33s)
This functionality has been released in v3.50.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. |
Noted by issue 16250
This adds in the option to Enable or Disable delete marker replication when working with v2 s3 replication config.
This change makes the
delete_marker_replication
block required when using v2 replication configuration. I could not find a better approach without requiring the object.Note that the v1 replication config does not support the ability to toggle delete marker replication, it is always on by default.
Example usage:
Updated (July 12, 2021): Config above has changed to reflect new argument implementation.
Community Note
Relates OR Closes #16250
Output from acceptance testing: