https://pulumi.com logo
#aws
Title
# aws
q

quick-morning-97163

01/29/2024, 4:51 PM
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

salmon-account-74572

01/29/2024, 4:53 PM
I believe this issue is tracking the behavior you’re seeing: https://github.com/pulumi/pulumi-awsx/issues/383
g

gentle-zoo-32137

01/29/2024, 6:18 PM
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

quick-morning-97163

01/29/2024, 7:35 PM
Thanks @gentle-zoo-32137 il give it a go
l

little-cartoon-10569

01/29/2024, 8:06 PM
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).