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(autoscaling): support custom termination policy with lambda #29340

Merged
merged 1 commit into from Mar 4, 2024

Conversation

godwingrs22
Copy link
Member

@godwingrs22 godwingrs22 commented Mar 1, 2024

Issue # (if applicable)

Closes #19750.

Reason for this change

Amazon EC2 autoscaling supports custom termination policy using lambda to terminate instances, but it is not supported yet by the aws-autoscaling package.

Description of changes

This code change adds an enum TerminationPolicy.CUSTOM_LAMBDA_FUNCTION and an optional terminationPolicyCustomLambdaFunctionArn property to pass the lambda arn.

The change involves the logic to check If there are multiple termination policies specified since lamba termination policy has to be first in order.

Description of how you validated changes

Added unit tests and integration test.
Created a simple CDK application with the updated constructs and verified that it synthesized and deployed correctly.

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 effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1 labels Mar 1, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team March 1, 2024 20:14
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Mar 1, 2024
@paulhcsun paulhcsun changed the title feat(autoscaling): support custom termination policy with lambda feat(autoscaling): support custom termination policy with lambda . Mar 1, 2024
@paulhcsun paulhcsun changed the title feat(autoscaling): support custom termination policy with lambda . feat(autoscaling): support custom termination policy with lambda Mar 1, 2024
@godwingrs22 godwingrs22 force-pushed the godwingrs22/custometerminalpolicy branch from bc01697 to 4ebbe8c Compare March 1, 2024 22:33
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Mar 1, 2024
@godwingrs22 godwingrs22 force-pushed the godwingrs22/custometerminalpolicy branch from f434bee to 4458a4f Compare March 4, 2024 22:23
@godwingrs22 godwingrs22 force-pushed the godwingrs22/custometerminalpolicy branch from 4458a4f to 8c93a48 Compare March 4, 2024 22:26
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Copy link
Contributor

mergify bot commented Mar 4, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 2ebb409 into aws:main Mar 4, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1 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.

AutoScaling: Support Custom Termination Policies (Lambda)
3 participants