Hello I need some help, can I somehow get the secu...
# general
r
Hello I need some help, can I somehow get the security group ID from the group name, I am trying to create multiple SGs from a single file using
Copy code
aws.ec2.SecurityGroupRule
this leads me to a problem where the newly created groups cannot be referenced in other groups using the name. The field
Copy code
security_group_id
expects a sg id. Not sure how I can get that dynamically . Thanks
a
You need to "get" the security group and then you can get the id. One of these should help, probably the first one: • https://www.pulumi.com/docs/reference/pkg/aws/ec2/getsecuritygroup/https://www.pulumi.com/docs/reference/pkg/aws/ec2/getsecuritygroups/
r
Thanks