Created
May 13, 2022 12:42
-
-
Save hakanilter/c7f5576ddf2a7e00ba8eb3af1f602f30 to your computer and use it in GitHub Desktop.
Terraform dynamic replication config for an S3 bucket
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
dynamic "replication_configuration" { | |
for_each = var.replicate_data_bucket ? [1] : [] | |
content { | |
role = aws_iam_role.data_backup_replication_role.arn | |
rules { | |
id = "raw-data-replication" | |
prefix = "data/raw/" | |
status = "Enabled" | |
destination { | |
bucket = aws_s3_bucket.backup_bucket.arn | |
storage_class = "STANDARD_IA" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment