aws-architect 6.6.46 → 6.6.48

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/CHANGELOG.md CHANGED
@@ -5,6 +5,7 @@ This is the changelog for [AWS Architect](readme.md).
5
5
  * Add support to `deleteWebsiteVersion(version)`
6
6
  * Fix `The function must be in an Active state. The current state for function arn:aws:lambda:Function:514 is Pending`.
7
7
  * Automatically delete existing ROLLBACK_COMPLETE stacks.
8
+ * Add Ipv6 records to the cloudformation templates.
8
9
 
9
10
  ## 6.5 ##
10
11
  * Support APIGW version 2
@@ -7,10 +7,6 @@
7
7
  }
8
8
  },
9
9
 
10
- "Transform": [
11
- "AwsArchitectMacros"
12
- ],
13
-
14
10
  "Resources": {
15
11
  "HostedZone": {
16
12
  "Type": "AWS::Route53::HostedZone",
@@ -28,16 +24,11 @@
28
24
  "SubjectAlternativeNames": [
29
25
  { "Fn::Sub": "*.${hostedZoneName}" }
30
26
  ],
31
- "ValidationMethod": "DNS"
32
- }
33
- },
34
- "AcmCertificateValidationForHostedZone": {
35
- "Type": "AwsArchitectResource::Route53DnsValidationRecord",
36
- "Properties": {
37
- "HostedZoneName": { "Fn::Sub": "${hostedZoneName}." },
38
- "CertificateName": { "Ref": "hostedZoneName" },
39
- "TTL": "300",
40
- "Type": "CNAME"
27
+ "ValidationMethod": "DNS",
28
+ "DomainValidationOptions": [{
29
+ "DomainName": { "Ref": "hostedZoneName" },
30
+ "HostedZoneId": { "Ref": "HostedZone" }
31
+ }]
41
32
  }
42
33
  }
43
34
  }
@@ -28,14 +28,14 @@
28
28
  "FunctionName": { "Ref": "serviceName" },
29
29
  "Description": { "Ref": "serviceDescription" },
30
30
  "Handler": "index.handler",
31
- "Runtime": "nodejs12.x",
31
+ "Runtime": "nodejs16.x",
32
32
  "TracingConfig": {
33
33
  "Mode": "PassThrough"
34
34
  },
35
35
  "Code": {
36
36
  "ZipFile": "exports.handler = async() => Promise.resolve()"
37
37
  },
38
- "MemorySize": 256,
38
+ "MemorySize": 1769,
39
39
  "Timeout": 60,
40
40
  "Role": { "Fn::GetAtt": ["LambdaRole", "Arn"] },
41
41
  "Tags": [
@@ -119,6 +119,14 @@
119
119
  }
120
120
  },
121
121
 
122
+ "CloudWatchLambdaLogGroup": {
123
+ "Type": "AWS::Logs::LogGroup",
124
+ "Properties": {
125
+ "LogGroupName": { "Fn::Sub": "/aws/lambda/${serviceName}" },
126
+ "RetentionInDays": 365
127
+ }
128
+ },
129
+
122
130
  "ApiGatewayV2": {
123
131
  "Type": "AWS::ApiGatewayV2::Api",
124
132
  "Properties": {
@@ -324,6 +332,20 @@
324
332
  }
325
333
  },
326
334
 
335
+ "Route53MapToCustomDomainIpv6": {
336
+ "Type": "AWS::Route53::RecordSet",
337
+ "Properties": {
338
+ "AliasTarget": {
339
+ "DNSName": { "Fn::GetAtt": [ "ServiceDomainName", "RegionalDomainName" ] },
340
+ "HostedZoneId": { "Fn::GetAtt": [ "ServiceDomainName", "RegionalHostedZoneId" ] }
341
+ },
342
+ "HostedZoneName": { "Fn::Sub": "${hostedName}." },
343
+ "Comment": { "Fn::Sub": "Created for service ${serviceName}" },
344
+ "Name": { "Fn::Sub": "${dnsName}.${hostedName}." },
345
+ "Type": "AAAA"
346
+ }
347
+ },
348
+
327
349
  "Route53MapToCustomDomainTst": {
328
350
  "Type": "AWS::Route53::RecordSet",
329
351
  "Properties": {
@@ -336,6 +358,20 @@
336
358
  "Name": { "Fn::Sub": "tst-${dnsName}.${hostedName}." },
337
359
  "Type": "A"
338
360
  }
361
+ },
362
+
363
+ "Route53MapToCustomDomainTstIpv6": {
364
+ "Type": "AWS::Route53::RecordSet",
365
+ "Properties": {
366
+ "AliasTarget": {
367
+ "DNSName": { "Fn::GetAtt": [ "ServiceDomainNameTst", "RegionalDomainName" ] },
368
+ "HostedZoneId": { "Fn::GetAtt": [ "ServiceDomainNameTst", "RegionalHostedZoneId" ] }
369
+ },
370
+ "HostedZoneName": { "Fn::Sub": "${hostedName}." },
371
+ "Comment": { "Fn::Sub": "Created for service ${serviceName}" },
372
+ "Name": { "Fn::Sub": "tst-${dnsName}.${hostedName}." },
373
+ "Type": "AAAA"
374
+ }
339
375
  }
340
376
  }
341
377
  }
@@ -164,6 +164,19 @@
164
164
  }
165
165
  },
166
166
 
