Output

The optional Outputs section declares output values shown in the CloudFormation outputs console.

The output method maps to the CloudFormation Template Anatomy Outputs section.

Example Snippets

There are 3 forms for conditions. Here are example snippets:

# short form
output("Elb")  # same as output("Elb", ref("Elb"))
output("Elb2") # same as output("Elb2", ref("Elb2"))
output("SecurityGroup", get_att("SecurityGroup.GroupId"))

# medium form
output("StackName", Value: ref("AWS::StackName"))

# long form
output("VpcId" => {
  Description: "vpc id",
  Value: ref("VpcId"),
})

Example Outputs

Outputs:
  Elb:
    Value:
      Ref: Elb
  Elb2:
    Value:
      Ref: Elb2
  SecurityGroup:
    Value:
      Fn::GetAtt:
      - SecurityGroup
      - GroupId
  StackName:
    Value:
      Ref: AWS::StackName
  VpcId:
    Description: vpc id
    Value:
      Ref: VpcId

Back to DSL Basics Docs.