Skip to content
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

IAM Policy for S3 replication doesn't include new destination bucket name #215

Open
rstml opened this issue Feb 22, 2024 · 0 comments
Open
Labels
bug 🐛 An issue with the system

Comments

@rstml
Copy link

rstml commented Feb 22, 2024

Describe the Bug

Destination bucket was moved from destination_bucket to destination.bucket as described here:

# destination_bucket is specified here rather than inside the destination object because before optional
# attributes, it made it easier to work with the Terraform type system and create a list of consistent type.
# It is preserved for backward compatibility, but the nested version takes priority if both are provided.
destination_bucket = optional(string) # destination bucket ARN, overrides s3_replica_bucket_arn
destination = object({
bucket = optional(string) # destination bucket ARN, overrides s3_replica_bucket_arn

However, the IAM policy for replication doesn't account for this new bucket name:

resources = toset(concat(
try(length(var.s3_replica_bucket_arn), 0) > 0 ? ["${var.s3_replica_bucket_arn}/*"] : [],
[for rule in local.s3_replication_rules : "${rule.destination_bucket}/*" if try(length(rule.destination_bucket), 0) > 0],
))

Expected Behavior

concat should also include destination.bucket

Steps to Reproduce

N/A

Screenshots

No response

Environment

No response

Additional Context

No response

@rstml rstml added the bug 🐛 An issue with the system label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

1 participant