Skip to content

Commit

Permalink
fix(lambda): deprecate Python3.6 (aws#19988)
Browse files Browse the repository at this point in the history
Move all automatic Custom Resources to the newest Python version, update
integ tests, add a note to the Lambda Runtime that it shouldn't be used
anymore.

Change all Python3.6 -> Python 3.9.

Fixes aws#20085.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
rix0rrr committed Jun 7, 2022
1 parent ab33348 commit 9602229
Show file tree
Hide file tree
Showing 212 changed files with 1,039 additions and 1,560 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@
}
},
"Handler": "index.lambda_handler",
"Runtime": "python3.6",
"Runtime": "python3.9",
"Tags": [
{
"Key": "Name",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"17.0.0"}
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "18.0.0",
"version": "20.0.0",
"testCases": {
"aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service": {
"@aws-cdk/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service": {
"stacks": [
"aws-ecs-integ"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.0",
"version": "20.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@
}
},
"handler": "index.lambda_handler",
"runtime": "python3.6",
"runtime": "python3.9",
"tags": [
{
"key": "Name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@
}
},
"Handler": "index.lambda_handler",
"Runtime": "python3.6",
"Runtime": "python3.9",
"Tags": [
{
"Key": "Name",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"17.0.0"}
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "18.0.0",
"version": "20.0.0",
"testCases": {
"aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.lit": {
"@aws-cdk/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.lit": {
"stacks": [
"aws-ecs-integ-ecs"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.0",
"version": "20.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@
}
},
"handler": "index.lambda_handler",
"runtime": "python3.6",
"runtime": "python3.9",
"tags": [
{
"key": "Name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class InstanceDrainHook extends CoreConstruct {
const fn = new lambda.Function(this, 'Function', {
code: lambda.Code.fromInline(fs.readFileSync(path.join(__dirname, 'lambda-source', 'index.py'), { encoding: 'utf-8' })),
handler: 'index.lambda_handler',
runtime: lambda.Runtime.PYTHON_3_6,
runtime: lambda.Runtime.PYTHON_3_9,
// Timeout: some extra margin for additional API calls made by the Lambda,
// up to a maximum of 15 minutes.
timeout: cdk.Duration.seconds(Math.min(drainTime.toSeconds() + 10, 900)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@
}
},
"Handler": "index.lambda_handler",
"Runtime": "python3.6",
"Runtime": "python3.9",
"Tags": [
{
"Key": "Name",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"17.0.0"}
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "18.0.0",
"version": "20.0.0",
"testCases": {
"aws-ecs/test/ec2/integ.app-mesh-proxy-config": {
"@aws-cdk/aws-ecs/test/ec2/integ.app-mesh-proxy-config": {
"stacks": [
"aws-ecs-integ"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.0",
"version": "20.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@
}
},
"handler": "index.lambda_handler",
"runtime": "python3.6",
"runtime": "python3.9",
"tags": [
{
"key": "Name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@
}
},
"Handler": "index.lambda_handler",
"Runtime": "python3.6",
"Runtime": "python3.9",
"Tags": [
{
"Key": "Name",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"17.0.0"}
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "18.0.0",
"version": "20.0.0",
"testCases": {
"aws-ecs/test/ec2/integ.bottlerocket": {
"@aws-cdk/aws-ecs/test/ec2/integ.bottlerocket": {
"stacks": [
"aws-ecs-integ-bottlerocket"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.0",
"version": "20.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@
}
},
"handler": "index.lambda_handler",
"runtime": "python3.6",
"runtime": "python3.9",
"tags": [
{
"key": "Name",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"17.0.0"}
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@
}
},
"Handler": "index.lambda_handler",
"Runtime": "python3.6",
"Runtime": "python3.9",
"Tags": [
{
"Key": "Name",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "18.0.0",
"version": "20.0.0",
"testCases": {
"aws-ecs/test/ec2/integ.capacity-provider": {
"@aws-cdk/aws-ecs/test/ec2/integ.capacity-provider": {
"stacks": [
"integ-ec2-capacity-provider"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.0",
"version": "20.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@
}
},
"handler": "index.lambda_handler",
"runtime": "python3.6",
"runtime": "python3.9",
"tags": [
{
"key": "Name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@
}
},
"Handler": "index.lambda_handler",
"Runtime": "python3.6",
"Runtime": "python3.9",
"Tags": [
{
"Key": "Name",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"17.0.0"}
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "18.0.0",
"version": "20.0.0",
"testCases": {
"aws-ecs/test/ec2/integ.clb-host-nw": {
"@aws-cdk/aws-ecs/test/ec2/integ.clb-host-nw": {
"stacks": [
"aws-ecs-integ"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.0",
"version": "20.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@
}
},
"handler": "index.lambda_handler",
"runtime": "python3.6",
"runtime": "python3.9",
"tags": [
{
"key": "Name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@
}
},
"Handler": "index.lambda_handler",
"Runtime": "python3.6",
"Runtime": "python3.9",
"Tags": [
{
"Key": "Name",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"17.0.0"}
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "18.0.0",
"version": "20.0.0",
"testCases": {
"aws-ecs/test/ec2/integ.cloudmap-container-port": {
"@aws-cdk/aws-ecs/test/ec2/integ.cloudmap-container-port": {
"stacks": [
"aws-ecs-integ"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.0",
"version": "20.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@
}
},
"handler": "index.lambda_handler",
"runtime": "python3.6",
"runtime": "python3.9",
"tags": [
{
"key": "Name",
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@
}
},
"Handler": "index.lambda_handler",
"Runtime": "python3.6",
"Runtime": "python3.9",
"Tags": [
{
"Key": "Name",
Expand Down Expand Up @@ -1186,7 +1186,7 @@
"Properties": {
"Content": {
"S3Bucket": {
"Ref": "AssetParameters01e9cf93416a1f67b17dad851459445bdaaafcc2f3ab4390c03984fd57b2f476S3BucketC0D91AC4"
"Ref": "AssetParameters8ad7bbf8be94e05d569da95ddb82511dcc959f25054825394cbb86028ccd1b6aS3Bucket16472AE2"
},
"S3Key": {
"Fn::Join": [
Expand All @@ -1199,7 +1199,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters01e9cf93416a1f67b17dad851459445bdaaafcc2f3ab4390c03984fd57b2f476S3VersionKey26CFD1B0"
"Ref": "AssetParameters8ad7bbf8be94e05d569da95ddb82511dcc959f25054825394cbb86028ccd1b6aS3VersionKeyFAAA537A"
}
]
}
Expand All @@ -1212,7 +1212,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters01e9cf93416a1f67b17dad851459445bdaaafcc2f3ab4390c03984fd57b2f476S3VersionKey26CFD1B0"
"Ref": "AssetParameters8ad7bbf8be94e05d569da95ddb82511dcc959f25054825394cbb86028ccd1b6aS3VersionKeyFAAA537A"
}
]
}
Expand Down Expand Up @@ -1537,17 +1537,17 @@
"Type": "String",
"Description": "Artifact hash for asset \"be270bbdebe0851c887569796e3997437cca54ce86893ed94788500448e92824\""
},
"AssetParameters01e9cf93416a1f67b17dad851459445bdaaafcc2f3ab4390c03984fd57b2f476S3BucketC0D91AC4": {
"AssetParameters8ad7bbf8be94e05d569da95ddb82511dcc959f25054825394cbb86028ccd1b6aS3Bucket16472AE2": {
"Type": "String",
"Description": "S3 bucket for asset \"01e9cf93416a1f67b17dad851459445bdaaafcc2f3ab4390c03984fd57b2f476\""
"Description": "S3 bucket for asset \"8ad7bbf8be94e05d569da95ddb82511dcc959f25054825394cbb86028ccd1b6a\""
},
"AssetParameters01e9cf93416a1f67b17dad851459445bdaaafcc2f3ab4390c03984fd57b2f476S3VersionKey26CFD1B0": {
"AssetParameters8ad7bbf8be94e05d569da95ddb82511dcc959f25054825394cbb86028ccd1b6aS3VersionKeyFAAA537A": {
"Type": "String",
"Description": "S3 key for asset version \"01e9cf93416a1f67b17dad851459445bdaaafcc2f3ab4390c03984fd57b2f476\""
"Description": "S3 key for asset version \"8ad7bbf8be94e05d569da95ddb82511dcc959f25054825394cbb86028ccd1b6a\""
},
"AssetParameters01e9cf93416a1f67b17dad851459445bdaaafcc2f3ab4390c03984fd57b2f476ArtifactHash0FB7E57C": {
"AssetParameters8ad7bbf8be94e05d569da95ddb82511dcc959f25054825394cbb86028ccd1b6aArtifactHash08E93340": {
"Type": "String",
"Description": "Artifact hash for asset \"01e9cf93416a1f67b17dad851459445bdaaafcc2f3ab4390c03984fd57b2f476\""
"Description": "Artifact hash for asset \"8ad7bbf8be94e05d569da95ddb82511dcc959f25054825394cbb86028ccd1b6a\""
},
"AssetParametersf98b78092dcdd31f5e6d47489beb5f804d4835ef86a8085d0a2053cb9ae711daS3BucketF23C0DE7": {
"Type": "String",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"17.0.0"}
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "18.0.0",
"version": "20.0.0",
"testCases": {
"aws-ecs/test/ec2/integ.environment-file": {
"@aws-cdk/aws-ecs/test/ec2/integ.environment-file": {
"stacks": [
"aws-ecs-integ"
],
Expand Down
Loading

0 comments on commit 9602229

Please sign in to comment.