-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Adding VPC Gateway Endpoint to VPC created fromLookup fails #3472
Comments
|
This is because gateway endpoints need route table ids and those were not available on imported VPCs when the feature was added (#2104). I can maybe have a look at this. |
Still having a problem when trying to add a gateway endpoint to a VPC that was imported using "vpc.fromLookup". CDK 1.84, MacOS BigSur, Node 12.18.3. |
I'm observing the same for CDK 1.102.0, Amazon Linux 2, Node v14.17.0 Has anybody found a fix for this? |
Get exactly the same error even when the vpc is not imported. |
For what is worth, in my case it helped when I deleted cdk.context.json. |
In my scenario multiple subnets are sharing the same route table and this causes the gateway endpoint creation to fail. Using cfn resource solves the issue |
I'm running into this issue with an imported VPC ( const vpc = Vpc.fromLookup(stack, ResourceIds.VPC.for(vpcName), {
vpcName,
});
const interfaceServices = {
ecr: InterfaceVpcEndpointAwsService.ECR,
"ecr-dkr": InterfaceVpcEndpointAwsService.ECR_DOCKER,
"ssm-messages": InterfaceVpcEndpointAwsService.SSM_MESSAGES,
logs: InterfaceVpcEndpointAwsService.CLOUDWATCH_LOGS,
};
const gatewayServices = {
"s3-gateway": GatewayVpcEndpointAwsService.S3,
};
Object
.entries(interfaceServices)
.forEach(([ name, service ]) => vpc.addInterfaceEndpoint(ResourceIds.VpcEndpoint.for(name), {
service,
subnets: {
subnets,
},
securityGroups: [
stack.securityGroups.vpcEndpoints,
],
}));
Object
.entries(gatewayServices)
.forEach(([ name, service ]) => vpc.addGatewayEndpoint(ResourceIds.VpcEndpoint.for(name), {
service,
subnets: [ {
subnets,
} ],
})); |
Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.
I'm submitting a ...
What is the current behavior?
If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce
Adding a VPC gateway type endpoint to a VPC referenced by Vpc.fromLookup fails with
AttributeError: '_IVpcProxy' object has no attribute 'add_gateway_endpoint'
Python code;
Similar error message using
vpc. add_s3_endpoint()
.though ,
is successful.
What is the expected behavior (or behavior of feature suggested)?
What is the motivation / use case for changing the behavior or adding this feature?
Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)
The text was updated successfully, but these errors were encountered: