On This Page

  • Docs
  • Common Use Cases
  • Runtime
  • Environment Variables

Environment Variables

It's possible to set environment variables using Hooks and Workflows.

Hooks

Set an environment variable at the very start of a Terrateam operation.

hooks:
  plan:
    pre:
      - type: env
        name: FOO
        cmd: ['echo', 'BAR']
    post: []
  apply:
    pre:
      - type: env
        name: BAZ
        cmd: ['echo', 'QUX']
    post: []

Workflows

Set an environment variable at the start of each Plan and Apply operation workflow execution.

workflows:
  - tag_query: ""
    plan:
      - type: init
      - type: env
        name: FOO
        cmd: ["echo", "BAR"]
      - type: plan
    apply:
      - type: init
      - type: env
        name: FOO
        cmd: ["echo", "BAR"]
      - type: apply