@gradientedge/cdk-utils 8.65.0 → 8.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +1 -0
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +4 -1
- package/dist/src/lib/types/aws/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/lib/construct/site-with-ecs-backend/main.ts +10 -1
- package/src/lib/types/aws/index.ts +1 -0
|
@@ -37,6 +37,7 @@ export declare class SiteWithEcsBackend extends CommonConstruct {
|
|
|
37
37
|
id: string;
|
|
38
38
|
siteHostedZone: route53.IHostedZone;
|
|
39
39
|
siteCertificate: certificateManager.ICertificate;
|
|
40
|
+
siteRegionalCertificate: certificateManager.ICertificate;
|
|
40
41
|
siteEcsPolicy: iam.PolicyDocument;
|
|
41
42
|
siteEcsRole: iam.Role;
|
|
42
43
|
siteEcsEnvironment: {
|
|
@@ -58,6 +58,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
58
58
|
/* site resources */
|
|
59
59
|
siteHostedZone;
|
|
60
60
|
siteCertificate;
|
|
61
|
+
siteRegionalCertificate;
|
|
61
62
|
siteEcsPolicy;
|
|
62
63
|
siteEcsRole;
|
|
63
64
|
siteEcsEnvironment;
|
|
@@ -131,6 +132,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
131
132
|
this.props.siteCertificate.certificateArn = this.ssmManager.readStringParameterFromRegion(`${this.id}-certificate-parameter`, this, this.props.siteCertificate.certificateSsmName, this.props.siteCertificate.certificateRegion);
|
|
132
133
|
}
|
|
133
134
|
this.siteCertificate = this.acmManager.resolveCertificate(`${this.id}-certificate`, this, this.props.siteCertificate);
|
|
135
|
+
this.siteRegionalCertificate = this.acmManager.resolveCertificate(`${this.id}-regional-certificate`, this, this.props.siteRegionalCertificate, this.siteHostedZone);
|
|
134
136
|
}
|
|
135
137
|
/**
|
|
136
138
|
* @summary Method to resolve secrets from SecretsManager
|
|
@@ -230,6 +232,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
230
232
|
serviceName: `${this.id}-${this.props.stage}`,
|
|
231
233
|
cpu: this.props.siteTask.cpu,
|
|
232
234
|
loadBalancerName: `${this.id}-${this.props.stage}`,
|
|
235
|
+
certificate: this.siteRegionalCertificate,
|
|
233
236
|
domainName: this.siteInternalDomainName,
|
|
234
237
|
domainZone: this.siteHostedZone,
|
|
235
238
|
listenerPort: this.props.siteTask.listenerPort,
|
|
@@ -340,7 +343,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
340
343
|
createSiteOrigin() {
|
|
341
344
|
this.siteOrigin = new origins.HttpOrigin(this.siteEcsLoadBalancer.loadBalancerDnsName, {
|
|
342
345
|
httpPort: this.props.siteTask.listenerPort,
|
|
343
|
-
protocolPolicy: cloudfront.OriginProtocolPolicy.
|
|
346
|
+
protocolPolicy: cloudfront.OriginProtocolPolicy.HTTPS_ONLY,
|
|
344
347
|
});
|
|
345
348
|
}
|
|
346
349
|
/**
|
|
@@ -69,6 +69,7 @@ export interface SiteWithEcsBackendProps extends CommonStackProps {
|
|
|
69
69
|
siteCacheInvalidationDockerFilePath?: string;
|
|
70
70
|
siteHealthCheck: HealthCheck;
|
|
71
71
|
siteCertificate: AcmProps;
|
|
72
|
+
siteRegionalCertificate: AcmProps;
|
|
72
73
|
siteCluster: EcsClusterProps;
|
|
73
74
|
siteDistribution: DistributionProps;
|
|
74
75
|
siteCloudfrontFunctionProps?: CloudfrontFunctionProps;
|
package/package.json
CHANGED
|
@@ -43,6 +43,7 @@ export class SiteWithEcsBackend extends CommonConstruct {
|
|
|
43
43
|
/* site resources */
|
|
44
44
|
siteHostedZone: route53.IHostedZone
|
|
45
45
|
siteCertificate: certificateManager.ICertificate
|
|
46
|
+
siteRegionalCertificate: certificateManager.ICertificate
|
|
46
47
|
siteEcsPolicy: iam.PolicyDocument
|
|
47
48
|
siteEcsRole: iam.Role
|
|
48
49
|
siteEcsEnvironment: { [key: string]: string }
|
|
@@ -136,6 +137,13 @@ export class SiteWithEcsBackend extends CommonConstruct {
|
|
|
136
137
|
this,
|
|
137
138
|
this.props.siteCertificate
|
|
138
139
|
)
|
|
140
|
+
|
|
141
|
+
this.siteRegionalCertificate = this.acmManager.resolveCertificate(
|
|
142
|
+
`${this.id}-regional-certificate`,
|
|
143
|
+
this,
|
|
144
|
+
this.props.siteRegionalCertificate,
|
|
145
|
+
this.siteHostedZone
|
|
146
|
+
)
|
|
139
147
|
}
|
|
140
148
|
|
|
141
149
|
/**
|
|
@@ -253,6 +261,7 @@ export class SiteWithEcsBackend extends CommonConstruct {
|
|
|
253
261
|
serviceName: `${this.id}-${this.props.stage}`,
|
|
254
262
|
cpu: this.props.siteTask.cpu,
|
|
255
263
|
loadBalancerName: `${this.id}-${this.props.stage}`,
|
|
264
|
+
certificate: this.siteRegionalCertificate,
|
|
256
265
|
domainName: this.siteInternalDomainName,
|
|
257
266
|
domainZone: this.siteHostedZone,
|
|
258
267
|
listenerPort: this.props.siteTask.listenerPort,
|
|
@@ -386,7 +395,7 @@ export class SiteWithEcsBackend extends CommonConstruct {
|
|
|
386
395
|
protected createSiteOrigin() {
|
|
387
396
|
this.siteOrigin = new origins.HttpOrigin(this.siteEcsLoadBalancer.loadBalancerDnsName, {
|
|
388
397
|
httpPort: this.props.siteTask.listenerPort,
|
|
389
|
-
protocolPolicy: cloudfront.OriginProtocolPolicy.
|
|
398
|
+
protocolPolicy: cloudfront.OriginProtocolPolicy.HTTPS_ONLY,
|
|
390
399
|
})
|
|
391
400
|
}
|
|
392
401
|
|
|
@@ -72,6 +72,7 @@ export interface SiteWithEcsBackendProps extends CommonStackProps {
|
|
|
72
72
|
siteCacheInvalidationDockerFilePath?: string
|
|
73
73
|
siteHealthCheck: HealthCheck
|
|
74
74
|
siteCertificate: AcmProps
|
|
75
|
+
siteRegionalCertificate: AcmProps
|
|
75
76
|
siteCluster: EcsClusterProps
|
|
76
77
|
siteDistribution: DistributionProps
|
|
77
78
|
siteCloudfrontFunctionProps?: CloudfrontFunctionProps
|