narrow-action-47255
07/27/2021, 4:03 PMVpcId
in the &ec2.SubnetArgs{}
and I'm not finding examples. The examples I have found in Go illustrate looking up an existing VPC, where other languages show the exact example I'm trying to accomplish. Example code follows. I have tried using different things for VpcId
such as platformVpc.ID()
(which is what I would use in ctx.Export()
) and messed with ApplyT
a bit, but I can't seem to figure out how to convert it to a string. Any help would be greatly appreciated!
// Create VPC
platformVpc, err := ec2.NewVpc(ctx, "my-awesome-vpc", &ec2.VpcArgs{
CidrBlock: pulumi.String("10.99.0.0/16"),
})
if err != nil {
return err
}
platformVpcSubnetA, err := ec2.NewSubnet(ctx, "my-awesome-subnet-a", &ec2.SubnetArgs{
VpcId: pulumi.String("I DON'T KNOW WHAT TO PUT HERE"),
CidrBlock: pulumi.String("10.99.0.0/23"),
AvailabilityZone: pulumi.StringPtr("us-east-1a"),
})
if err != nil {
return err
}
billowy-army-68599
07/27/2021, 4:05 PMnarrow-action-47255
07/27/2021, 4:08 PMbillowy-army-68599
07/27/2021, 4:09 PM