Skip to content

Commit 9d23cad

Browse files
authored
feat(synthetics): support runtime 3.9 (#24101)
Synthetics would really rather have everyone on 3.9 instead of 3.8. Add support for the new version and update the examples in the README and the integ tests (didn't update the unit tests, those don't affect correctness of anything). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 4c72a7d commit 9d23cad

File tree

10 files changed

+52
-33
lines changed

10 files changed

+52
-33
lines changed

Diff for: packages/@aws-cdk/aws-synthetics/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const canary = new synthetics.Canary(this, 'MyCanary', {
4242
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
4343
handler: 'index.handler',
4444
}),
45-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
45+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
4646
environmentVariables: {
4747
stage: 'prod',
4848
},
@@ -126,7 +126,7 @@ const canary = new synthetics.Canary(stack, 'Canary', {
126126
code: synthetics.Code.fromInline('/* Synthetics handler code'),
127127
}),
128128
enableAutoDeleteLambdas: true,
129-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
129+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
130130
});
131131
```
132132

@@ -152,7 +152,7 @@ new synthetics.Canary(this, 'Inline Canary', {
152152
code: synthetics.Code.fromInline('/* Synthetics handler code */'),
153153
handler: 'index.handler', // must be 'index.handler'
154154
}),
155-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
155+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
156156
});
157157

158158
// To supply the code from your local filesystem:
@@ -161,7 +161,7 @@ new synthetics.Canary(this, 'Asset Canary', {
161161
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
162162
handler: 'index.handler', // must end with '.handler'
163163
}),
164-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
164+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
165165
});
166166

167167
// To supply the code from a S3 bucket:
@@ -172,7 +172,7 @@ new synthetics.Canary(this, 'Bucket Canary', {
172172
code: synthetics.Code.fromBucket(bucket, 'canary.zip'),
173173
handler: 'index.handler', // must end with '.handler'
174174
}),
175-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
175+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
176176
});
177177
```
178178

