Tagging CloudFormation stacks when deploy occurs

Both sam deploy and aws cloudformation deploy CLI commands support an optional --tags argument. This tags argument is the preferred way to apply resource tags across all resources in the CloudFormation stack. Since SAM CLI is not a first-class citizen for Spacelift, the samconfig.toml file cannot be used to customize tags either since the tags in samconfig.toml are only evaluated when a sam deploy occurs.

Similar to the special TF_VAR_ variables supported by Spacelift, I would like to see a CF_VAR_STACK_TAGS (CloudFormation variable) or similar that would be automatically passed to the aws cloudformation deploy command that is executed behind the scenes for CloudFormation stacks running on the Spacelift platform. If the environment variable is not present a given Spacelift stack, the stack should work like it does today. This would allow customizing tags per stack to facilitate simpler tag management which is crucial for automation, compliance, and audit purposes.

I would expect this to be backwards compatible as well.

Workaround
Since terraform is not approved for the product development teams at my company, teams must use CloudFormation. So far, the only solution we have come up with is a custom script to try to apply tags to every resource in the stack. This is only a proof of concept and is only run ad-hoc. As a result, many CloudFormation stacks at my company deployed through Spacelift today either manually set tags on all resources or they don't set any tags. Tags are enforced in our organization so the lack of a simple solution will hinder adoption of Spacelift.
Problem
-

Please authenticate to join the conversation.

Upvoters
Status

⬆️ Gathering votes

Board

💡 Feature Requests

Tags

CloudFormation

Date

Over 1 year ago

Subscribe to post

Get notified by email when there are changes.