I'm trying to parametise the delimiter used by an Fn::Join, e.g. at first I had:
"Name" : { "Fn::Join" : [ ".", [
{ "Ref":"serviceName"}, { "Ref": "environment" } ] ] },
Which works well, but then I changed it to:
"Name" : { "Fn::Join" : [ {"Ref":"HostNameSeparator"}, [
{ "Ref":"serviceName"}, { "Ref": "environment" } ] ] },
I get the following error from the validation phase:
A client error (ValidationError) occurred when calling the
ValidateTemplate operation: Template error: every Fn::Join object
requires two parameters, (1) a string delimiter and (2) a list of
strings to be joined or a function that returns a list of strings
(such as Fn::GetAZs) to be joined.
Is it possible to do what I want, i.e. pass the Join delimiter as a template parameter?
(I've shortened the examples above for clarity sake, please ignore typos)
As a work-around, I calculate the join in the script which calls the cloudformation creation command
and pass the final value as a parameter, but it's not ideal since it means that I repeat the input to the template
more than once (the "serviceName" and "environment" parameters above, for instance).