Describe the bug
When looking up for a shared VPC with:
vpc = ec2.Vpc.from_lookup(self, "VPC", vpc_id=shared_vpc_id)
and then reading the vpc_arn
Instead of having the correct ARN like arn:aws:ec2:eu-west-1:YYYYYYYY:vpc/vpc-1234567890 where YYYYYY should be the account owning the VPC, I get arn:aws:ec2:eu-west-1:XXXXXXXX:vpc/vpc-1234567890, where XXXXX is the account where I am trying to deploy my stack.
Expected Behavior
I would expect that the attrivute vpc_arn would return the correct VPC ARN referring to the owning account.
Current Behavior
The stack refers to a wrong ARN.
Reproduction Steps
- Share a VPC from account Y to account X
- In account X try to deploy a CDK stack where
-
- This VPC is retrieve with
ec2.Vpc.from_lookup(self, "VPC", vpc_id=shared_vpc_id)
-
- Add a iam role policy where the resource is
vpc.vpc_arn
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.61.1 (build d319d9c)
Framework Version
No response
Node.js Version
v16.17.0
OS
MacOS
Language
Python
Language Version
Python 3.9.13
Other information
No response
Describe the bug
When looking up for a shared VPC with:
and then reading the vpc_arn
Instead of having the correct ARN like
arn:aws:ec2:eu-west-1:YYYYYYYY:vpc/vpc-1234567890where YYYYYY should be the account owning the VPC, I getarn:aws:ec2:eu-west-1:XXXXXXXX:vpc/vpc-1234567890, where XXXXX is the account where I am trying to deploy my stack.Expected Behavior
I would expect that the attrivute
vpc_arnwould return the correct VPC ARN referring to the owning account.Current Behavior
The stack refers to a wrong ARN.
Reproduction Steps
ec2.Vpc.from_lookup(self, "VPC", vpc_id=shared_vpc_id)vpc.vpc_arnPossible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.61.1 (build d319d9c)
Framework Version
No response
Node.js Version
v16.17.0
OS
MacOS
Language
Python
Language Version
Python 3.9.13
Other information
No response