Perpetual diff on treat_missing_data for imported aws_cloudwatch_metric_alarm #8854
Labels
bug
Addresses a defect in current functionality.
service/cloudwatch
Issues and PRs that pertain to the cloudwatch service.
Milestone
Community Note
Summary
I believe this is due to a quirk of the CloudWatch API.
I imported a CloudWatch alarm created with CloudFormation into Terraform (but reproducible with manually-created alarm as well). When running
terraform plan
there is always a diff ontreat_missing_data
attribute:It's always there regardless of what it's set to in the configuration. In the state file it's set to empty string. Even if I edit the state file to set it to "missing" (the default value and matching what's in the web console), when
terraform refresh
is run it's reverted back to the empty string.And here is the CloudWatch API quirk: if I call
aws cloudwatch describe-alarms
for the region,TreatMissingData
attribute for all the alarms is missing in the response, which would explain reverting to the empty string. If I manually change it in the web console, the attribute will start showing up in the response and the diff disappears, even if I change it back to "missing".Terraform Version
Affected Resource(s)
aws_cloudwatch_metric_alarm
Expected Behavior
No diff.
Actual Behavior
There is always a diff until "Treat Missing Data" attribute is edited manually.
Steps to Reproduce
terraform plan
The text was updated successfully, but these errors were encountered: