Can I use "Fn :: Join" in the "Options" javascript AWS Cloudformation template

I want to use the Cloudformation parameter template template shortcut for some Policy / Loadbalancers tag names, for example:

"SomeScalingGroupName": {
            "Type": "String",
            "Default": {"Fn::Join": ["", ["Process-", {"Ref": "Env"}, "-Some-Worker-Name"]]}
        },

And I get the error message:

Template validation error: Template format error: each default member must be a string.

So my question is, if this is the correct way to use the join function in parameters? Or do I have another way to do this? Or do you have any better suggestions for using this?

Thanks!

+4
source share
1 answer

.

. , .

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html

. :

"Parameters" : {
  "Env" : {
    "Type" : "String",
    "Default" : "test"
  },
  "WorkerName" : {
    "Type" : "String",
    "Default" : "my-worker"
  }
}

"Resources" : {
  "LoadBalancer" : {
    "Type" : "AWS::ElasticLoadBalancing::LoadBalancer",
    ...
    "Properties" : {
      "Tags" : [ 
        { "Key" : "Name", "Value": { "Fn::Join" : [ "-", [ "process", { "Ref" : "Env" }, { "Ref" : "SomeWorkerName" }]]}},
      ]
    }
  }
}

"" "process-test-my-worker". .

+7

Source: https://habr.com/ru/post/1618400/


All Articles