-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
aws_cloudwatch_log_metric_filter: default_value is automatically set to 0 #2384
Comments
Hi @iamam34 I think I've found the issue (which should be easy to resolve by the way): this attribute is of type Float, which seem to imply that the value is always provided as 0 when not set... as the check deciding whether the value should be set in the API call is a check against If someone wants to take over this, just go :) otherwise will fix it later :) |
Great to hear it's straightforward to fix! Up to you whether a empty string is considered valid or invalid terraform syntax (but since it's not a float, we still don't want to send it). |
Hey I'm trying to work on this issue. As it is my first time working on Terraform and I'm really new to Go, I'll probably need guidance. I'll open a WIP PR shortly. |
Any news? This has unknowingly rendered our 'ResponseTime' metrics useless (since they are cluttered with zeros) |
I asked for help on my PR as I'm rather new to this however nobody answered. |
@jocelynthode while you're waiting for review, would you mind checking whether the opposite case of going from unset to set is handled by your PR? Might require fiddling with different TF / aws provider versions. I have several aws_cloudwatch_log_metric_filter resources that were created with TF < .11.1. None of them specified a default_value (since it didn't exist), and they're empty when viewed in the AWS console, as expected. Under .11.2 / aws 1.6 when I try to explicitly set to default_value = "0", TF doesn't see it as a change. Setting default_value = "1" does register as a change. |
I also have this issue. It seems that if I manually edit the Log Metric Filter via AWS Console and delete the zero, the Default Value field changes to "none". This fixes the issue as long as no changes are made to the resource via terraform (aws provider 1.6). |
Just got hit by this when creating alarm on |
Have encountered this one as well. Would be good to know if a fix is on the way. The "-1" seems to be a good solution. |
Also having problems with this. |
…is automatically set to 0
Fixes #2384 aws_cloudwatch_log_metric_filter: default_value is automatically set to 0
The fix for this should be merged and will release with version 1.44.0 of the AWS provider, likely tomorrow. Apologies for the long delays here. |
This has been released in version 1.44.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
When I apply a terraform configuration that does NOT include default_value, terraform creates a log filter in AWS that has the default_value set to 0.
Terraform Version
Terraform v0.10.3 with aws provider v1.3.1
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Creates a log filter with default_value not set, so that log lines that don't match the filter don't output any value for the metric. http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/MonitoringLogData.html
Actual Behavior
Creates a log filter with default_value set to 0, so that every log line outputs a value for the metric (non-matching lines output 0).
Steps to Reproduce
terraform apply
(note that the console output does not mention default_value at all)References
The text was updated successfully, but these errors were encountered: