cdk-examples icon indicating copy to clipboard operation
cdk-examples copied to clipboard

ARecord needs recordName

Open wardtc opened this issue 3 years ago • 1 comments
trafficstars

in http-api-stack.ts the record name is missing from ARecord construct

new ARecord(this, 'apiAliasRecord', {
      zone: hostedZone,
      target: RecordTarget.fromAlias(new ApiGatewayv2DomainProperties(domain.regionalDomainName, domain.regionalHostedZoneId))
})

should be

new ARecord(this, 'apiAliasRecord', {
      zone: hostedZone,
      recordName: api_domain,
      target: RecordTarget.fromAlias(new ApiGatewayv2DomainProperties(domain.regionalDomainName, domain.regionalHostedZoneId))
})

wardtc avatar Oct 27 '22 06:10 wardtc

I haven't been maintaining it for while and as I see in documentation recordName is optional and you can get api domain from zone itself. No need to repeat it twice.

const hostedZone = HostedZone.fromHostedZoneAttributes(this, 'hostedZoneWithAttr', {
      hostedZoneId: hostedZoneId,
      zoneName: api_domain
    })

apoorvmote avatar Oct 29 '22 05:10 apoorvmote