Skip to content

Commit 36f89f6

Browse files
pallymoreNaumel
authored andcommitted
feat(synthetics): runtime version syn-nodejs-puppeteer-3.7 (aws#22610)
* adds a constant for nodejs runtime version 3.7 * Updated readme to use 3.7 because versions <= 3.4 are being deprecated * added a new integ test for 3.7 (and updated its snapshots) ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent df36d45 commit 36f89f6

File tree

9 files changed

+559
-25
lines changed

9 files changed

+559
-25
lines changed

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

+5-5
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_1,
45+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_7,
4646
environmentVariables: {
4747
stage: 'prod',
4848
},
@@ -129,7 +129,7 @@ new synthetics.Canary(this, 'Inline Canary', {
129129
code: synthetics.Code.fromInline('/* Synthetics handler code */'),
130130
handler: 'index.handler', // must be 'index.handler'
131131
}),
132-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_4,
132+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_7,
133133
});
134134

135135
// To supply the code from your local filesystem:
@@ -138,7 +138,7 @@ new synthetics.Canary(this, 'Asset Canary', {
138138
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
139139
handler: 'index.handler', // must end with '.handler'
140140
}),
141-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_4,
141+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_7,
142142
});
143143

144144
// To supply the code from a S3 bucket:
@@ -149,7 +149,7 @@ new synthetics.Canary(this, 'Bucket Canary', {
149149
code: synthetics.Code.fromBucket(bucket, 'canary.zip'),
150150
handler: 'index.handler', // must end with '.handler'
151151
}),
152-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_4,
152+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_7,
153153
});
154154
```
155155

@@ -188,7 +188,7 @@ new synthetics.Canary(this, 'Vpc Canary', {
188188
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
189189
handler: 'index.handler',
190190
}),
191-
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_4,
191+
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_7,
192192
vpc,
193193
});
194194
```

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

