Open fstr opened 2 years ago
The trouble here partially comes from the fact that the AWS provider accepts this but then proceeds to chop it off everywhere, e.g.:
You can find lots of examples of this happening in other projects:
https://github.com/search?q=zone_id+%3D+%22%2Fhostedzone%2F+TrimPrefix&type=code
And the shape of a ResourceId
:
https://github.com/aws/aws-sdk-go/blob/main/models/apis/route53/2013-04-01/api-2.json#LL4069
The provider also asserts that zone_id
is <32 characters:
Particularly given that this report is missing the output, I'm not understanding what the discrepancy is and how the rule logic would change, even setting aside the fact that it's generated.
Didn't intend to close, looking for a clear reproduction before spending any more time here
This is a problem for me to. Feels silly.
The rule
aws_route53_record_invalid_zone_id
has a char limit of 32 chars on thezone_id
property. A longerzone_id
raises an error when linting.According to the AWS docs, this is correct. See
Id
section of linked documentation.In my use case I generate Terraform files with kOps, and the generated
zone_id
s are in the format/hostedzone/XXXXXXXXXXXXXXXXXXXXX
. The generatedzone_id
format is accepted by the Terraform AWS provideraws_route53_record
resource.Example:
I was not able to find the source code for the
aws_route53_record
, because I don't know the provider codebase that well. Maybe it's auto generated. As a proof besides my own codebase, I found a test case in the provider repository which also uses the prefix.The ruleset should be adjusted to support the
/hostedzone/
prefix on theaws_route53_record.zone_id
property.