» Configuration Versions API

» Create a Configuration Version

A configuration version (configuration-version) is a resource used to reference the uploaded configuration files. It is associated with the run to use the uploaded configuration files for performing the plan and apply.

Method Path
POST /workspaces/:workspace_id/configuration-versions

» Parameters

  • :workspace_id (string: <required>) - specifies the workspace ID to create the new configuration version

» Sample Payload

{
  "data": {
    "type": "configuration-versions"
  }
}

» Sample Request

curl \
  --header "Authorization: Bearer $ATLAS_TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  --request POST \
  --data @payload.json \
  https://app.terraform.io/api/v2/workspaces/ws-2Qhk7LHgbMrm3grF/configuration-versions

» Sample Response

{
  "data": {
    "id": "cv-ntv3HbhJqvFzamy7",
    "type": "configuration-versions",
    "attributes": {
      "upload-url": "http://127.0.0.1:7675/v1/object/4c44d964-eba7-4dd5-ad29-1ece7b99e8da"
      ...
    }
  }
}

» Upload Configuration Files

Method Path
POST The upload URL is provided in the upload-url attribute in the configuration-versions resource

» Parameters

  • data (file: <required>) - A local .tar.gz file containing the folder of the terraform configuration files. This file can be created by running tar -zcvf ./config.tar.gz . from within the terraform configuration directory.

» Sample Request

$ curl \
    --request PUT \
    -F 'data=@config.tar.gz' \
    http://127.0.0.1:7675/v1/object/4c44d964-eba7-4dd5-ad29-1ece7b99e8da