Skip to content

chore(ecs): update instance-drain-hook lambda runtime to python 3.13 (closes #34634) #34639

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

its-felix
Copy link

@its-felix its-felix commented Jun 5, 2025

Issue # (if applicable)

Closes #34634.

Reason for this change

The old Lambda Runtime Python 3.9 is being deprecated

Description of changes

Describe any new or updated permissions being added

None

Description of how you validated changes

(cd packages/aws-cdk-lib && yarn test aws-ecs)

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Jun 5, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team June 5, 2025 16:40
@github-actions github-actions bot added feature-request A feature should be added or improved. p2 labels Jun 5, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@its-felix its-felix force-pushed the 34634-AwsEcsDrainHookLambdaRuntime branch from 8f21b05 to be8acfd Compare June 5, 2025 17:02
@its-felix its-felix changed the title feat(aws-ecs): update instance-drain-hook lambda runtime to python 3.13 (closes #34634) chore(aws-ecs): update instance-drain-hook lambda runtime to python 3.13 (closes #34634) Jun 5, 2025
@its-felix its-felix changed the title chore(aws-ecs): update instance-drain-hook lambda runtime to python 3.13 (closes #34634) chore(ecs): update instance-drain-hook lambda runtime to python 3.13 (closes #34634) Jun 5, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review June 5, 2025 17:04

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@its-felix its-felix marked this pull request as ready for review June 5, 2025 17:06
@its-felix its-felix force-pushed the 34634-AwsEcsDrainHookLambdaRuntime branch 3 times, most recently from 142d99f to 0b257dd Compare June 6, 2025 21:57
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 6, 2025
@its-felix its-felix force-pushed the 34634-AwsEcsDrainHookLambdaRuntime branch from 0b257dd to a257b45 Compare June 10, 2025 23:14
Copy link
Contributor

@laurelmay laurelmay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making this update!

@its-felix its-felix force-pushed the 34634-AwsEcsDrainHookLambdaRuntime branch from a257b45 to 4294dcd Compare June 18, 2025 15:26
@aws-cdk-automation aws-cdk-automation added pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Jun 18, 2025
@its-felix its-felix force-pushed the 34634-AwsEcsDrainHookLambdaRuntime branch from 4294dcd to 0ee8344 Compare June 24, 2025 02:34
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 0ee8344
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@Abogical Abogical self-assigned this Jul 4, 2025
Copy link
Member

@Abogical Abogical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! I'm requesting a small change to it.

@@ -11,7 +11,7 @@ def lambda_handler(event, context):
lifecycle_event = json.loads(event['Records'][0]['Sns']['Message'])
instance_id = lifecycle_event.get('EC2InstanceId')
if not instance_id:
print('Got event without EC2InstanceId: %s', json.dumps(dict(event, ResponseURL='...')))
print('Got event without EC2InstanceId: %s' % json.dumps(dict(event, ResponseURL='...')))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use f-strings since we're using python 3.13?

Suggested change
print('Got event without EC2InstanceId: %s' % json.dumps(dict(event, ResponseURL='...')))
print(f"Got event without EC2InstanceId: { json.dumps(dict(event, ResponseURL='...')) }")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK feature-request A feature should be added or improved. p2 pr/needs-maintainer-review This PR needs a review from a Core Team Member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-ecs: Update Lambda Runtime Version for instance-drain-hook.ts
4 participants