Skip to content

Instantly share code, notes, and snippets.

@hakanilter
Created May 13, 2022 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hakanilter/c7f5576ddf2a7e00ba8eb3af1f602f30 to your computer and use it in GitHub Desktop.
Save hakanilter/c7f5576ddf2a7e00ba8eb3af1f602f30 to your computer and use it in GitHub Desktop.
Terraform dynamic replication config for an S3 bucket
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