Hi guys, can someone point out what I'm missing he...
# golang
a
Hi guys, can someone point out what I'm missing here? I'm trying to import a VpcId from a VPC object into a subnet declaration with the AWS provider.
Copy code
vpc, err := ec2.NewVpc(ctx, "partseeker-dev", &ec2.VpcArgs{
			CidrBlock: pulumi.String("10.0.0.0/16"),
		})
		assertNoErr(err)

		publicA, err := ec2.NewSubnet(ctx, "publicA", &ec2.SubnetArgs{
			VpcId:            pulumi.String(vpc.ID()),    //<---- here
			AvailabilityZone: pulumi.String(appAZ),
			CidrBlock:        pulumi.String("10.0.10.0/24"),
		})
VpcId needs a string, and I thought vpc.ID() returns a string... but it returns the type IDOutput. What should I be doing instead?
Currently rereading the input/output section of the docs to make sure I grok it. I must have missed something
b
@alert-crayon-18838 you don't need to wrap an output in a
pulumi.String
a
Oh of course facepalm
b
Copy code
ublicA, err := ec2.NewSubnet(ctx, "publicA", &ec2.SubnetArgs{
			VpcId:            vpc.ID()
			AvailabilityZone: pulumi.String(appAZ),
			CidrBlock:        pulumi.String("10.0.10.0/24"),
		})
this is fine
a
great big blind spot right in front of me! Thank you @billowy-army-68599
b
no worries! any resource input will accept an output
and an output will accept
output | string
so you can pass either