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

AWS Exposed VPC endpoints plugin doesn't properly detect private subnets #1856

Open
alFReD-NSH opened this issue Jan 17, 2024 · 0 comments
Open

Comments

@alFReD-NSH
Copy link

alFReD-NSH commented Jan 17, 2024

On my environment VPC endpoints are placed in private subnets where transit gateway is used to route to VPCs and "Exposed VPC endpoints" plugin doesn't recognise the subnets as private subnets even though it doesn't have an internet gateway attached.

I believe the issue is in this utility function:

routeTable.Routes.every(route => route.GatewayId && !route.GatewayId.startsWith('igw-'))) privateRouteTables.push(routeTable.RouteTableId);

It requires every route to have a "GatewayId" for it to a private subnet however, the routes can point to a NatGateway or TransitGateway and still be private.

The code should be something like this instead:

if (routeTable.RouteTableId && routeTable.Routes && !routeTable.Routes.some(route => route.GatewayId && route.GatewayId.startsWith('igw-')) privateRouteTables.push(routeTable.RouteTableId);
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

No branches or pull requests

1 participant