Skip to content

fix: remove unnecessary VPC endpoints for RDS connections#3449

Open
Simone319 wants to merge 1 commit intomainfrom
fix/remove-unnecessary-vpc-endpoints
Open

fix: remove unnecessary VPC endpoints for RDS connections#3449
Simone319 wants to merge 1 commit intomainfrom
fix/remove-unnecessary-vpc-endpoints

Conversation

@Simone319
Copy link
Copy Markdown
Contributor

Description

Only the SSM VPC endpoint is needed for Lambda to retrieve database credentials from Parameter Store. The other 4 endpoints (ssmmessages, ec2, ec2messages, kms) are created but never referenced in the code, costing customers ~$350/year per AZ.

Changes

  • Removed unnecessary VPC endpoint services from the services array in resolver.ts
  • Only ssm endpoint is retained (the only one actually used by the Lambda function)
  • Updated e2e test assertions to expect the removed endpoints are no longer present

Technical Details

The code at resolver.ts only extracts the SSM DNS entry:

const endpointEntries = endpoints.find((endpoint) => endpoint.service === 'ssm')?.endpoint.attrDnsEntries;

The other 4 services (ssmmessages, ec2messages, ec2, kms) are for SSM Agent on EC2, not for Parameter Store access from Lambda.

Cost Impact

  • Each VPC endpoint costs $0.01/hour per AZ
  • Removing 4 unnecessary endpoints saves $350.40/year (1 AZ) to $1,051.20/year (3 AZ)

Testing

  • Verified only SSM endpoint DNS is passed to Lambda environment
  • Existing unit test suite passes (all failures are pre-existing due to unbuilt monorepo deps)
  • Previously validated by @Epolon (removing all endpoints except SSM — Lambda executed successfully)

Fixes #3409
Related: T.corp P371007397

Only the SSM VPC endpoint is needed for Lambda to access Parameter Store.
The other 4 endpoints (ssmmessages, ec2, ec2messages, kms) are never used
by the code but cost customers ~$350/year per AZ.

Fixes #3409
@Simone319 Simone319 requested a review from a team as a code owner March 26, 2026 14:25
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.

Remove unnecessary VPC endpoints created with SQL schemas

1 participant