2014-07-28 19:43:00 +02:00
|
|
|
---
|
|
|
|
layout: "docs"
|
|
|
|
page_title: "Configuring Outputs"
|
|
|
|
sidebar_current: "docs-config-outputs"
|
|
|
|
---
|
|
|
|
|
|
|
|
# Output Configuration
|
|
|
|
|
|
|
|
Outputs define values that will be highlighted to the user
|
|
|
|
when Terraform applies, and can be queried easily using the
|
|
|
|
[output command](/docs/commands/output.html). Output usage
|
|
|
|
is covered in more detail in the
|
|
|
|
[getting started guide](/intro/getting-started/outputs.html).
|
|
|
|
This page covers configuration syntax for outputs.
|
|
|
|
|
|
|
|
Terraform knows a lot about the infrastructure it manages.
|
|
|
|
Most resources have a handful or even a dozen or more attributes
|
|
|
|
associated with it. Outputs are a way to easily extract
|
|
|
|
information.
|
|
|
|
|
|
|
|
This page assumes you're familiar with the
|
|
|
|
[configuration syntax](/docs/configuration/syntax.html)
|
|
|
|
already.
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
An output configuration looks like the following:
|
|
|
|
|
|
|
|
```
|
|
|
|
output "address" {
|
|
|
|
value = "${aws_instance.web.public_dns}"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2014-08-07 09:19:56 +02:00
|
|
|
## Description
|
2014-07-28 19:43:00 +02:00
|
|
|
|
|
|
|
The `output` block configures a single output variable. Multiple
|
|
|
|
output variables can be configured with multiple output blocks.
|
|
|
|
The `NAME` given to the output block is the name used to reference
|
|
|
|
the output variable.
|
|
|
|
|
|
|
|
Within the block (the `{ }`) is configuration for the output.
|
|
|
|
These are the parameters that can be set:
|
|
|
|
|
|
|
|
* `value` (required, string) - The value of the output. This must
|
|
|
|
be a string. This usually includes an interpolation since outputs
|
|
|
|
that are static aren't usually useful.
|
|
|
|
|
|
|
|
## Syntax
|
|
|
|
|
|
|
|
The full syntax is:
|
|
|
|
|
|
|
|
```
|
|
|
|
output NAME {
|
|
|
|
value = VALUE
|
|
|
|
}
|
|
|
|
```
|