Skip to content

Sort VPCConfig fields in live manifest and enhance tests#6535

Open
rishichirchi wants to merge 1 commit intopipe-cd:masterfrom
rishichirchi:fix/lambda-diff-fix
Open

Sort VPCConfig fields in live manifest and enhance tests#6535
rishichirchi wants to merge 1 commit intopipe-cd:masterfrom
rishichirchi:fix/lambda-diff-fix

Conversation

@rishichirchi
Copy link

@rishichirchi rishichirchi commented Feb 17, 2026

What this PR does / why we need it:

Fix false drift detection for Lambda applications with VPC configuration.

In PR #5254, the same subnet ordering problem was fixed for ECS drift detection by sorting subnets on both the live state and head spec sides.
However, this fix was never applied to Lambda drift detection.

The ignoreAndSortParameters function only sorted headSpec.VPCConfig.SubnetIDs (Git side), and the comment claimed "Lambda sorts them in liveSpec" but the AWS Lambda API does not guarantee any specific ordering of SubnetIDs or SecurityGroupIDs. This caused false drift detection when the ordering returned by AWS didn't match the user's manifest.

This fix:

  • Adds sortLiveManifestParameters() to sort SubnetIDs and SecurityGroupIDs on the live (AWS) side before comparison, consistent with the ECS fix in Sort subnet in live manifest of ECS Drift Detection #5254
  • Also sorts SecurityGroupIDs on the head (Git) side, which was previously not sorted at all
  • Adds test coverage for the new sortLiveManifestParameters function and for SecurityGroupIDs sorting

Which issue(s) this PR fixes:

Fixes #6529

Does this PR introduce a user-facing change?:

  • How are users affected by this change: Lambda applications with VPC configuration will no longer show false OUT_OF_SYNC status caused by inconsistent ordering of SubnetIDs and SecurityGroupIDs between the user's manifest and the AWS Lambda API response.
  • Is this breaking change: No

@rishichirchi rishichirchi marked this pull request as ready for review February 17, 2026 07:08
@rishichirchi rishichirchi requested a review from a team as a code owner February 17, 2026 07:08
Signed-off-by: Rishi Chirchi <rishiraj.chirchi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lambda drift detection: SubnetIDs comparison fails due to inconsistent sorting

1 participant