fix(aws-s3): update issue with vars - #1300
Open
kastras wants to merge 8 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the modules/aws-s3 Terraform module documentation/examples and attempts to adjust validation around replication-related variables.
Changes:
- Removes the
s3_replication_destinationvariable validation that required bucket versioning to be"Enabled". - Adds a
locals-based “validation” expression for replication/versioning, and updates lifecycle rule locals formatting. - Updates module usage snippets (git source + tag) and placeholder AWS account IDs in docs and examples.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
modules/aws-s3/variables.tf |
Removes cross-variable validation for replication + versioning. |
modules/aws-s3/local.tf |
Adds a locals-based replication/versioning “validation” expression. |
modules/aws-s3/README.md |
Updates module source usage to git:: URL + tag; adjusts example account IDs / provider docs output. |
modules/aws-s3/docs/header.md |
Updates module source usage to git:: URL + tag; adjusts example account IDs. |
modules/aws-s3/_examples/minimal_source/main.tf |
Updates example destination account ID to 12 digits. |
modules/aws-s3/_examples/minimal_replication/main.tf |
Updates example destination account ID to 12 digits. |
modules/aws-s3/_examples/minimal_destination_source_and_destination/main.tf |
Updates example destination account ID to 12 digits (source account remains inconsistent). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
183
to
185
| }) | ||
| default = null | ||
|
|
||
| validation { | ||
| condition = var.s3_replication_destination == null || var.s3_bucket_versioning == "Enabled" | ||
| error_message = "When configuring s3_replication_destination, s3_bucket_versioning must be set to \"Enabled\"." | ||
| } | ||
| } |
Comment on lines
+2
to
+6
| # Validate that if s3_replication_destination is configured, versioning must be enabled | ||
| validate_replication_versioning = ( | ||
| var.s3_replication_destination == null || var.s3_bucket_versioning == "Enabled" | ||
| ) ? true : file("ERROR: When configuring s3_replication_destination, s3_bucket_versioning must be set to \"Enabled\".") | ||
|
|
Comment on lines
23
to
26
| s3_replication_source = { | ||
| account = "1122334455" | ||
| role_arn = "arn:aws:iam::1122334455:role/o-a-d-replication" | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| | Name | Version | | ||
| |------|---------| | ||
| | <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 6.2 | | ||
| | <a name="provider_aws"></a> [aws](#provider\_aws) | 6.30.0 | |
Comment on lines
24
to
+28
| account = "1122334455" | ||
| role_arn = "arn:aws:iam::1122334455:role/o-a-d-replication" | ||
| } | ||
| s3_replication_destination = { | ||
| account = "1122334455" | ||
| account = "112233445566" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.