• 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

Documentation

Skip to main contentOverview
  • Getting Started


    • Overview
    • app
    • build
    • config
    • deploy
    • hook
    • plugin
    • registry
    • release
    • runner
    • url
    • use
    • variable
  • URL Service
  • Logs
  • Exec
  • Workspaces
  • Plugins
  • Triggers

  • Troubleshooting
  • Glossary

  • Roadmap

  • Resources

  • Tutorial Library
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  1. Developer
  2. Waypoint
  3. Documentation
  4. waypoint.hcl
  5. variable
  • Waypoint
  • v0.9.x
  • v0.8.x
  • v0.7.x
  • v0.6.x
  • v0.5.x
  • v0.4.x
  • v0.3.x
  • v0.2.x
  • v0.1.x

ยปvariable Stanza

Placementvariable

The variable stanza declares a variable and makes it available for use in other stanzas in the config. Read more about defining and using variables here.

variable "key" {
  # ...
}

Multiple variable stanzas can be specified; there is no limit to the number of variables you can define for your configuration.

variable "image" {
  # ...
}

variable "tag" {
  # ...
}

Supply a value to a specified variable with one of the following methods:

  • the default value in the definition block
  • an environment variable on the runner specified by env in the definition block
  • the parameter -var key=value
  • the parameter -var-file=filename, where filename is the name of a file with variable values
  • an environment variable prefixed with WP_VAR_
  • a file of variable values with the suffix .auto.wpvars
  • the Waypoint UI

variable Parameters

Optional

  • default (string: "") - Sets a default value for the variable. Must be set to null if no value is set by other sources.

  • type (string: expression) - A type constraint to apply to values for the defined variable.

  • description (string: "") - A short summary documenting what the variable is and its purpose.

  • env (list of string: []) - Sets a set of environment variables to source a default value from if a value is not set. The environment variables are read only on the runner. See environment variables for more information.

Edit this page on GitHub

On this page

  1. variable Stanza
  2. variable Parameters
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)