167
+ "TestRoute53Ipv6": {
168
+ "Type": "AWS::Route53::RecordSet",
169
+ "Properties": {
170
+ "AliasTarget": {
171
+ "DNSName": { "Fn::GetAtt" : [ "CloudFrontDistribution", "DomainName" ] },
172
+ "HostedZoneId": "Z2FDTNDATAQYW2"
173
+ },
174
+ "HostedZoneId": { "Ref": "hostedZoneId" },
175
+ "Name": { "Fn::Sub": "tst.${dnsName}." },
176
+ "Type": "AAAA"
177
+ }
178
+ },
179
+
167
180
  "ProdRoute53": {
168
181
  "Type": "AWS::Route53::RecordSet",
169
182
  "Properties": {
@@ -176,6 +189,18 @@
176
189
  "Type": "A"
177
190
  }
178
191
  },
192
+ "ProdRoute53Ipv6": {
193
+ "Type": "AWS::Route53::RecordSet",
194
+ "Properties": {
195
+ "AliasTarget": {
196
+ "DNSName": { "Fn::GetAtt" : [ "CloudFrontDistribution", "DomainName" ] },
197
+ "HostedZoneId": "Z2FDTNDATAQYW2"
198
+ },
199
+ "HostedZoneId": { "Ref": "hostedZoneId" },
200
+ "Name": { "Fn::Sub": "${dnsName}." },
201
+ "Type": "AAAA"
202
+ }
203
+ },
179
204
 
180
205
  "WildcardProdRoute53": {
181
206
  "Type": "AWS::Route53::RecordSet",
@@ -188,6 +213,19 @@
188
213
  "Name": { "Fn::Sub": "*.${dnsName}." },
189
214
  "Type": "A"
190
215
  }
216
+ },
217
+
218
+ "WildcardProdRoute53Ipv6": {
219
+ "Type": "AWS::Route53::RecordSet",
220
+ "Properties": {
221
+ "AliasTarget": {
222
+ "DNSName": { "Fn::GetAtt" : [ "CloudFrontDistribution", "DomainName" ] },
223
+ "HostedZoneId": "Z2FDTNDATAQYW2"
224
+ },
225
+ "HostedZoneId": { "Ref": "hostedZoneId" },
226
+ "Name": { "Fn::Sub": "*.${dnsName}." },
227
+ "Type": "AAAA"
228
+ }
191
229
  }
192
230
  }
193
231
  }
@@ -32,7 +32,7 @@ class BucketManager {
32
32
  let contentTypeMapping = Object.assign({}, contentTypeMappingConst, contentTypeMappingOverride || {});
33
33
  console.log('Deploying Website');
34
34
 
35
- const uploadFile = async file => {
35
+ const uploadFile = async (file/*, directoryHasOtherFilesMap */) => {
36
36
  let relativePath = path.relative(path.resolve(contentPath), path.resolve(file));
37
37
  let relativePathUnixFormat = this.unixify(relativePath);
38
38
  let matchingCacheMap = Array.isArray(cacheControlRegexMap) && cacheControlRegexMap.find(m =>
@@ -68,13 +68,14 @@ class BucketManager {
68
68
  await this.putObjectIfDifferent(putObjectParams);
69
69
  console.log(` => ${putObjectParams.Key} (Directory Handler)`);
70
70
 
71
- // Then add a redirect from the base location to the "/"
71
+ // Then add a redirect from the base location to the "/" or if using enableIndexConversion just duplicate the file again
72
72
  if (enableIndexConversion) {
73
73
  putObjectParams.Body = fileData;
74
74
  putObjectParams.Key = `${this.unixify(path.join(version, redirectFileUrl))}`;
75
75
  } else {
76
76
  const redirectFile = await fs.readFile(path.join(__dirname, './appRedirect.html'));
77
- const updatedRedirectFile = redirectFile.toString().replace('{{PATH}}', redirectFileUrl[0] === '/' ? redirectFileUrl : `/${redirectFileUrl}`);
77
+ let lastPartOfPath = redirectFile.toString().split('/').slice(-1)[0];
78
+ const updatedRedirectFile = redirectFile.toString().replace('{{PATH}}', lastPartOfPath); // redirectFileUrl[0] === '/' ? redirectFileUrl : `/${redirectFileUrl}`);
78
79
  putObjectParams.Body = Buffer.from(updatedRedirectFile);
79
80
  putObjectParams.Key = this.unixify(path.join(version, redirectFileUrl));
80
81
  putObjectParams.ContentMD5 = createHash('md5').update(updatedRedirectFile).digest('base64');
@@ -97,8 +98,13 @@ class BucketManager {
97
98
  let sortedList = list.filter(file => !file.match('index.html'));
98
99
  await Promise.all(sortedList.map(file => uploadFile(file)));
99
100
 
101
+ const fileCountsPerDirectoryMap = {};
102
+ for (const file of sortedList) {
103
+ const splitFile = file.split('/').slice(0, -1).join('/');
104
+ fileCountsPerDirectoryMap[splitFile] = true;
105
+ }
100
106
  let indexList = list.filter(file => file.match('index.html')).sort((a, b) => b.split('/').length - a.split('/').length);
101
- await Promise.all(indexList.map(file => uploadFile(file)));
107
+ await Promise.all(indexList.map(file => uploadFile(file, fileCountsPerDirectoryMap)));
102
108
 
103
109
  return { Title: 'Upload Success.', Bucket: this.Bucket, Version: version };
104
110
  }
@@ -7,7 +7,7 @@
7
7
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
8
8
  <meta name="theme-color" content="#2d434d">
9
9
  <title>Redirect</title>
10
- <meta http-equiv="refresh" content="0; URL='{{PATH}}/'" />
10
+ <meta http-equiv="refresh" content="0; URL='./{{PATH}}/'" />
11
11
  </head>
12
12
 
13
13
  <body style="margin: 0; background-color: #e9eff2">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-architect",
3
- "version": "6.6.46",
3
+ "version": "6.6.48",
4
4
  "description": "AWS Architect is a node based tool to configure and deploy AWS-based microservices.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",