@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resistdesign/voltra",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-alpha.3",
4
4
  "description": "With our powers combined!",
5
5
  "homepage": "https://voltra.app",
6
6
  "repository": "git@github.com:resistdesign/voltra.git",
@@ -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
- [`${id}CloudFront`]: {
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: [`${id}CloudFront`],
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": [`${id}CloudFront`, "DomainName"],
116
+ "Fn::GetAtt": [id, "DomainName"],
104
117
  },
105
118
  },
106
119
  ],