Environments API

Environments represent running infrastructure managed by Terraform.

Environments can also be connected to Consul clusters. This documentation covers the environment interactions with Terraform.

Environment Attributes

Attribute Description Required
variables A key/value map of Terraform variables to be updated. Existing variables will only be removed when their value is empty. Varaibles of the same key will be overwritten. Yes
Note: Only string variables can be updated via the API currently. Creating or updating HCL variables is not yet supported.


The following actions can be perfomed on this resource.

Update variables
PUT /api/v1/enviromments/:username/:name/variables


Updating Terraform variables

Updates the Terraform variables for an environment. Due to the sensitive nature of variables, they will not returned on success.

$ cat variables.json
  "variables": {
      "desired_capacity": "15",
      "foo": "bar"
$ curl https://atlas.hashicorp.com/api/v1/environments/acmeinc/test/variables \
    -X PUT \
    -H 'Content-Type: application/json' \
    -d @variables.json \
    -H "X-Atlas-Token: $ATLAS_TOKEN"