Security Group Id: sg-12345 not found #21485
Replies: 3 comments
-
I'm guessing it's related to this dummy SG value in CDK. You may have a dependency issue and need to make some resource dependent on the security group in question so that the security group ID can be resolved. |
Beta Was this translation helpful? Give feedback.
-
Method Can you please describe your use case so we can see which of those methods is correct? Can you share the code for a minimum example where the issue occurs? (using |
Beta Was this translation helpful? Give feedback.
-
You can use |
Beta Was this translation helpful? Give feedback.
-
I was trying to import an existing Security Group in CDK by using SecurityGroup.fromSecurityGroupId method and it failed with the following error:
Security Group Id: sg-12345 not found! (Service: AmazonEC2; Status Code: 400; Error Code: InvalidGroup.NotFound; Request ID: 8e2cd924-075d-4c64-b5ba-2e1d9c72fe95; Proxy: null)
Below is my CDK code:
const sg = SecurityGroup.fromSecurityGroupId(this, 'sgFromLookUp', 'sg-084c533df9d662439');
I double checked that the security group id is correct, I also tried the other 2 methods for security group look up:
SecurityGroup.fromLookupById()
SecurityGroup.fromLookupByName()
All of them returned the same error, any ideas why?
Beta Was this translation helpful? Give feedback.
All reactions