Skip to content

Commit

Permalink
fix: distribution unique alias resource ID
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsdaniels committed Sep 12, 2024
1 parent 0c60119 commit d9802e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/grumpy-hairs-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@codedazur/cdk-site-distribution": patch
---

Alias records now have unique resource IDs.
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,7 @@ export class SiteDistribution extends Construct {
[subdomain, name].filter(Boolean).join("."),
);

for (const domain in domains) {
new CfnOutput(this, "URL", { value: "https://" + domain });
}
new CfnOutput(this, "URL", { value: "https://" + domains[0] });

return domains;
}
Expand Down Expand Up @@ -524,7 +522,7 @@ export class SiteDistribution extends Construct {

return domains.map(
(domain) =>
new ARecord(this, "DomainAlias", {
new ARecord(this, `DomainAlias-${domain}`, {
recordName: domain,
target: RecordTarget.fromAlias(
new CloudFrontTarget(this.distribution),
Expand Down

0 comments on commit d9802e4

Please sign in to comment.