Sub, Join and Select

Fn::Sub, Fn::Join and Fn::Select

Fn::Sub replaces each ${Name} in a string: a parameter or logical ID acts like Ref, ${Resource.Attribute} like Fn::GetAtt, and ${AWS 24 ::Region} gives the pseudo parameter. Its list form adds a variable map whose values may be functions, and ${!Literal} writes a literal ${Literal}. Fn::Join glues a list with a delimiter, Fn::Split cuts a string into a list, and Fn::Select picks an item by zero-based index, often from Fn::GetAZs, the region's Availability Zones:

infra/functions.yaml: outputs built with Sub, Join, Select and SplitYAML
  SiteUrl: {Value: !Sub "https://${FrontEndBucket.RegionalDomainName}/index.html"}
  Zones: {Value: !Join [", ", !GetAZs ""]}
  Label:
    Value: !Sub
      - ${AWS::StackName} in ${Zone}
      - Zone: !Select [0, !GetAZs ""]
  StackUuid: {Value: !Select [2, !Split ["/", !Ref AWS::StackId]]}

In Ref and GetAtt's output, SiteUrl and Label show both forms of Sub, Zones the six zones LocalStack 63,725 reports, and StackUuid the end of the stack ARN. A Select index past the end of a list fails the operation.