github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/enterprise/api/environments.html.md (about)

     1  ---
     2  layout: "enterprise"
     3  page_title: "Environments - API - Terraform Enterprise"
     4  sidebar_current: "docs-enterprise-api-environments"
     5  description: |-
     6    Environments represent running infrastructure managed by Terraform.
     7  ---
     8  
     9  # Environments API
    10  
    11  Environments represent running infrastructure managed by Terraform.
    12  
    13  Environments can also be connected to Consul clusters. This documentation covers
    14  the environment interactions with Terraform.
    15  
    16  ## Get Latest Configuration Version
    17  
    18  This endpoint updates the Terraform variables for an environment. Due to the
    19  sensitive nature of variables, they are not returned on success.
    20  
    21  | Method | Path           |
    22  | :----- | :------------- |
    23  | `PUT`  | `/environments/:username/:name/variables` |
    24  
    25  ### Parameters
    26  
    27  - `:username` `(string: <required>)` - Specifies the username or organization
    28    name under which to update variables. This username must already exist in the
    29    system, and the user must have permission to create new configuration versions
    30    under this namespace. This is specified as part of the URL.
    31  
    32  - `:name` `(string: <required>)` - Specifies the name of the environment for
    33    which to update variables. This is specified as part of the URL.
    34  
    35  - `variables` `(map<string|string>)` - Specifies a key-value map of Terraform
    36    variables to be updated. Existing variables will only be removed when their
    37    value is empty. Variables of the same key will be overwritten.
    38  
    39      -> Note: Only string variables can be updated via the API currently. Creating or updating HCL variables is not yet supported.
    40  
    41  ### Sample Payload
    42  
    43  ```json
    44  {
    45    "variables": {
    46      "desired_capacity": "15",
    47      "foo": "bar"
    48    }
    49  }
    50  ```
    51  
    52  ### Sample Request
    53  
    54  ```text
    55  $ curl \
    56      --header "X-Atlas-Token: ..." \
    57      --header "Content-Type: application/json" \
    58      --request PUT \
    59      --data @payload.json \
    60      https://atlas.hashicorp.com/api/v1/environments/my-organization/my-environment/variables
    61  ```
    62  
    63  ### Sample Response
    64  
    65  
    66  ```text
    67  ```
    68  
    69  (empty body)