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("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 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!