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

Perpetual diff on treat_missing_data for imported aws_cloudwatch_metric_alarm #8854

Closed
a13xb opened this issue Jun 4, 2019 · 4 comments · Fixed by #21363
Closed

Perpetual diff on treat_missing_data for imported aws_cloudwatch_metric_alarm #8854

a13xb opened this issue Jun 4, 2019 · 4 comments · Fixed by #21363
Labels
bug Addresses a defect in current functionality. service/cloudwatch Issues and PRs that pertain to the cloudwatch service.
Milestone

Comments

@a13xb
Copy link

a13xb commented Jun 4, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

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 on treat_missing_data attribute:

      + treat_missing_data        = "missing"

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

Terraform v0.12.0
+ provider.aws v1.60.0-dev20190216h00-dev

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

  1. Create a CloudWatch alarm outside of Terraform.
  2. Import it into Terraform.
  3. Run terraform plan
@aeschright aeschright added the needs-triage Waiting for first response or review from a maintainer. label Jun 19, 2019
@aeschright aeschright added the service/cloudwatch Issues and PRs that pertain to the cloudwatch service. label Jul 2, 2019
@a13xb
Copy link
Author

a13xb commented Jul 9, 2019

Same with 2.18.0, and also happens to the DatapointsToAlarm attribute.

@nullscan
Copy link

nullscan commented Jan 9, 2020

It also happens with Terraform v0.12.18 and aws provider v2.43.0

@breathingdust breathingdust added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 17, 2021
@github-actions github-actions bot added this to the v3.64.0 milestone Oct 19, 2021
@github-actions
Copy link

github-actions bot commented Nov 4, 2021

This functionality has been released in v3.64.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/cloudwatch Issues and PRs that pertain to the cloudwatch service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants