Open dmytroleonenko opened 5 years ago
Work around: Using a for_each to create a new policy per tag. Not pretty, but gets the job done. Not great for the Name
tag, but if you have a standard backup tag, it works fine. I use it to hit UPPER, lower, and Camelcase tags.
resource "aws_dlm_lifecycle_policy" "example" {
for_each = toset(var.target_tags)
description = "example DLM lifecycle policy - ${each.key}"
execution_role_arn = aws_iam_role.dlm_lifecycle_role.arn
state = "ENABLED"
policy_details {
resource_types = ["VOLUME"]
schedule {
name = "2 weeks of daily snapshots"
create_rule {
interval = 24
interval_unit = "HOURS"
times = ["23:45"]
}
retain_rule {
count = 14
}
tags_to_add = {
SnapshotCreator = "DLM"
}
copy_tags = false
}
target_tags = {
Backup = each.key
}
}
}
variable "target_tags" {
default = ["TRUE", "true", "True"]
}
This workaround only works for smaller use cases due to the limitation of 100 DLM policies per region. Is there any chance of this issue being fixed?
I also face the same issue. Any help would be great!!
any news? blocked by the same issue.
Would be great to implement this functionality. Thanks
+1 getting the same issue
I am also encountering this issue - would it be possible to use a configuration block instead, like tag
for aws_autoscaling_group
?
same problem here
Problem remains, no solution found except the workaround of @claydanford
Old issue, needs resolving soon
same problem here
Same problem here
Not the latest version but according to the code it hasn't changed
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Terraform creates a policy with multiple tags that might legally contain the same key. https://docs.aws.amazon.com/dlm/latest/APIReference/API_PolicyDetails.html
Actual Behavior
schema.TypeMap is a dict with a unique tag Key. Multiple tags with the same key results in using only the last value of the repeated tag key.
Steps to Reproduce
terraform apply
References
https://github.com/terraform-providers/terraform-provider-aws/blob/v2.1.0/aws/resource_aws_dlm_lifecycle_policy.go#L126