(aws-ec2): securityGroupName
returns id of sg and not name
#13774
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
good first issue
Related to contributions. See CONTRIBUTING.md
p1
The
securityGroupName
property is documented asUnfortunately, it can return the ID of the security group, and not the name, (depending on how the security group is created?)
Reproduction Steps
What did you expect to happen?
I expected the
AWS_SECURITY_GROUP
environment variable passed to my fargate task's container to contain the valuemy-security-group
.What actually happened?
It contained the security group id, (starting
sg-
).Environment
Other
Looking at the relevant part of cloudformation generated,
and the implementation.
aws-cdk/packages/@aws-cdk/aws-ec2/lib/security-group.ts
Line 412 in 2fed1e1
I think the issue is perhaps a cloud formation limitation and related to me creating the security group with the
vpc
attribute.From https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html
P.S. I'm new to both CDK and typescript/javascript, so apologies if I've messed something up.
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: