💾 Archived View for cfdocs.wetterberg.nu › intrinsic-function-reference-join.gemini captured on 2024-05-10 at 12:43:47. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-12-03)
-=-=-=-=-=-=-
The intrinsic function `Fn::Join` appends a set of values into a single value, separated by the specified delimiter. If a delimiter is the empty string, the set of values are concatenated with no delimiter.
{ "Fn::Join" : [ "delimiter", [ comma-delimited list of values ] ] }
Syntax for the full function name:
Fn::Join: [ delimiter, [ comma-delimited list of values ] ]
Syntax for the short form:
!Join [ delimiter, [ comma-delimited list of values ] ]
delimiter
The value you want to occur between fragments. The delimiter will occur between fragments only. It will not terminate the final value.
ListOfValues
The list of values you want combined.
The combined string.
The following example returns: `"a:b:c"`.
1. "Fn::Join" : [ ":", [ "a", "b", "c" ] ]
1. !Join [ ":", [ a, b, c ] ]
The following example uses `Fn::Join` to construct a string value. It uses the `Ref` function with the `AWS::Partition` parameter and the `AWS::AccountId` pseudo parameter.
1. { 2. "Fn::Join": [ 3. "", [ 4. "arn:", 5. { 6. "Ref": "AWS::Partition" 7. }, 8. ":s3:::elasticbeanstalk-*-", 9. { 10. "Ref": "AWS::AccountId" 11. } 12. ] 13. ] 14. }
1. !Join 2. - '' 3. - - 'arn:' 4. - !Ref AWS::Partition 5. - ':s3:::elasticbeanstalk-*-' 6. - !Ref 'AWS::AccountId'
Also see the Fn::Sub function for similar functionality.
For the `Fn::Join` delimiter, you cannot use any functions. You must specify a string value.
For the `Fn::Join` list of values, you can use the following functions: