awslabs / cloudfront-hosting-toolkit

CloudFront Hosting Toolkit offers the convenience of a managed frontend hosting service while retaining full control over the hosting and deployment infrastructure to make it your own.
Apache License 2.0
95 stars 4 forks source link

Bug: Route53 A record not usiong the correct target domain #4

Closed niklas-palm closed 4 months ago

niklas-palm commented 4 months ago

Expected Behaviour

A Route53 A record with alias target, targeting the Cloudfront domain.

Current Behaviour

A Route53 A record with alias target, targeting a substring of Cloudfront domain.

Code snippet

N/A

Possible Solution

When the alias record is created, the a record target should be the cloudfront domain name. However, there's a bug where the first 8 characters of the domain name are omitted:

const cFCNAMEExists = await checkCFCNAMEExists(
  hostingConfiguration.domainName,
  domainName.substring(8),
  hostingConfiguration.hostedZoneId
);

This is the location in the code. Will submit PR.

Steps to Reproduce

N/A

cornelcroi commented 4 months ago

PR merged with the fix.