Route 53 record ID parse fails when set ID contains underscores #13457
Labels
bug
Addresses a defect in current functionality.
service/route53
Issues and PRs that pertain to the route53 service.
Community Note
Terraform Version
TF version 0.12.25
AWS provider version 2.62.0
Affected Resource(s)
aws_route53_record
Failing Test
To see the failure, edit this section of the test:
https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_route53_record_test.go#L84-L88
to verify parsing of this string, too:
and you'll see this in the error output:
Expected Behavior
Not sure about what the desired behavior should be here, which is why I didn't open a PR. The culprit is this line, where it finds the last underscore in the rest of the string:
https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_route53_record.go#L949
Of course, then, this gives the wrong result when the set ID contains an underscores. But, that means that underscores can come before or after the resource type (
A
,CNAME
, etc) and thus parsing the string correctly becomes a significantly harder problem -- wasn't sure how you guys wanted to approach this.Impact
For us, this caused the inability to import Route 53
CNAME
records whose set ID contained underscores, giving the error:(with
foo
being the second-to-last underscored portion of the set ID, instead of the actual record type, which wasCNAME
)The text was updated successfully, but these errors were encountered: