Skip to content

New major optional template section - Stack tags #205

@gwenael-hagenmuller

Description

@gwenael-hagenmuller

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.

That would be in the same idea of the major template section Parameters 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).

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'
$ 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.

Parameters:

  Environment:
    Description: 'Environment in where to deploy the stack'


Tags:

  Environment:
    Description: 'Environment tag'
    Default: !Join ['', ['mycompany:environment=', !Ref 'Environment']]

3. Expected behavior

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:

$ aws cloudformation deploy \
   --tags \
      mycompany:moniker=myservice-myenvironment-awsregion \
      mycompany:service=myservice-myenvironment-awsregion \
      mycompany:environment=myenvironment

4. Category

Other (IoT, Migration, Budgets...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions