AWS Cloudformation- How to do string Uppercase or lowercase in json/yaml template

后端 未结 4 854
北恋
北恋 2021-02-19 11:18

I am working on AWS CloudFormation and I created one template in which I asked user to select Environment.

On the basis of selected value I created the resources.

4条回答
  •  南旧
    南旧 (楼主)
    2021-02-19 12:10

    You can do this with a CloudFormation macro.

    Parameters:
      InputString:
        Default: "This is a test input string"
        Type: String
    Resources:
      S3Bucket:
        Type: "AWS::S3::Bucket"
        Properties:
          Tags:
            - Key: Upper
              Value:
                'Fn::Transform':
                 - Name: 'String'
                   Parameters:
                     InputString: !Ref InputString
                     Operation: Upper
    
    

    https://github.com/awslabs/aws-cloudformation-templates/tree/master/aws/services/CloudFormation/MacrosExamples/StringFunctions

提交回复
热议问题