What is the correct way to define default tags so that they are applied to all AWS resources in my stack? I have the following provider config, but none of my resources are actually tagged:
config:
aws:defaultTags:
tags:
key1: value1
key2: value2
aws:region: us-west-1
Versions:
@pulumi/[email protected]
@pulumi/[email protected]
Answering my own question after a few hours of trial and error. Based on the sample config in the question:
pulumi preview --diffThis policy pack is configurable so that you can enforce arbitrary tags without needing to change the pack’s code, making it reusable. For the CLI scenario, we will create a policy-config.json file that specifies the same three required tags shown above:
{
"all": "mandatory",
"check-required-tags": {
"requiredTags": [
"user:Project",
"user:Stack",
"user:Cost Center"
]
}
}
Default tags
tags
{[key: string]: string}
read more- https://www.pulumi.com/blog/automatically-enforcing-aws-resource-tagging-policies/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With