Cfn-python-lint: Add Rules for Route53 records

Created on 30 May 2018  路  1Comment  路  Source: aws-cloudformation/cfn-python-lint

There are a bunch of rules on recordsets, for instance the TXT records:

https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#TXTFormat
https://tools.ietf.org/html/rfc1464

These are not checked "yet". Example we hit a couple of days ago was the fact that the TXT records have to be in quotes (So in YAML this ends up as quoted string in quotes.)

Example:

        - Name: !Sub "_amazonses.example.com."
          Type: "TXT"
          TTL: 900
          ResourceRecords:
            - "generatedrandomstring"

Breaks the CloudFormation deployment with the following error:

Invalid Resource Record: FATAL problem: InvalidCharacterString (Value should be enclosed in quotation marks) encountered with 'generatedrandomstring'
````

Should have been:

    - Name: !Sub "_amazonses.example.com."
      Type: "TXT"
      TTL: 900
      ResourceRecords:
        - "\"generatedrandomstring\""

```

Documentation: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html
Record Types:

  • [x] A Record Type
  • [x] AAAA Record Type
  • [x] CAA Record Type
  • [x] CNAME Record Type
  • [x] MX Record Type
  • [ ] NAPTR Record Type
  • [x] NS Record Type
  • [x] PTR Record Type
  • [ ] SOA Record Type
  • [ ] SPF Record Type
  • [ ] SRV Record Type
  • [x] TXT Record Type

There are more rules like this (See documentation: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html) that could/should be implemented.

More documenation urls:

enhancement new rule

Most helpful comment

Another check could be to verify that the HostedZoneName ends with a dot. Otherwise, CFN fails.

>All comments

Another check could be to verify that the HostedZoneName ends with a dot. Otherwise, CFN fails.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adamchainz picture adamchainz  路  4Comments

matthelgen picture matthelgen  路  4Comments

ow-krioles picture ow-krioles  路  5Comments

ashemedai picture ashemedai  路  4Comments

mikecee picture mikecee  路  4Comments