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

resource/aws_route53_health_check: Validate reference_name #12873

Merged
merged 1 commit into from
Apr 29, 2020
Merged

resource/aws_route53_health_check: Validate reference_name #12873

merged 1 commit into from
Apr 29, 2020

Conversation

timoguin
Copy link
Contributor

@timoguin timoguin commented Apr 17, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Support plan-time validation for the length of the reference_name argument. Since this resource auto-appends a unique string to the provided argument, this is necessary to avoid obtuse errors on apply. This ensures the provided reference_name plus the generated string is no longer than 64 chars, the actual API limit.

Since the generated unique ID is 26 chars, the reference_name argument cannot exceed 38 characters.

Closes #7248

Release note for CHANGELOG:

resource/aws_route53_health_check: Support plan-time validation for `reference_name` argument

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

Output from Terraform run with patched build:

Error: expected length of reference_name to be in the range (0 - 38), got test-long-reference-name-1111111111111111111111111

  on example.tf line 880, in resource "aws_route53_health_check" "example":
 880: resource "aws_route53_health_check" "example" {

@timoguin timoguin requested a review from a team April 17, 2020 10:21
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/route53 Issues and PRs that pertain to the route53 service. labels Apr 17, 2020
aws/resource_aws_route53_health_check.go Outdated Show resolved Hide resolved
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. waiting-response Maintainers are waiting on response from community or contributor. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 17, 2020
@timoguin timoguin requested a review from bflad April 17, 2020 22:14
@timoguin
Copy link
Contributor Author

Hey @bflad, is there anything I need for this PR?

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Apr 23, 2020
@timoguin timoguin requested a review from bflad April 26, 2020 00:53
@timoguin
Copy link
Contributor Author

Ooof! Okay, it should be good now. Thanks!

Support plan-time validation for the length of the reference_name
argument. Since this resource auto-appends a unique string to the
provided argument, this is necessary to avoid obtuse errors on apply.
This validates the provided reference_name plus the generated string is
no longer than 64 chars, the actual API limit.

Since the generated unique ID is 37 chars, the `reference_name` argument
cannot exceed 27 characters.

Closes #7248

Co-Authored-By: Brian Flad <bflad417@gmail.com>
@bflad bflad added this to the v2.60.0 milestone Apr 29, 2020
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.

Looks great, thanks @timoguin 🚀

Output from acceptance testing:

--- PASS: TestAccAWSRoute53HealthCheck_disappears (9.61s)
--- PASS: TestAccAWSRoute53HealthCheck_withHealthCheckRegions (19.50s)
--- PASS: TestAccAWSRoute53HealthCheck_withChildHealthChecks (22.39s)
--- PASS: TestAccAWSRoute53HealthCheck_withSearchString (25.97s)
--- PASS: TestAccAWSRoute53HealthCheck_IpConfig (26.48s)
--- PASS: TestAccAWSRoute53HealthCheck_Ipv6Config (27.27s)
--- PASS: TestAccAWSRoute53HealthCheck_basic (29.14s)
--- PASS: TestAccAWSRoute53HealthCheck_CloudWatchAlarmCheck (29.42s)
--- PASS: TestAccAWSRoute53HealthCheck_tags (36.04s)
--- PASS: TestAccAWSRoute53HealthCheck_withSNI (37.91s)

@bflad bflad merged commit 17d4b94 into hashicorp:master Apr 29, 2020
bflad added a commit that referenced this pull request Apr 29, 2020
@ghost
Copy link

ghost commented May 1, 2020

This has been released in version 2.60.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 for triage. Thanks!

adamdecaf pushed a commit to adamdecaf/terraform-provider-aws that referenced this pull request May 28, 2020
Support plan-time validation for the length of the reference_name
argument. Since this resource auto-appends a unique string to the
provided argument, this is necessary to avoid obtuse errors on apply.
This validates the provided reference_name plus the generated string is
no longer than 64 chars, the actual API limit.

Since the generated unique ID is 37 chars, the `reference_name` argument
cannot exceed 27 characters.

Closes hashicorp#7248

Co-Authored-By: Brian Flad <bflad417@gmail.com>

Co-authored-by: Brian Flad <bflad417@gmail.com>
@ghost
Copy link

ghost commented May 29, 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 May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/route53 Issues and PRs that pertain to the route53 service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provider is appending a time stamp onto an aws_route_53_health_check reference_name causing an error on apply.
2 participants