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

Fixes #2384 aws_cloudwatch_log_metric_filter: default_value is automatically set to 0 #5933

Merged
merged 4 commits into from
Nov 13, 2018

Conversation

ahl
Copy link
Contributor

@ahl ahl commented Sep 19, 2018

Fixes #2384

Note I looked at #2759 and #2902 which were both old and incomplete
cc: @jocelynthode @modax

Changes proposed in this pull request:

  • use sentinel value of NaN to indicate that no value was specified
  • clean up misspelling and cruft

Output from acceptance testing:

$ 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 (18.69s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	18.743s

@ghost ghost added size/S Managed by automation to categorize the size of a PR. service/cloudwatchlogs tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Sep 19, 2018
@ahl
Copy link
Contributor Author

ahl commented Sep 19, 2018

I should also have noted that a better solution is blocked on this issue: https://github.com/hashicorp/terraform/issues/16796

@ahl
Copy link
Contributor Author

ahl commented Sep 28, 2018

@radeksimko take a look?

@ahl
Copy link
Contributor Author

ahl commented Oct 1, 2018

maybe @bflad you could take a look?

@paultyng
Copy link
Contributor

paultyng commented Oct 19, 2018

I think we should implement this instead as a TypeString so that empty string can represent the unset value. We have precedent for this with TypeBool's https://github.com/terraform-providers/terraform-provider-aws/blob/502d7b4cfa74d5a0715e6ba32f60d4ad58e2cbd7/aws/resource_aws_launch_template.go#L92-L95

It's definitely an annoying limitation of the current type system, and potentially something we can address post 0.12, but the backwards compatible implementation will probably just use a TypeString as well.

While talking with @bflad about this, our consensus is that if we have to do a hack to support it, we should at least be consistent in our hacks.

@paultyng paultyng added the waiting-response Maintainers are waiting on response from community or contributor. label Oct 19, 2018
@ahl
Copy link
Contributor Author

ahl commented Oct 19, 2018

Makes sense; I'll update the PR

@jocelynthode
Copy link

I think you could have pushed to my branch so that we would have consolidated on a single PR. Anyway, I'll close mine as it is not needed anymore.

@ahl
Copy link
Contributor Author

ahl commented Oct 19, 2018

@jocelynthode I didn't know that was possible; thanks.

@ahl
Copy link
Contributor Author

ahl commented Oct 27, 2018

@paultyng much better approach; thanks.

Looks like resource_aws_spot_fleet_request.go is doing the same thing more or less.

@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label Oct 28, 2018
@ghost ghost added size/M Managed by automation to categorize the size of a PR. and removed size/S Managed by automation to categorize the size of a PR. labels Nov 11, 2018
@ahl
Copy link
Contributor Author

ahl commented Nov 11, 2018

@paultyng added the unit test and fixed the bug that you found

@bflad bflad added the bug Addresses a defect in current functionality. label Nov 13, 2018
@bflad bflad self-requested a review November 13, 2018 23:44
@bflad bflad added this to the v1.44.0 milestone Nov 13, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks so much for this fix and patience @ahl! 🚀

--- PASS: TestAccAWSCloudWatchLogMetricFilter_basic (6.56s)

@bflad bflad merged commit 864c46a into hashicorp:master Nov 13, 2018
bflad added a commit that referenced this pull request Nov 14, 2018
@paultyng
Copy link
Contributor

@ahl thanks for following up on this one!

@ahl
Copy link
Contributor Author

ahl commented Nov 14, 2018

@paultyng it's pretty critical to us so I was motivated; thanks for sticking with me on it.

@bflad
Copy link
Contributor

bflad commented Nov 15, 2018

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.

@ghost
Copy link

ghost commented Apr 2, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 2, 2020
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. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_cloudwatch_log_metric_filter: default_value is automatically set to 0
4 participants