This data source is used to retrieve the state outputs for a given workspace. It enables output values in one Terraform configuration to be used in another.
Using the tfe_outputs
data source, the outputs foo
and bar
can be used as seen below:
In the example below, assume we have outputs defined in a my-org/my-workspace
:
data "tfe_outputs" "foo" {
organization = "my-org"
workspace = "my-workspace"
}
resource "random_id" "vpc_id" {
keepers = {
# Generate a new ID any time the value of 'bar' in workspace 'my-org/my-workspace' changes.
bar = data.tfe_outputs.foo.values.bar
}
byte_length = 8
}
The following arguments are supported:
organization
- (Required) The name of the organization.workspace
- (Required) The name of the workspace.The following attributes are exported:
values
- The current output values for the specified workspace.nonsensitive_values
- The current non-sensitive output values for the specified workspace, this is a subset of all output values.