»Terraform Cloud

»terraform-cloud (configsourcer)

Read Terraform state outputs from Terraform Cloud.

»Examples

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

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

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

»Required Parameters

These parameters are used in configdynamic for dynamic configuration syncing.

»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

»output

The name of the output to read the value of.

  • Type: string

»workspace

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

The outputs associtaed 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

This plugin has no optional parameters.

»Source Parameters

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

»Required Source Parameters

»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.

»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.

»refresh_internal
  • Type: string
  • Optional
»skip_verify

Do not validate the TLS cert presented by the Vault server.

This is not recommended unless absolutely necessary.

  • Type: bool
  • Optional