https://pulumi.com logo
Title
r

rapid-keyboard-69273

12/10/2021, 5:07 PM
Heelo, I created successfully a VPC using const vpc = new awsx.ec2.Vpc.....how I can retrieve the default securitygroup Id..?...thanks
g

great-queen-39697

12/10/2021, 10:12 PM
Are you looking to get the security group that's part of your new VPC, or a generic default that would have gotten created with a default VPC? If you're looking for the existing one, I think you want https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/awsx/ec2/#SecurityGroup-fromExistingId
r

rapid-keyboard-69273

12/11/2021, 8:35 AM
Hello Laura. I'm looking for the default securitygroup of the new created VPC. Thanks so much.
g

great-queen-39697

12/13/2021, 4:08 PM
Gotcha; you'll want that call I posted, then
r

rapid-keyboard-69273

12/14/2021, 8:37 AM
Hi Laura. As I see the suggested call requires to know the securitygroup ID and I don't know how to retrieve it from new created VPC. Any idea and/or suggestions...?..thanks a lot.
Probably I find the solution. If the new created VPC is called i.e. myvpc, then 'myvpc.vpc.defaultSecurityGroupId;' return the default securitygroup ID. Thanks very much for your contribute. Francesco
👍 1