cdk-examples
cdk-examples copied to clipboard
ARecord needs recordName
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))
})
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
})