Skip to content

Commit 40a6f18

Browse files
authored
Merge pull request #188 from DataDog/fix/shared-cdk
fix: resolve issues with DNS parsing
2 parents c682eb5 + c34d283 commit 40a6f18

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

shared/infra/aws/lib/dns.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,20 @@ export class Dns extends Construct {
3434
"ImportedCertificate",
3535
certificateArn,
3636
);
37+
3738
} else {
3839
this.certificate = undefined;
3940
this.hostedZone = undefined;
4041
}
4142
}
4243

43-
addCnameFor(distribution: Distribution) {
44+
addCnameFor(distribution: Distribution, env: string) {
4445
// Add a CName if the hosted zone exists.
4546
if (this.hostedZone) {
4647
const cNameRecord = new CnameRecord(this, "CnameRecord", {
4748
zone: this.hostedZone!,
4849
domainName: distribution.domainName,
49-
recordName: this.getPrimaryDomainName("prod")!,
50+
recordName: this.getPrimaryDomainName(env)!,
5051
ttl: Duration.minutes(5),
5152
});
5253
}

shared/infra/aws/lib/network.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class Network extends Construct {
161161
comment: `OAI for stickerlandia web frontend ${props.env}`,
162162
});
163163
webFrontendBucket.grantRead(originIdentity);
164-
164+
165165
this.distribution = new Distribution(this, `Stickerlandia-${props.env}`, {
166166
certificate: props.dns.certificate,
167167
domainNames: props.dns.getPrimaryDomainName(props.env)

shared/infra/aws/lib/shared-resources-stack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class StickerlandiaSharedResourcesStack extends cdk.Stack {
3131
dns: dns,
3232
});
3333

34-
dns.addCnameFor(network.distribution);
34+
dns.addCnameFor(network.distribution, env);
3535

3636
const persistence = new Persistence(this, "Persistence", {
3737
env,

0 commit comments

Comments
 (0)