• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Waypoint
  • Install
  • Tutorials
  • Documentation
  • CLI
  • Plugins
  • Try Cloud(opens in new tab)
  • Sign up
Waypoint Home

Plugins

Skip to main content
  • Plugins
  • aws-ec2
  • aws-ecs
  • aws-lambda
  • aws-ssm
  • azure-container-instance
  • consul
  • docker
  • exec
  • google-cloud-run
  • helm
  • kubernetes
  • nomad
  • pack
  • packer
  • terraform-cloud
  • vault

  • Resources

  • Tutorial Library
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  1. Developer
  2. Waypoint
  3. Plugins
  4. terraform-cloud

ยปTerraform Cloud

terraform-cloud (configsourcer)

Read Terraform state outputs from Terraform Cloud.

Examples

config {
  env = {
    "DATABASE_USERNAME" = dynamic("terraform-cloud", {
            organization = "foocorp"
            workspace = "databases"
            output = "db_username"
    })

    "DATABASE_PASSWORD" = dynamic("vault", {
            organization = "foocorp"
            workspace = "databases"
            output = "db_password"
    })

    "DATABASE_HOST" = dynamic("vault", {
            organization = "foocorp"
            workspace = "databases"
            output = "db_hostname"
    })
  }
}

Required Parameters

These parameters are used in dynamic for sourcing configuration values or input variable values.

organization

The Terraform Cloud organization to query.

Within a single workspace, multiple dynamic values that use the same organization and workspace will only read the value once. This allows outputs to be extracted into multiple values. The example above shows this functionality by reading the username and password into separate values.

  • Type: string

workspace

The Terraform Cloud workspace associated with the given organization to read the outputs of.

The outputs associated with the most recent state version for the given workspace are the ones that are used. These values are refreshed according to refreshInternal, a source field.

  • Type: string

Optional Parameters

These parameters are used in dynamic for sourcing configuration values or input variable values.

output

Optional: The name of the output to read the value of. All outputs if blank.

The name of the output from Terraform Cloud to return. Only strings and objects representable as json (i.e. maps and lists) are currently supported. If unspecified, all outputs from the workspace will be read and returned as a map[string]object, and can be referenced as such in the waypoint.hcl. See https://github.com/hashicorp/waypoint-examples/tree/main/terraform/variables for examples.

  • Type: string
  • Optional

Source Parameters

The parameters below are used with waypoint config source-set to configure the behavior this plugin. These are not used in dynamic calls. The parameters used for dynamic are in the previous section.

Required Source Parameters

token

The Terraform Cloud API token.

The token is used to authenticate access to the specific organization and workspace. Tokens are managed at https://app.terraform.io/app/settings/tokens.

  • Type: string

Optional Source Parameters

base_url

The scheme, host, and port to calculate the URL to fetch using.

This is provided to allow users to query values from Terraform Enterprise installations.

  • Type: string
  • Optional
  • Default: https://api.terraform.io
refresh_interval

How often the outputs should be fetch.

The format of this value is the Go time duration format. Specifically a whole number followed by: s for seconds, m for minutes, h for hours. The minimum value for this setting is 60 seconds, with no specified maximum.

  • Type: string
  • Optional
  • Default: 10m0s
skip_verify

Do not validate the TLS cert presented by Terraform Cloud.

This is not recommended unless absolutely necessary.

  • Type: bool
  • Optional
  • Environment Variable: TFC_SKIP_VERIFY
Edit this page on GitHub

On this page

  1. Terraform Cloud
  2. terraform-cloud (configsourcer)
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)