AWS cloud formation Template- providing Tags for the stack in the template

后端 未结 2 475
逝去的感伤
逝去的感伤 2021-02-03 20:21

We wanted to use company specific Tags to the resources that we create in AWS for billing purposes. I am using a cloud formation template to spin up our Elasticbeanstalk instanc

2条回答
  •  别跟我提以往
    2021-02-03 21:05

    In the template anatomy, you cant set stack-level tags directly. However you can create a wrapper template, having a single resource of AWS::CloudFormation::Stack.

    You can define stack-level tags on that resource:

    {
      "AWSTemplateFormatVersion": "2010-09-09",
      "Description": "WrapperTemplate",
    
      "Resources": {
        "WrappedStackWithStackLevelTags": {
          "Type" : "AWS::CloudFormation::Stack",
          "Properties" : {
            "Tags" : [ { "Key" : "Stage", "Value" : "QA" } ],
            "TemplateURL" : "your-original-template-s3-url"
          }
        }
      }
    }
    

提交回复
热议问题