fix: skip log bucket replication when archive bucket not configured#257
Open
matthewhanson wants to merge 4 commits intoElement84:mainfrom
Open
fix: skip log bucket replication when archive bucket not configured#257matthewhanson wants to merge 4 commits intoElement84:mainfrom
matthewhanson wants to merge 4 commits intoElement84:mainfrom
Conversation
When deploy_log_archive = false, filmdrop_archive_bucket_name is passed as an empty string. The replication configuration would then build an invalid ARN (arn:aws:s3:::) causing plan failures. Guard the replication resource so it is only created when both create_log_bucket is true AND a non-empty archive bucket is provided. Applies to both s3_origin and custom_origin CloudFront modules. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…rovisioners Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Guards the
aws_s3_bucket_replication_configurationresource in bothCloudFront logging modules so it is only created when an archive bucket
is actually provided.
Changes
modules/cloudfront/s3_origin/logging.tf: add&& var.filmdrop_archive_bucket_name != ""to replication resourcecountmodules/cloudfront/custom_origin/logging.tf: same fixBefore
After
Testing
terragrunt plan now succeeds with deploy_log_archive = false. The log bucket is still created; replication is skipped when no
archive destination is configured.
Fixes #256