amplify-backend
amplify-backend copied to clipboard
Define Resource Tags for AWS Resources
Environment information
System:
OS: macOS 14.4.1
CPU: (8) x64 Apple M1
Memory: 74.03 MB / 16.00 GB
Shell: /bin/zsh
Binaries:
Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
pnpm: undefined - undefined
NPM Packages:
@aws-amplify/backend: 1.0.2
@aws-amplify/backend-cli: 1.0.3
aws-amplify: 6.3.2
aws-cdk: 2.142.0
aws-cdk-lib: 2.142.0
typescript: 5.4.5
Description
In Amplify Gen1 it was possible to define tags for AWS resources by adding a tags.json to the project. It seems that this does not work in Gen2. Would be great to have a feature like this in Gen2 also.
Hey @fullstackcreatives :wave: thanks for raising this! While it's possible to apply tags to individual resource stacks using CDK, we currently do not support applying tags to all resources within the root stack. Marking as a feature request
Is there any update about this issue?
Would love any updates to this and curious when this might get prioritized. Any updates?
This is required functionality for working with Amplify in an enterprise environment. Any updates on this feature, or a workaround for accessing the Amplify root stack scope?
Using CDK scoping, tagging can be applied to the data backend resources, however that's not exposed for the auth backend, nor the root Amplify stack.
For anyone watching this request, I was able to tag all the resources with the following hack:
backend.data.node.scopes.forEach((scope) => {
for (const [key, value] of Object.entries(tags)) {
Tags.of(scope).add(key, value);
}
})
Where tags is a key-value map.