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

route53.CaaAmazonRecord ignores recordName prop #5764

Closed
touzoku opened this issue Jan 12, 2020 · 3 comments · Fixed by #6027
Closed

route53.CaaAmazonRecord ignores recordName prop #5764

touzoku opened this issue Jan 12, 2020 · 3 comments · Fixed by #6027
Assignees
Labels
@aws-cdk/aws-route53 Related to Amazon Route 53 bug This issue is a bug. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md in-progress This issue is being actively worked on. p1

Comments

@touzoku
Copy link

touzoku commented Jan 12, 2020

route53.CaaAmazonRecord construct accepts a recordName prop per documentation, however, in the code it gets the value of props.zone.zoneName instead of props.recordName ?? props.zone.zoneName.

Therefore, regardless of what value is specified under recordName it would always create it for the root.

Reproduction Steps

const hostedZone = route53.HostedZone.fromLookup(this, 'exampleHostedZone', {
      domainName: 'example.com'
 })

new route53.CaaAmazonRecord(this, 'exampleCAARecord', {
      zone: hostedZone,
      recordName: 'subdomain.example.com',
})

The code above should create a CAA record for subdomain.example.com but creates for example.com instead.

Error Log

None.

Environment

  • CLI Version : 1.20.0 (build 021c521)
  • Framework Version: 1.20.0
  • OS : macOS Catalina 10.15.2
  • Language : English

Other


This is 🐛 Bug Report

@touzoku touzoku added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 12, 2020
@SomayaB SomayaB added the @aws-cdk/aws-route53 Related to Amazon Route 53 label Jan 13, 2020
@shivlaks shivlaks added p1 good first issue Related to contributions. See CONTRIBUTING.md and removed needs-triage This issue or PR still needs to be triaged. labels Jan 15, 2020
@shivlaks shivlaks added the effort/small Small work item – less than a day of effort label Jan 29, 2020
@jogold
Copy link
Contributor

jogold commented Jan 29, 2020

Correct, it doesn't work as expected. Are you sure this is perfectly valid/supported to have CAA records on subdomains?

@touzoku
Copy link
Author

touzoku commented Jan 30, 2020

@jogold Yes. In RFC 6844 it has a following example:

A CAA record with an issue parameter tag that specifies a domain name
is a request that certificate issuers perform CAA issue restriction
processing for the corresponding domain and grants authorization to
the certificate issuer specified by the domain name.

For example, the following CAA record set requests that no
certificates be issued for the domain 'certs.example.com' by any
certificate issuer other than the example.net certificate issuer.

certs.example.com CAA 0 issue "example.net"

@touzoku
Copy link
Author

touzoku commented Jan 30, 2020

By the way, a workaround for this issue is as follows:

const hostedZone = route53.HostedZone.fromLookup(this, 'exampleHostedZone', {
      domainName: 'example.com'
 })

new route53.CaaRecord(this, 'WebsiteCAARecord', {
  zone: hostedZone,
  recordName: 'subdomain.example.com',
  values: [
    { flag: 0, tag: route53.CaaTag.ISSUE, value: 'amazon.com' }
  ]
})

jogold added a commit to jogold/aws-cdk that referenced this issue Jan 30, 2020
@SomayaB SomayaB added the in-progress This issue is being actively worked on. label Jan 30, 2020
@mergify mergify bot closed this as completed in #6027 Feb 3, 2020
mergify bot added a commit that referenced this issue Feb 3, 2020
Fixes #5764

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-route53 Related to Amazon Route 53 bug This issue is a bug. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md in-progress This issue is being actively worked on. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants