ec2: Unable to use imported interface VPC endpoint in another stack #30507
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
bug
This issue is a bug.
closing-soon
This issue will automatically close in 4 days unless further comments are made.
effort/small
Small work item – less than a day of effort
p3
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the bug
I am using two stacks. In one of them, I import the VPC endpoint if it already exists, and if not, I create a new one. Then I create a new stack in which I want to deploy a Private API Gateway, which needs to be provided with the VPC endpoint.
vps-stack.ts
bin/app.ts
application-stack.ts (api gateway part)
The problem is that if I import the resource from the same stack where the API Gateway is created, everything works, but if these are different stacks, I get an error.
Error:
CDK synth fine If i will import VPC endpoint in the same stack, like in this the way:
Expected Behavior
Import interface VPC endpoint in one Stack and use it for Private API Gateway in another stack should work.
Current Behavior
The problem is that if I import the resource from the same stack where the API Gateway is created, everything works, but if these are different stacks, I get an error.
Error:
Reproduction Steps
Create two stacks.
First contain
Second contain
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.145.0
Framework Version
No response
Node.js Version
v22.2.0
OS
Mac
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: