-
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
resource/aws_cloudwatch_log_metric_filter: Add support for DefaultValue #1578
Conversation
aws/structure.go
Outdated
f, err := strconv.ParseFloat(bound, 64) | ||
if err != nil { | ||
return nil, fmt.Errorf( | ||
"default_value must be a float value represented as a string") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would be worth to make a validation function for that?
We could get the info early at plan time. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ninir I changed to use the built in schema.TypeFloat to avoid the need for parsing
642fdbd
to
4b5ec93
Compare
Hi @Ninir I believe this is ready to go now, I removed the need for the Parsing of the Double and made the schema use schema.TypeDouble instead Paul |
Hi Paul, Just checked and it looks very good. However, when updating the default value from the AWS console, the terraform plan does not see the change. Would you have time to investigate? Thanks! 👍 |
@Ninir I don't have access to an AWS console to test this I am afraid Can we follow up with this change in a different PR? |
Hey @stack72 This will lead to expected issues from users, so I would prefer to get the case fixed at the time! 😅 |
Hi @endemics Just started the review! i'm fixing the update from console issue in a first time :) |
Thanks @Ninir, much appreciated! |
Fixes: hashicorp#1563 ``` % make testacc TEST=./aws TESTARGS='-run=TestAccAWSCloudWatchLogMetricFilter_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -run=TestAccAWSCloudWatchLogMetricFilter_ -timeout 120m === RUN TestAccAWSCloudWatchLogMetricFilter_basic --- PASS: TestAccAWSCloudWatchLogMetricFilter_basic (59.02s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 59.047s ```
…ng a string rather than a float
4b5ec93
to
f955381
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @stack72
This is all ok now! :)
I allowed myself to fix conflicts & the read issue, and everything is all fine now:
$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSCloudWatchLogMetricFilter_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSCloudWatchLogMetricFilter_basic -timeout 120m
=== RUN TestAccAWSCloudWatchLogMetricFilter_basic
--- PASS: TestAccAWSCloudWatchLogMetricFilter_basic (341.07s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 341.100s
Thanks for the work! 👍
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! |
Fixes: #1563
Fixes: #1442