@@ -198,8 +198,8 @@ new synthetics.Canary(this, 'Bucket Canary', {
198198
199199
### Running a canary on a VPC
200200
201-
You can specify what [VPC a canary executes in](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html).
202-
This can allow for monitoring services that may be internal to a specific VPC. To place a canary within a VPC, you can specify the `vpc` property with the desired `VPC` to place then canary in.
201+
You can specify what [VPC a canary executes in](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html).
202+
This can allow for monitoring services that may be internal to a specific VPC. To place a canary within a VPC, you can specify the `vpc` property with the desired `VPC` to place then canary in.
203203
This will automatically attach the appropriate IAM permissions to attach to the VPC. This will also create a Security Group and attach to the default subnets for the VPC unless specified via `vpcSubnets` and `securityGroups`.
204204
205205
```ts
@@ -211,7 +211,7 @@ new synthetics.Canary(this, 'Vpc Canary', {
211211
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
212212
handler: 'index.handler',
213213
}),
214-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
214+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
215215
vpc,
216216
});
217217
```

Diff for: packages/@aws-cdk/aws-synthetics/lib/runtime.ts

+19
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export class Runtime {
8383
* - Chromium version 88.0.4298.0
8484
*
8585
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-3.0
86+
* @deprecated Use the latest version instead
8687
*/
8788
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_0 = new Runtime('syn-nodejs-puppeteer-3.0', RuntimeFamily.NODEJS);
8889

@@ -95,6 +96,7 @@ export class Runtime {
9596
* - Chromium version 88.0.4298.0
9697
*
9798
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-3.1
99+
* @deprecated Use the latest version instead
98100
*/
99101
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_1 = new Runtime('syn-nodejs-puppeteer-3.1', RuntimeFamily.NODEJS);
100102

@@ -107,6 +109,7 @@ export class Runtime {
107109
* - Chromium version 88.0.4298.0
108110
*
109111
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-3.2
112+
* @deprecated Use the latest version instead
110113
*/
111114
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_2 = new Runtime('syn-nodejs-puppeteer-3.2', RuntimeFamily.NODEJS);
112115

@@ -119,6 +122,7 @@ export class Runtime {
119122
* - Chromium version 88.0.4298.0
120123
*
121124
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-3.3
125+
* @deprecated Use the latest version instead
122126
*/
123127
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_3 = new Runtime('syn-nodejs-puppeteer-3.3', RuntimeFamily.NODEJS);
124128

@@ -131,6 +135,7 @@ export class Runtime {
131135
* - Chromium version 88.0.4298.0
132136
*
133137
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-3.4
138+
* @deprecated Use the latest version instead
134139
*/
135140
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_4 = new Runtime('syn-nodejs-puppeteer-3.4', RuntimeFamily.NODEJS);
136141

@@ -181,6 +186,20 @@ export class Runtime {
181186
*/
182187
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_8 = new Runtime('syn-nodejs-puppeteer-3.8', RuntimeFamily.NODEJS);
183188

189+
/**
190+
* `syn-nodejs-puppeteer-3.9` includes the following:
191+
*
192+
* - Lambda runtime Node.js 14.x
193+
* - Puppeteer-core version 5.5.0
194+
* - Chromium version 92.0.4512
195+
*
196+
* New Features:
197+
* - **Dependency upgrades**: Upgrades some third-party dependency packages.
198+
*
199+
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-3.9
200+
*/
201+
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_9 = new Runtime('syn-nodejs-puppeteer-3.9', RuntimeFamily.NODEJS);
202+
184203
/**
185204
* `syn-python-selenium-1.0` includes the following:
186205
* - Lambda runtime Python 3.8

Diff for: packages/@aws-cdk/aws-synthetics/test/integ.canary.js.snapshot/canary-one.template.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
]
130130
},
131131
"Name": "canary-integ",
132-
"RuntimeVersion": "syn-nodejs-puppeteer-3.8",
132+
"RuntimeVersion": "syn-nodejs-puppeteer-3.9",
133133
"Schedule": {
134134
"DurationInSeconds": "0",
135135
"Expression": "rate(1 minute)"
@@ -326,7 +326,7 @@
326326
]
327327
},
328328
"Name": "assetcanary-one",
329-
"RuntimeVersion": "syn-nodejs-puppeteer-3.8",
329+
"RuntimeVersion": "syn-nodejs-puppeteer-3.9",
330330
"Schedule": {
331331
"DurationInSeconds": "0",
332332
"Expression": "rate(5 minutes)"
@@ -524,7 +524,7 @@
524524
]
525525
},
526526
"Name": "assetcanary-two",
527-
"RuntimeVersion": "syn-nodejs-puppeteer-3.8",
527+
"RuntimeVersion": "syn-nodejs-puppeteer-3.9",
528528
"Schedule": {
529529
"DurationInSeconds": "0",
530530
"Expression": "rate(5 minutes)"
@@ -721,7 +721,7 @@
721721
]
722722
},
723723
"Name": "assetcanary-three",
724-
"RuntimeVersion": "syn-nodejs-puppeteer-3.8",
724+
"RuntimeVersion": "syn-nodejs-puppeteer-3.9",
725725
"Schedule": {
726726
"DurationInSeconds": "0",
727727
"Expression": "rate(5 minutes)"
@@ -918,7 +918,7 @@
918918
]
919919
},
920920
"Name": "assetcanary-four",
921-
"RuntimeVersion": "syn-nodejs-puppeteer-3.8",
921+
"RuntimeVersion": "syn-nodejs-puppeteer-3.9",
922922
"Schedule": {
923923
"DurationInSeconds": "0",
924924
"Expression": "rate(5 minutes)"
@@ -1115,7 +1115,7 @@
11151115
]
11161116
},
11171117
"Name": "assetcanary-five",
1118-
"RuntimeVersion": "syn-nodejs-puppeteer-3.8",
1118+
"RuntimeVersion": "syn-nodejs-puppeteer-3.9",
11191119
"Schedule": {
11201120
"DurationInSeconds": "0",
11211121
"Expression": "rate(5 minutes)"
@@ -1355,4 +1355,4 @@
13551355
]
13561356
}
13571357
}
1358-
}
1358+
}

Diff for: packages/@aws-cdk/aws-synthetics/test/integ.canary.js.snapshot/tree.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
]
188188
},
189189
"name": "canary-integ",
190-
"runtimeVersion": "syn-nodejs-puppeteer-3.8",
190+
"runtimeVersion": "syn-nodejs-puppeteer-3.9",
191191
"schedule": {
192192
"durationInSeconds": "0",
193193
"expression": "rate(1 minute)"
@@ -488,7 +488,7 @@
488488
]
489489
},
490490
"name": "assetcanary-one",
491-
"runtimeVersion": "syn-nodejs-puppeteer-3.8",
491+
"runtimeVersion": "syn-nodejs-puppeteer-3.9",
492492
"schedule": {
493493
"durationInSeconds": "0",
494494
"expression": "rate(5 minutes)"
@@ -790,7 +790,7 @@
790790
]
791791
},
792792
"name": "assetcanary-two",
793-
"runtimeVersion": "syn-nodejs-puppeteer-3.8",
793+
"runtimeVersion": "syn-nodejs-puppeteer-3.9",
794794
"schedule": {
795795
"durationInSeconds": "0",
796796
"expression": "rate(5 minutes)"
@@ -1091,7 +1091,7 @@
10911091
]
10921092
},
10931093
"name": "assetcanary-three",
1094-
"runtimeVersion": "syn-nodejs-puppeteer-3.8",
1094+
"runtimeVersion": "syn-nodejs-puppeteer-3.9",
10951095
"schedule": {
10961096
"durationInSeconds": "0",
10971097
"expression": "rate(5 minutes)"
@@ -1392,7 +1392,7 @@
13921392
]
13931393
},
13941394
"name": "assetcanary-four",
1395-
"runtimeVersion": "syn-nodejs-puppeteer-3.8",
1395+
"runtimeVersion": "syn-nodejs-puppeteer-3.9",
13961396
"schedule": {
13971397
"durationInSeconds": "0",
13981398
"expression": "rate(5 minutes)"
@@ -1693,7 +1693,7 @@
16931693
]
16941694
},
16951695
"name": "assetcanary-five",
1696-
"runtimeVersion": "syn-nodejs-puppeteer-3.8",
1696+
"runtimeVersion": "syn-nodejs-puppeteer-3.9",
16971697
"schedule": {
16981698
"durationInSeconds": "0",
16991699
"expression": "rate(5 minutes)"
@@ -2049,4 +2049,4 @@
20492049
"version": "0.0.0"
20502050
}
20512051
}
2052-
}
2052+
}

Diff for: packages/@aws-cdk/aws-synthetics/test/integ.canary.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ new synthetics.Canary(stack, 'MyCanary', {
3131
}),
3232
schedule: synthetics.Schedule.rate(cdk.Duration.minutes(1)),
3333
artifactsBucketLocation: { bucket, prefix },
34-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
34+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
3535
});
3636

3737
new synthetics.Canary(stack, 'MyCanaryOne', {
@@ -40,7 +40,7 @@ new synthetics.Canary(stack, 'MyCanaryOne', {
4040
handler: 'canary.handler',
4141
code: synthetics.Code.fromAsset(path.join(__dirname, 'canaries')),
4242
}),
43-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
43+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
4444
enableAutoDeleteLambdas: true,
4545
});
4646

@@ -50,7 +50,7 @@ new synthetics.Canary(stack, 'MyCanaryTwo', {
5050
handler: 'canary.handler',
5151
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary.zip')),
5252
}),
53-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
53+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
5454
});
5555

5656
new synthetics.Canary(stack, 'MyCanaryThree', {
@@ -59,7 +59,7 @@ new synthetics.Canary(stack, 'MyCanaryThree', {
5959
handler: 'canary.handler',
6060
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary.zip')),
6161
}),
62-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
62+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
6363
});
6464

6565
new synthetics.Canary(stack, 'MyCanaryFour', {
@@ -68,7 +68,7 @@ new synthetics.Canary(stack, 'MyCanaryFour', {
6868
handler: 'canary.handler',
6969
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary.zip')),
7070
}),
71-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
71+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
7272
});
7373

7474
new synthetics.Canary(stack, 'MyCanaryRuntime38', {
@@ -77,7 +77,7 @@ new synthetics.Canary(stack, 'MyCanaryRuntime38', {
7777
handler: 'canary.handler',
7878
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary.zip')),
7979
}),
80-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
80+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
8181
});
8282

8383
new synthetics.Canary(stack, 'MyPythonCanary', {

Diff for: packages/@aws-cdk/aws-synthetics/test/integ.vpc.js.snapshot/canary-vpc.assets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "29.0.0",
2+
"version": "30.0.0",
33
"files": {
44
"b1b777dcb79a2fa2790059927207d10bf5f4747d6dd1516e2780726d9d6fa820": {
55
"source": {
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"29.0.0"}
1+
{"version":"30.0.0"}

Diff for: packages/@aws-cdk/aws-synthetics/test/integ.vpc.js.snapshot/integ.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "29.0.0",
2+
"version": "30.0.0",
33
"testCases": {
44
"integ.vpc": {
55
"stacks": [

Diff for: packages/@aws-cdk/aws-synthetics/test/integ.vpc.js.snapshot/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "29.0.0",
2+
"version": "30.0.0",
33
"artifacts": {
44
"canary-vpc.assets": {
55
"type": "cdk:asset-manifest",

Diff for: packages/@aws-cdk/aws-synthetics/test/integ.vpc.js.snapshot/tree.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@
10481048
"path": "Tree",
10491049
"constructInfo": {
10501050
"fqn": "constructs.Construct",
1051-
"version": "10.1.228"
1051+
"version": "10.1.237"
10521052
}
10531053
}
10541054
},

0 commit comments

Comments
 (0)