Skip to content

Commit 41169da

Browse files
committed
reinstate certificate arn
1 parent d48aafb commit 41169da

File tree

4 files changed

+4
-32
lines changed

4 files changed

+4
-32
lines changed

pipeline/lib/static-site-stack.ts

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ export class StaticSiteStack extends cdk.Stack {
1414
constructor(scope: cdk.Construct, id: string, props: StaticSiteStackProps) {
1515
super(scope, id, props);
1616

17+
const certArn = "arn:aws:acm:us-east-1:725714232753:certificate/63474aa5-080f-4601-bb09-72e0d5eb2d29";
1718
const zone = route53.HostedZone.fromLookup(this, 'Zone', { domainName: props.domainName });
1819
const siteDomain = `${props.siteSubDomain}.${props.domainName}`;
19-
new cdk.CfnOutput(this, "Site", { value: "https://" + siteDomain })
20-
2120
// The code that defines your stack goes here
2221
const siteBucket = new s3.Bucket(this, 'SiteBucket', {
2322
bucketName: siteDomain,
@@ -30,23 +29,12 @@ export class StaticSiteStack extends cdk.Stack {
3029
// DESTROY, cdk destroy will attempt to delete the bucket, but will error if the bucket is not empty.
3130
removalPolicy: cdk.RemovalPolicy.DESTROY, // NOT recommended for production code
3231
});
33-
new cdk.CfnOutput(this, "Bucket", { value: siteBucket.bucketName })
34-
3532

36-
const certificateArn = new acm.DnsValidatedCertificate(
37-
this,
38-
"SiteCertificate",
39-
{
40-
domainName: siteDomain,
41-
hostedZone: zone,
42-
region: "us-east-1", // Cloudfront only checks this region for certificates.
43-
}
44-
).certificateArn
45-
new cdk.CfnOutput(this, "Certificate", { value: certificateArn })
33+
4634

4735
const distribution = new cloudfront.CloudFrontWebDistribution(this, 'SiteDistribution', {
4836
aliasConfiguration: {
49-
acmCertRef: certificateArn,
37+
acmCertRef: certArn,
5038
names: [ siteDomain ],
5139
sslMethod: cloudfront.SSLMethod.SNI,
5240
securityPolicy: cloudfront.SecurityPolicyProtocol.TLS_V1_1_2016,
@@ -63,9 +51,6 @@ export class StaticSiteStack extends cdk.Stack {
6351
}
6452
]
6553
});
66-
new cdk.CfnOutput(this, "DistributionId", {
67-
value: distribution.distributionId,
68-
})
6954
new route53.ARecord(this, 'SiteAliasRecord', {
7055
recordName: siteDomain,
7156
target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)),

pipeline/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"test": "jest",
1111
"cdk": "cdk",
1212
"build-synth": "tsc && cdk synth",
13-
"build-deploy": "npm run build && cdk deploy CCBlogPipelineStack --profile default"
13+
"build-deploy": "tsc && cdk deploy CCBlogPipelineStack"
1414
},
1515
"devDependencies": {
1616
"@aws-cdk/assert": "1.31.0",
-510 KB
Binary file not shown.

web/content/posts/second-post/index.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)