polite-napkin-90098
04/14/2021, 7:09 PMprivateSg.Id undefined (type *ec2.SecurityGroup has no field or method Id)
I feel there's something really simple I'm missing here.func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Read in some ENV, which will be the branch name eventually
branch := os.Getenv("BRANCH")
// Read back the Test VPC and public subnets
v := "vpc-###############"
vpc, err := ec2.LookupVpc(ctx, &ec2.LookupVpcArgs{Id: &v})
if err != nil {
return err
}
privateSg, err := ec2.NewSecurityGroup(ctx, "Test-" + branch + "-priv", &ec2.SecurityGroupArgs{
VpcId: pulumi.String(vpc.Id),
})
if err != nil{
return err
}
ctx.Export("sg", privateSg.Id)
return nil
})
}
witty-candle-66007
04/14/2021, 8:05 PMprivateSg.ID
I noticed in this example: https://github.com/pulumi/examples/blob/master/aws-go-webserver/main.go
ID
is used to reference the sg id.polite-napkin-90098
04/14/2021, 8:14 PM./main.go:121:29: cannot use privateSg.CustomResourceState.ID (type func() pulumi.IDOutput) as type pulumi.Input in argument to ctx.Export:
func() pulumi.IDOutput does not implement pulumi.Input (missing ElementType method)
group.ID()
not group.ID
it seems