Skip to content

CCM-22077: Adding replace SG on delete to Lambda - #239

Open
aidenvaines-cgi wants to merge 1 commit into
mainfrom
CCM-22077_AddingLambdaReplaceSgOnDelete
Open

CCM-22077: Adding replace SG on delete to Lambda#239
aidenvaines-cgi wants to merge 1 commit into
mainfrom
CCM-22077_AddingLambdaReplaceSgOnDelete

Conversation

@aidenvaines-cgi

@aidenvaines-cgi aidenvaines-cgi commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Description

adding replace_security_groups_on_destroy to Lambda module

Context

Fixes (i hope) lambda taking AAAAAAGES to destroy lambda functions if in a VPC
Without replacement:

Lambda is deleted.
AWS-managed VPC ENIs for that Lambda can linger for up to 45 minutes -> ENIs still reference the Lambda SG -> SG delete blocked

With replace_security_groups_on_destroy:

Terraform updates the Lambda first, swapping its VPC security groups to a different set.
New or surviving ENIs attach to the replacement group, not the original one.
The original security group is now decoupled from active Lambda networking sooner.
Terraform can delete the old group much earlier, reducing long in-use waits.

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@aidenvaines-cgi
aidenvaines-cgi requested a review from a team as a code owner August 10, 2026 14:33
@aidenvaines-cgi aidenvaines-cgi changed the title CCM-22077 Adding replace SG on delete to Lambda CCM-22077: Adding replace SG on delete to Lambda Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants