Repository navigation
ECS Cluster ASG drain hook uses deprecated Python 3.9 runtime #35813
Replies: 1 comment
|
Here is the situation regarding this Lambda runtime and how to address it immediately in your stacks: 1. CDK v1 End-of-Life (EOL) NoticeNotice that the GitHub URL referenced in your report points to the AWS CDK v1 officially reached End-of-Life on June 1, 2023. Per AWS policy, the CDK team does not backport new Lambda runtimes or maintenance updates to the In AWS CDK v2 ( 2. Immediate Fix via Escape Hatch / Aspect (No CDK Upgrade Needed)If your team is in the process of upgrading CDK versions and needs to eliminate the deprecated You can use an Aspect to override the underlying import * as cdk from 'aws-cdk-lib';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import { IConstruct } from 'constructs';
class UpgradeDrainHookRuntime implements cdk.IAspect {
visit(node: IConstruct): void {
if (node instanceof lambda.CfnFunction) {
if (node.runtime === 'python3.9') {
node.runtime = 'python3.12'; // or 'python3.11'
}
}
}
}
// Apply to your Stack or App:
cdk.Aspects.of(app).add(new UpgradeDrainHookRuntime());Because the Python Lambda handler code in the drain hook relies only on standard AWS SDK calls ( 3. Recommended Path: Upgrade to AWS CDK v2 (
|
Uh oh!
There was an error while loading. Please reload this page.
The ECS Cluster Auto Scaling Group (ASG) drain hook defined in instance-drain-hook.ts currently uses the Python 3.9 runtime.
https://github.com/aws/aws-cdk/blob/v1-main/packages/%40aws-cdk/aws-ecs/lib/drain-hook/instance-drain-hook.ts#L70
However, AWS has announced that Python 3.9 will soon be deprecated and no longer supported in Lambda. To ensure future compatibility and avoid potential disruptions, this runtime should be updated to a supported version.
Thank you,
Naqqash Khan
All reactions