Select

The intrinsic function Fn::Select returns a single object from a list of objects by index.

The select method is the CloudFormation Fn::Select equivalent.

Example Snippet

resource("Subnet0", "AWS::EC2::Subnet",
  VpcId: ref("Vpc"),
  CidrBlock: select("0", ref("DbSubnetIpBlocks"))
)

Example Output

Resources:
  Subnet0:
    Type: AWS::EC2::Subnet
    Properties:
      VpcId:
        Ref: Vpc
      CidrBlock:
        Fn::Select:
        - '0'
        - Ref: DbSubnetIpBlocks

Back to Intrinsic Functions List.