Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(synthetics): support runtime 3.9 #24101

Merged
merged 4 commits into from
Feb 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions packages/@aws-cdk/aws-synthetics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const canary = new synthetics.Canary(this, 'MyCanary', {
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
handler: 'index.handler',
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
environmentVariables: {
stage: 'prod',
},
Expand Down Expand Up @@ -126,7 +126,7 @@ const canary = new synthetics.Canary(stack, 'Canary', {
code: synthetics.Code.fromInline('/* Synthetics handler code'),
}),
enableAutoDeleteLambdas: true,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
});
```

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

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

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

Expand All @@ -198,8 +198,8 @@ new synthetics.Canary(this, 'Bucket Canary', {

### Running a canary on a VPC

You can specify what [VPC a canary executes in](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html).
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.
You can specify what [VPC a canary executes in](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html).
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.
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`.

```ts
Expand All @@ -211,7 +211,7 @@ new synthetics.Canary(this, 'Vpc Canary', {
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
handler: 'index.handler',
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
vpc,
});
```
Expand Down
19 changes: 19 additions & 0 deletions packages/@aws-cdk/aws-synthetics/lib/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export class Runtime {
* - Chromium version 88.0.4298.0
*
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-3.0
* @deprecated Use the latest version instead
*/
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_0 = new Runtime('syn-nodejs-puppeteer-3.0', RuntimeFamily.NODEJS);

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

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

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

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

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

/**
* `syn-nodejs-puppeteer-3.9` includes the following:
*
* - Lambda runtime Node.js 14.x
* - Puppeteer-core version 5.5.0
* - Chromium version 92.0.4512
*
* New Features:
* - **Dependency upgrades**: Upgrades some third-party dependency packages.
*
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-3.9
*/
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_9 = new Runtime('syn-nodejs-puppeteer-3.9', RuntimeFamily.NODEJS);

/**
* `syn-python-selenium-1.0` includes the following:
* - Lambda runtime Python 3.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
]
},
"Name": "canary-integ",
"RuntimeVersion": "syn-nodejs-puppeteer-3.8",
"RuntimeVersion": "syn-nodejs-puppeteer-3.9",
"Schedule": {
"DurationInSeconds": "0",
"Expression": "rate(1 minute)"
Expand Down Expand Up @@ -326,7 +326,7 @@
]
},
"Name": "assetcanary-one",
"RuntimeVersion": "syn-nodejs-puppeteer-3.8",
"RuntimeVersion": "syn-nodejs-puppeteer-3.9",
"Schedule": {
"DurationInSeconds": "0",
"Expression": "rate(5 minutes)"
Expand Down Expand Up @@ -524,7 +524,7 @@
]
},
"Name": "assetcanary-two",
"RuntimeVersion": "syn-nodejs-puppeteer-3.8",
"RuntimeVersion": "syn-nodejs-puppeteer-3.9",
"Schedule": {
"DurationInSeconds": "0",
"Expression": "rate(5 minutes)"
Expand Down Expand Up @@ -721,7 +721,7 @@
]
},
"Name": "assetcanary-three",
"RuntimeVersion": "syn-nodejs-puppeteer-3.8",
"RuntimeVersion": "syn-nodejs-puppeteer-3.9",
"Schedule": {
"DurationInSeconds": "0",
"Expression": "rate(5 minutes)"
Expand Down Expand Up @@ -918,7 +918,7 @@
]
},
"Name": "assetcanary-four",
"RuntimeVersion": "syn-nodejs-puppeteer-3.8",
"RuntimeVersion": "syn-nodejs-puppeteer-3.9",
"Schedule": {
"DurationInSeconds": "0",
"Expression": "rate(5 minutes)"
Expand Down Expand Up @@ -1115,7 +1115,7 @@
]
},
"Name": "assetcanary-five",
"RuntimeVersion": "syn-nodejs-puppeteer-3.8",
"RuntimeVersion": "syn-nodejs-puppeteer-3.9",
"Schedule": {
"DurationInSeconds": "0",
"Expression": "rate(5 minutes)"
Expand Down Expand Up @@ -1355,4 +1355,4 @@
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
]
},
"name": "canary-integ",
"runtimeVersion": "syn-nodejs-puppeteer-3.8",
"runtimeVersion": "syn-nodejs-puppeteer-3.9",
"schedule": {
"durationInSeconds": "0",
"expression": "rate(1 minute)"
Expand Down Expand Up @@ -488,7 +488,7 @@
]
},
"name": "assetcanary-one",
"runtimeVersion": "syn-nodejs-puppeteer-3.8",
"runtimeVersion": "syn-nodejs-puppeteer-3.9",
"schedule": {
"durationInSeconds": "0",
"expression": "rate(5 minutes)"
Expand Down Expand Up @@ -790,7 +790,7 @@
]
},
"name": "assetcanary-two",
"runtimeVersion": "syn-nodejs-puppeteer-3.8",
"runtimeVersion": "syn-nodejs-puppeteer-3.9",
"schedule": {
"durationInSeconds": "0",
"expression": "rate(5 minutes)"
Expand Down Expand Up @@ -1091,7 +1091,7 @@
]
},
"name": "assetcanary-three",
"runtimeVersion": "syn-nodejs-puppeteer-3.8",
"runtimeVersion": "syn-nodejs-puppeteer-3.9",
"schedule": {
"durationInSeconds": "0",
"expression": "rate(5 minutes)"
Expand Down Expand Up @@ -1392,7 +1392,7 @@
]
},
"name": "assetcanary-four",
"runtimeVersion": "syn-nodejs-puppeteer-3.8",
"runtimeVersion": "syn-nodejs-puppeteer-3.9",
"schedule": {
"durationInSeconds": "0",
"expression": "rate(5 minutes)"
Expand Down Expand Up @@ -1693,7 +1693,7 @@
]
},
"name": "assetcanary-five",
"runtimeVersion": "syn-nodejs-puppeteer-3.8",
"runtimeVersion": "syn-nodejs-puppeteer-3.9",
"schedule": {
"durationInSeconds": "0",
"expression": "rate(5 minutes)"
Expand Down Expand Up @@ -2049,4 +2049,4 @@
"version": "0.0.0"
}
}
}
}
12 changes: 6 additions & 6 deletions packages/@aws-cdk/aws-synthetics/test/integ.canary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ new synthetics.Canary(stack, 'MyCanary', {
}),
schedule: synthetics.Schedule.rate(cdk.Duration.minutes(1)),
artifactsBucketLocation: { bucket, prefix },
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
});

new synthetics.Canary(stack, 'MyCanaryOne', {
Expand All @@ -40,7 +40,7 @@ new synthetics.Canary(stack, 'MyCanaryOne', {
handler: 'canary.handler',
code: synthetics.Code.fromAsset(path.join(__dirname, 'canaries')),
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
enableAutoDeleteLambdas: true,
});

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

new synthetics.Canary(stack, 'MyCanaryThree', {
Expand All @@ -59,7 +59,7 @@ new synthetics.Canary(stack, 'MyCanaryThree', {
handler: 'canary.handler',
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary.zip')),
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
});

new synthetics.Canary(stack, 'MyCanaryFour', {
Expand All @@ -68,7 +68,7 @@ new synthetics.Canary(stack, 'MyCanaryFour', {
handler: 'canary.handler',
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary.zip')),
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
});

new synthetics.Canary(stack, 'MyCanaryRuntime38', {
Expand All @@ -77,7 +77,7 @@ new synthetics.Canary(stack, 'MyCanaryRuntime38', {
handler: 'canary.handler',
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary.zip')),
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
});

new synthetics.Canary(stack, 'MyPythonCanary', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@
]
},
"Name": "canary-vpc",
"RuntimeVersion": "syn-nodejs-puppeteer-3.8",
"RuntimeVersion": "syn-nodejs-puppeteer-3.9",
"Schedule": {
"DurationInSeconds": "0",
"Expression": "rate(5 minutes)"
Expand Down Expand Up @@ -674,4 +674,4 @@
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@
]
},
"name": "canary-vpc",
"runtimeVersion": "syn-nodejs-puppeteer-3.8",
"runtimeVersion": "syn-nodejs-puppeteer-3.9",
"schedule": {
"durationInSeconds": "0",
"expression": "rate(5 minutes)"
Expand Down Expand Up @@ -1057,4 +1057,4 @@
"version": "0.0.0"
}
}
}
}