Hi, I have created a vpc with code like below: co...
# aws
q
Hi, I have created a vpc with code like below: const vpc = new awsx.ec2.Vpc(
Test
, { numberOfAvailabilityZones: config.requireNumber("availability-zones"), cidrBlock: config.get("vpc-cidr-block") ?? "20.0.0.0/16", subnets: [ { type: "private", name:
Test
, tags: tags, }, { type: "public", name:
Test
, tags: tags, }, ], tags: { ...tags, ...{ Name:
Test
} }, }); This code will create the NatGateway and Subnets but does not propagate the tags, is there a way to get the tags added to the children resources
s
I believe this issue is tracking the behavior you’re seeing: https://github.com/pulumi/pulumi-awsx/issues/383
g
A workaround you can try is to provide the tags you want propagated as the defaultTags on the provider. Depending on what other resources your stack creates and whether the tags are computed or static that may require you to provide an explicit provider instead of relying on the default one.
q
Thanks @gentle-zoo-32137 il give it a go
l
You can also create a transformation for this. It can be a resource transformation that transforms all child resources, you don't need to use a stack transformation (though that's good, too).