Output

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(:security_group, get_att("security_group.group_id"))

# medium form
output(:stack_name, value: "!Ref AWS::StackName")

# long form
output(vpc_id: {
  description: "vpc id",
  value: ref("vpc_id"), # same as: 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 List Docs.

Pro tip: Use the <- and -> arrow keys to move back and forward.

Edit this page

See a typo or an error? You can improve this page. This website is available on GitHub and contributions are encouraged and welcomed. We love pull requests from you!