Noob question: Trying to create a new vpc and th...
# golang
q
Noob question: Trying to create a new vpc and then use the id in subsequent steps... however the Vpc struct that gets returned doesn't have an Id - unlike the LookupVpcResult struct.
b
can you share your code? it should definitely have an id
q
sure -- dead simple:
Copy code
vpc, err := ec2.NewVpc(ctx,"api-dev-vpc", &ec2.VpcArgs{
			CidrBlock: pulumi.String("10.0.0.0/16"),
			Tags:      pulumi.ToStringMap(tags),
		})
looking at the struct def I see the
pulumi.CustomResourceState
however I get this:
Copy code
Diagnostics:
  pulumi:pulumi:Stack (GPW-API-dev):
    # GPW-API
    ./main.go:44:72: vpc.Id undefined (type *ec2.Vpc has no field or method Id)
I also had to roll back to a previous version because I was getting a ton of re-declared errors with the most recent release
b
I believe it's
vpc.ID()
in Go
q
ok thanks -- will use that
another question - when I use the most recent release I get a ton of errors about re-declared types....I had to pin the dependency versions to 3.0 (pulumi) and 4.0 (aws) respectively to get anything to work....thoughts?
b
we are in the process of fixing that bug now,
4.20.0
should work
we'll have a patch release out shortly
q
ok thanks