Skip to content

Conversation

@dlutsch
Copy link
Contributor

@dlutsch dlutsch commented Dec 5, 2025

What type of PR is this?

cleanup

Which issue does this PR fix:

N/A - Defensive improvement for RAM-shared service network support.

What does this PR do / Why do we need it:

Adds validation in findServiceNetworkViaVPCAssociation() to check that CLUSTER_VPC_ID environment variable is set before attempting AWS VPC Lattice API calls.

Problem: The function uses config.VpcID in AWS API calls without validating it's set. When misconfigured, this results in cryptic errors or silent failures, making debugging difficult.

Solution: Fail fast with clear error message when CLUSTER_VPC_ID is not configured.

If an issue # is not available please add repro steps and logs from aws-gateway-controller showing the issue:

Without This Fix

When CLUSTER_VPC_ID is not set:

Error: VPC Lattice Service Network not found

User doesn't know if it's:

  • Permissions issue
  • RAM sharing problem
  • Configuration problem
  • Network doesn't exist

With This Fix

Error: cannot discover RAM-shared service networks: CLUSTER_VPC_ID environment variable is not set

Clear, actionable error message.

Testing done on this change:

Validated in sandbox cluster with RAM-shared service networks:

  1. With CLUSTER_VPC_ID set: Function works correctly, discovers RAM-shared networks
  2. Without CLUSTER_VPC_ID (simulated): Would now get clear error message

This is defensive code - doesn't change happy path behavior.

Automation added to e2e:

No - This is defensive validation for error handling. The RAM discovery feature is covered by tests added in the main RAM support PR (already merged).

Will this PR introduce any new dependencies?:

No - Pure defensive validation.

Will this break upgrades or downgrades. Has updating a running cluster been tested?:

  • Upgrades: Safe - only adds validation
  • Downgrades: Safe - just removes validation
  • Tested: Yes, deployed to sandbox with RAM-shared networks working correctly

Does this PR introduce any user-facing change?:

No user-facing change for correctly configured deployments. Only improves error messages for misconfigurations.

Improves error messaging for RAM service network discovery when CLUSTER_VPC_ID is not configured.

Do all end-to-end tests successfully pass when running make e2e-test?:

Not run - this is a 5-line defensive validation addition that doesn't change functional behavior. Existing RAM discovery tests pass with this change.

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

Dan Lutsch and others added 2 commits December 5, 2025 13:08
Adds validation in findServiceNetworkViaVPCAssociation() to ensure
CLUSTER_VPC_ID environment variable is set before attempting to list
VPC-to-Service Network associations.

Provides clear error message when configuration is missing, making
debugging easier for RAM-shared service network deployments.
@SinghVikram97 SinghVikram97 added this pull request to the merge queue Dec 5, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 5, 2025
@SinghVikram97 SinghVikram97 added this pull request to the merge queue Dec 6, 2025
Merged via the queue into aws:main with commit c75447a Dec 6, 2025
2 checks passed
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.

2 participants