I'm trying to make use of NestedStack but I can't find the way to propagate the tags to all the resources of the stack as the NestedStack construct does not have the field tags as it's the case in the construct Stack.
So, for example, I can't run
const stack = cdk.Stack.of(scope);
for (let key in props.tags) {
cdk.Tags.of(scope).add(key, tags[key], {
applyToLaunchedInstances: false,
excludeResourceTypes: ["AWS::EC2::EIP"]
})
}
Error Message
Property 'tags' does not exist on type 'ekstackprops'.ts(2339)
Where ekstackprops extends NestedStackProps.
If you add tags to a scope that includes a
NestedStackconstruct, the CDK propagates the tags down to the nested stack's child resources at synth-time.For instance, if
MyStackcontains aMyNestedStack, which in turn has aMyNestedLambdaconstruct, the following will add a tag to all three: