Hello im creating VPC but unable to get VPC ID t...
# aws
c
Hello im creating VPC but unable to get VPC ID to string, ID is CustomResourceState Even try to convert Arn its also not converting is type StringOutput Tech Stack we are using Golang Can someone help me with ID() to string and ARN to string
Copy code
vpc, err := ec2.NewVpc(r.ctx, "VPCName", &ec2.VpcArgs{
    CidrBlock:       pulumi.String(cidrBlock),
    InstanceTenancy: pulumi.String("default"),
})
s
In order to access the raw string value, you need to use `Apply`: https://www.pulumi.com/docs/iac/concepts/inputs-outputs/apply/ What do you want to do with that string value? If you want to pass it to another Pulumi resource, you don't need to convert it to string. If you want to output it on the command line, you also do not need to convert to s a string. Use a stack output for that: https://www.pulumi.com/docs/iac/concepts/stacks/#outputs