Skip to content

Commit

Permalink
Update the docs for tfstack config output blocks (#36339)
Browse files Browse the repository at this point in the history
To verify the schema for yourself, check its definition at the bottom of
`internal/stacks/stackconfig/output_value.go` in this repo. (I also ran an
experiment to make sure, and yep: sensitive is supported as optional, and type
is mandatory.)

Co-authored-by: Rose M Koron <[email protected]>
  • Loading branch information
nfagerlund and rkoron007 authored Jan 16, 2025
1 parent a235f3f commit eb14eab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion website/docs/language/stacks/reference/tfstack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,18 @@ This section provides details about the fields you can configure in the `variabl

Use the `output` block to make information about your infrastructure available in the HCP Terraform UI to expose information about your Stack. The `output` block functions the same way in Stack configuration as it does in traditional Terraform configurations with a few small differences.

In Stack configurations, `output` blocks do not support the `type` or `sensitive` fields, and they do not support the `preconditions` argument. Learn more about [Outputs](/terraform/language/values/outputs).
In Stack configurations, `output` blocks require the `type` argument, and they do not support the `preconditions` block. Learn more about [Outputs](/terraform/language/values/outputs).

### Complete configuration

When every field is defined, an `output` block has the following form:
```hcl
output "unique_name_of_output" {
description = "Description of the purpose of this output"
type = string
value = component.component_name.some_value
sensitive = false
ephemeral = false
}
```

Expand All @@ -119,7 +122,10 @@ This section provides details about the fields you can configure in the `output`
| Field | Description | Type | Required |
| :---- | :---- | :---- | :---- |
| `description` | A human-friendly description for the output. | string | Optional |
| `type` | The type of the output. | type constraint | Required |
| `value` | The value to output. | any | Required |
| `sensitive` | Marks the variable as sensitive, which prevents its value from being displayed in logs or in the HCP Terraform UI. | bool | Optional |
| `ephemeral` | Whether to exclude the value from plans and state data. | bool | Optional |

## `required_providers` and `provider` block configuration

Expand Down

0 comments on commit eb14eab

Please sign in to comment.