aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap
New major optional template section - Stack tags
- Dominant language
- No language data
- Stars
- 1.1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
## 1. Title
New major optional template section - Tags
## 2. Scope of request
A new major (optional) template section which could be called `Tags` to list the tags to associate with the stack that is created or updated and to propagate to resources in the stack.
This list can already be passed to `aws cloudformation deploy` through the `--tags` parameter. See corresponding [AWS CLI Command Reference](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/deploy/index.html).
That would be in the same idea of the major template section [Parameters](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html) which allows the user to input custom values to his/her template each time he/she creates or updates a stack. Those parameters can be overridden thanks to the `--parameter-overrides` parameter of `aws cloudformation deploy`.
Default values specified in the `Tags` section of the template should also be overridable thanks to `--tags` parameter (which should probably be renamed).
```YAML
Tags:
Moniker:
Description: 'Moniker tag'
Default: 'mycompany:moniker=myservice-myenvironment-awsregion'
Service:
Description: 'Service tag'
Default: 'mycompany:service=myservice-myenvironment-awsregion'
Environment:
Description: 'Environment tag'
Default: 'mycompany:environment=myenvironment'
```
```bash session
$ aws cloudformation deploy \
--tags-overrides \
Moniker="mycompany:moniker=myservice-DIFFERENTenvironment-awsregion"
```
It should be possible to reference parameters in the `Tags` section like it is possible in the `Resources` section.
```YAML
Parameters:
Environment:
Description: 'Environment in where to deploy the stack'
Tags:
Environment:
Description: 'Environment tag'
Default: !Join ['', ['mycompany:environment=', !Ref 'Environment']]
```
## 3. Expected behavior
```YAML
Tags:
Moniker:
Description: 'Moniker tag'
Default: 'mycompany:moniker=myservice-myenvironment-awsregion'
Service:
Description: 'Service tag'
Default: 'mycompany:service=myservice-myenvironment-awsregion'
Environment:
Description: 'Environment tag'
Default: 'mycompany:environment=myenvironment'
```
would have the same behavior as:
```bash session
$ aws cloudformation deploy \
--tags \
mycompany:moniker=myservice-myenvironment-awsregion \
mycompany:service=myservice-myenvironment-awsregion \
mycompany:environment=myenvironment
```
## 4. Category
Other (IoT, Migration, Budgets...)
Contributor guide
Assessment
This issue has not been assessed yet.