Skip to content

Commit 3fbc8a8

Browse files
authored
feat(static-website): HTTPS alias record for CloudFront distribution (#307)
1 parent 7d96724 commit 3fbc8a8

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

src/static-website/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ export class StaticWebsite extends Construct {
155155
target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(this.distribution)),
156156
});
157157

158+
new route53.RecordSet(this, 'HttpsRecord', {
159+
recordType: 'HTTPS' as route53.RecordType,
160+
recordName: props.domainName,
161+
zone: props.hostedZone,
162+
target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(this.distribution)),
163+
});
164+
158165
if (props.backendConfiguration) {
159166
// Save backend config to bucket, can be queried by the frontend
160167
new cr.AwsCustomResource(this, 'PutConfig', {

test/static-website/__snapshots__/static-website.test.ts.snap

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)