+10
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ export class Runtime {
144144
*/
145145
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_6 = new Runtime('syn-nodejs-puppeteer-3.6', RuntimeFamily.NODEJS);
146146

147+
/**
148+
* `syn-nodejs-puppeteer-3.7` includes the following:
149+
* - Lambda runtime Node.js 14.x
150+
* - Puppeteer-core version 10.1.0
151+
* - Chromium version 92.0.4512
152+
*
153+
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-3.7
154+
*/
155+
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_7 = new Runtime('syn-nodejs-puppeteer-3.7', RuntimeFamily.NODEJS);
156+
147157
/**
148158
* `syn-python-selenium-1.0` includes the following:
149159
* - Lambda runtime Python 3.8

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "20.0.0",
2+
"version": "21.0.0",
33
"files": {
44
"9d00e437db1f5f8788ce938a3f00a9a1b946820e78c9b4c36207c8475db882bb": {
55
"source": {
@@ -27,15 +27,15 @@
2727
}
2828
}
2929
},
30-
"dd5cacd9987453c5d75cae0c956943b37b2fb0597ac6490e5b2e3eb1d0a5a6a0": {
30+
"38dcc41263b1a009e2d7560d81dee9041f4f7941b66cd73b63df402a6fe3c22d": {
3131
"source": {
3232
"path": "canary-one.template.json",
3333
"packaging": "file"
3434
},
3535
"destinations": {
3636
"current_account-current_region": {
3737
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
38-
"objectKey": "dd5cacd9987453c5d75cae0c956943b37b2fb0597ac6490e5b2e3eb1d0a5a6a0.json",
38+
"objectKey": "38dcc41263b1a009e2d7560d81dee9041f4f7941b66cd73b63df402a6fe3c22d.json",
3939
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
4040
}
4141
}

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

+197
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,203 @@
728728
"StartCanaryAfterCreation": true
729729
}
730730
},
731+
"MyCanaryFourArtifactsBucketE259973B": {
732+
"Type": "AWS::S3::Bucket",
733+
"Properties": {
734+
"BucketEncryption": {
735+
"ServerSideEncryptionConfiguration": [
736+
{
737+
"ServerSideEncryptionByDefault": {
738+
"SSEAlgorithm": "aws:kms"
739+
}
740+
}
741+
]
742+
}
743+
},
744+
"UpdateReplacePolicy": "Retain",
745+
"DeletionPolicy": "Retain"
746+
},
747+
"MyCanaryFourArtifactsBucketPolicy20BDB9D7": {
748+
"Type": "AWS::S3::BucketPolicy",
749+
"Properties": {
750+
"Bucket": {
751+
"Ref": "MyCanaryFourArtifactsBucketE259973B"
752+
},
753+
"PolicyDocument": {
754+
"Statement": [
755+
{
756+
"Action": "s3:*",
757+
"Condition": {
758+
"Bool": {
759+
"aws:SecureTransport": "false"
760+
}
761+
},
762+
"Effect": "Deny",
763+
"Principal": {
764+
"AWS": "*"
765+
},
766+
"Resource": [
767+
{
768+
"Fn::GetAtt": [
769+
"MyCanaryFourArtifactsBucketE259973B",
770+
"Arn"
771+
]
772+
},
773+
{
774+
"Fn::Join": [
775+
"",
776+
[
777+
{
778+
"Fn::GetAtt": [
779+
"MyCanaryFourArtifactsBucketE259973B",
780+
"Arn"
781+
]
782+
},
783+
"/*"
784+
]
785+
]
786+
}
787+
]
788+
}
789+
],
790+
"Version": "2012-10-17"
791+
}
792+
}
793+
},
794+
"MyCanaryFourServiceRoleA532F905": {
795+
"Type": "AWS::IAM::Role",
796+
"Properties": {
797+
"AssumeRolePolicyDocument": {
798+
"Statement": [
799+
{
800+
"Action": "sts:AssumeRole",
801+
"Effect": "Allow",
802+
"Principal": {
803+
"Service": "lambda.amazonaws.com"
804+
}
805+
}
806+
],
807+
"Version": "2012-10-17"
808+
},
809+
"Policies": [
810+
{
811+
"PolicyDocument": {
812+
"Statement": [
813+
{
814+
"Action": "s3:ListAllMyBuckets",
815+
"Effect": "Allow",
816+
"Resource": "*"
817+
},
818+
{
819+
"Action": "s3:GetBucketLocation",
820+
"Effect": "Allow",
821+
"Resource": {
822+
"Fn::GetAtt": [
823+
"MyCanaryFourArtifactsBucketE259973B",
824+
"Arn"
825+
]
826+
}
827+
},
828+
{
829+
"Action": "s3:PutObject",
830+
"Effect": "Allow",
831+
"Resource": {
832+
"Fn::Join": [
833+
"",
834+
[
835+
{
836+
"Fn::GetAtt": [
837+
"MyCanaryFourArtifactsBucketE259973B",
838+
"Arn"
839+
]
840+
},
841+
"/*"
842+
]
843+
]
844+
}
845+
},
846+
{
847+
"Action": "cloudwatch:PutMetricData",
848+
"Condition": {
849+
"StringEquals": {
850+
"cloudwatch:namespace": "CloudWatchSynthetics"
851+
}
852+
},
853+
"Effect": "Allow",
854+
"Resource": "*"
855+
},
856+
{
857+
"Action": [
858+
"logs:CreateLogGroup",
859+
"logs:CreateLogStream",
860+
"logs:PutLogEvents"
861+
],
862+
"Effect": "Allow",
863+
"Resource": {
864+
"Fn::Join": [
865+
"",
866+
[
867+
"arn:",
868+
{
869+
"Ref": "AWS::Partition"
870+
},
871+
":logs:",
872+
{
873+
"Ref": "AWS::Region"
874+
},
875+
":",
876+
{
877+
"Ref": "AWS::AccountId"
878+
},
879+
":log-group:/aws/lambda/cwsyn-*"
880+
]
881+
]
882+
}
883+
}
884+
],
885+
"Version": "2012-10-17"
886+
},
887+
"PolicyName": "canaryPolicy"
888+
}
889+
]
890+
}
891+
},
892+
"MyCanaryFour15095F40": {
893+
"Type": "AWS::Synthetics::Canary",
894+
"Properties": {
895+
"ArtifactS3Location": {
896+
"Fn::Join": [
897+
"",
898+
[
899+
"s3://",
900+
{
901+
"Ref": "MyCanaryFourArtifactsBucketE259973B"
902+
}
903+
]
904+
]
905+
},
906+
"Code": {
907+
"Handler": "canary.handler",
908+
"S3Bucket": {
909+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
910+
},
911+
"S3Key": "b1b777dcb79a2fa2790059927207d10bf5f4747d6dd1516e2780726d9d6fa820.zip"
912+
},
913+
"ExecutionRoleArn": {
914+
"Fn::GetAtt": [
915+
"MyCanaryFourServiceRoleA532F905",
916+
"Arn"
917+
]
918+
},
919+
"Name": "assetcanary-four",
920+
"RuntimeVersion": "syn-nodejs-puppeteer-3.7",
921+
"Schedule": {
922+
"DurationInSeconds": "0",
923+
"Expression": "rate(5 minutes)"
924+
},
925+
"StartCanaryAfterCreation": true
926+
}
927+
},
731928
"MyPythonCanaryArtifactsBucket7AE88133": {
732929
"Type": "AWS::S3::Bucket",
733930
"Properties": {
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"20.0.0"}
1+
{"version":"21.0.0"}

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

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

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

+26-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "20.0.0",
2+
"version": "21.0.0",
33
"artifacts": {
44
"Tree": {
55
"type": "cdk:tree",
@@ -23,7 +23,7 @@
2323
"validateOnSynth": false,
2424
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
2525
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
26-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/dd5cacd9987453c5d75cae0c956943b37b2fb0597ac6490e5b2e3eb1d0a5a6a0.json",
26+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/38dcc41263b1a009e2d7560d81dee9041f4f7941b66cd73b63df402a6fe3c22d.json",
2727
"requiresBootstrapStackVersion": 6,
2828
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2929
"additionalDependencies": [
@@ -129,6 +129,30 @@
129129
"data": "MyCanaryThree968B1271"
130130
}
131131
],
132+
"/canary-one/MyCanaryFour/ArtifactsBucket/Resource": [
133+
{
134+
"type": "aws:cdk:logicalId",
135+
"data": "MyCanaryFourArtifactsBucketE259973B"
136+
}
137+
],
138+
"/canary-one/MyCanaryFour/ArtifactsBucket/Policy/Resource": [
139+
{
140+
"type": "aws:cdk:logicalId",
141+
"data": "MyCanaryFourArtifactsBucketPolicy20BDB9D7"
142+
}
143+
],
144+
"/canary-one/MyCanaryFour/ServiceRole/Resource": [
145+
{
146+
"type": "aws:cdk:logicalId",
147+
"data": "MyCanaryFourServiceRoleA532F905"
148+
}
149+
],
150+
"/canary-one/MyCanaryFour/Resource": [
151+
{
152+
"type": "aws:cdk:logicalId",
153+
"data": "MyCanaryFour15095F40"
154+
}
155+
],
132156
"/canary-one/MyPythonCanary/ArtifactsBucket/Resource": [
133157
{
134158
"type": "aws:cdk:logicalId",

0 commit comments

Comments
 (0)