@resistdesign/voltra 3.0.0-alpha.1 → 3.0.0-alpha.3
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/package.json +1 -1
- package/src/iac/packs/cdn.js +16 -3
package/package.json
CHANGED
package/src/iac/packs/cdn.js
CHANGED
|
@@ -7,9 +7,21 @@ const utils_1 = require("../utils");
|
|
|
7
7
|
* Includes a DNS record for the domain.
|
|
8
8
|
* */
|
|
9
9
|
exports.addCDN = (0, utils_1.createResourcePack)(({ id, hostedZoneId, domainName, certificateArn, fileStorageId, }) => {
|
|
10
|
+
const oacId = `${id}OriginAccessControl`;
|
|
10
11
|
return {
|
|
11
12
|
Resources: {
|
|
12
|
-
[
|
|
13
|
+
[oacId]: {
|
|
14
|
+
Type: "AWS::CloudFront::OriginAccessControl",
|
|
15
|
+
Properties: {
|
|
16
|
+
OriginAccessControlConfig: {
|
|
17
|
+
Name: oacId,
|
|
18
|
+
OriginAccessControlOriginType: "s3",
|
|
19
|
+
SigningBehavior: "always",
|
|
20
|
+
SigningProtocol: "sigv4",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
[id]: {
|
|
13
25
|
Type: "AWS::CloudFront::Distribution",
|
|
14
26
|
DependsOn: fileStorageId,
|
|
15
27
|
Properties: {
|
|
@@ -56,6 +68,7 @@ exports.addCDN = (0, utils_1.createResourcePack)(({ id, hostedZoneId, domainName
|
|
|
56
68
|
},
|
|
57
69
|
],
|
|
58
70
|
},
|
|
71
|
+
OriginAccessControlId: { Ref: oacId },
|
|
59
72
|
S3OriginConfig: {
|
|
60
73
|
OriginAccessIdentity: "",
|
|
61
74
|
},
|
|
@@ -81,7 +94,7 @@ exports.addCDN = (0, utils_1.createResourcePack)(({ id, hostedZoneId, domainName
|
|
|
81
94
|
},
|
|
82
95
|
[`${id}Route53Record`]: {
|
|
83
96
|
Type: "AWS::Route53::RecordSet",
|
|
84
|
-
DependsOn: [
|
|
97
|
+
DependsOn: [id],
|
|
85
98
|
Properties: {
|
|
86
99
|
HostedZoneId: hostedZoneId,
|
|
87
100
|
Type: "A",
|
|
@@ -100,7 +113,7 @@ exports.addCDN = (0, utils_1.createResourcePack)(({ id, hostedZoneId, domainName
|
|
|
100
113
|
"${DomainName}.",
|
|
101
114
|
{
|
|
102
115
|
DomainName: {
|
|
103
|
-
"Fn::GetAtt": [
|
|
116
|
+
"Fn::GetAtt": [id, "DomainName"],
|
|
104
117
|
},
|
|
105
118
|
},
|
|
106
119
|
],
|