• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Terraform
  • Install
  • Tutorials
    • About the Docs
    • Configuration Language
    • Terraform CLI
    • Terraform Cloud
    • Terraform Enterprise
    • CDK for Terraform
    • Provider Use
    • Plugin Development
    • Registry Publishing
    • Integration Program
  • Registry(opens in new tab)
  • Try Cloud(opens in new tab)
  • Sign up
Terraform Home

Terraform Cloud

Skip to main content
  • Terraform Cloud
  • Plans and Features
  • Getting Started
    • Overview
    • Account
    • Agent Pools
    • Agent Tokens
    • Applies
    • Audit Trails
    • Assessment Results
    • Comments
    • Configuration Versions
    • Cost Estimates
    • Feature Sets
    • Invoices
    • IP Ranges
    • Notification Configurations
    • OAuth Clients
    • OAuth Tokens
    • Organizations
    • Organization Memberships
    • Organization Tags
    • Organization Tokens
    • Plan Exports
    • Plans
    • Policies
    • Policy Checks
    • Policy Sets
    • Policy Set Parameters
    • Projects
    • Project Team Access
    • Runs
    • Run Triggers
    • SSH Keys
    • State Versions
    • State Version Outputs
    • Subscriptions
    • Team Membership
    • Team Tokens
    • Teams
    • User Tokens
    • Users
    • Variables
    • VCS Events
    • Workspaces
    • Workspace-Specific Variables
    • Workspace Team Access
    • Workspace Resources
    • Variable Sets
    • Changelog
    • Stability Policy
  • Migrating to Terraform Cloud

  • Terraform Cloud Agents

  • Resources

  • Tutorial Library
  • Certifications
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  • Terraform Registry
    (opens in new tab)
  1. Developer
  2. Terraform
  3. Terraform Cloud
  4. API
  5. Applies

»Applies API

An apply represents the results of applying a Terraform Run's execution plan.

Attributes

Apply States

You'll find the apply state in data.attributes.status, as one of the following values.

StateDescription
pendingThe initial status of a apply once it has been created.
managed_queued/queuedThe apply has been queued, awaiting backend service capacity to run terraform.
runningThe apply is running.
erroredThe apply has errored. This is a final state.
canceledThe apply has been canceled. This is a final state.
finishedThe apply has completed successfully. This is a final state.
unreachableThe apply will not run. This is a final state.

Show an apply

GET /applies/:id

ParameterDescription
idThe ID of the apply to show.

There is no endpoint to list applies. You can find the ID for an apply in the relationships.apply property of a run object.

StatusResponseReason
200JSON API document (type: "applies")The request was successful
404JSON API error objectApply not found, or user unauthorized to perform action

Sample Request

curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  https://app.terraform.io/api/v2/applies/apply-47MBvjwzBG8YKc2v

Sample Response

{
  "data": {
    "id": "apply-47MBvjwzBG8YKc2v",
    "type": "applies",
    "attributes": {
      "execution-details": {
        "mode": "remote",
      },
      "status": "finished",
      "status-timestamps": {
        "queued-at": "2018-10-17T18:58:27+00:00",
        "started-at": "2018-10-17T18:58:29+00:00",
        "finished-at": "2018-10-17T18:58:37+00:00"
      },
      "log-read-url": "https://archivist.terraform.io/v1/object/dmF1bHQ6djE6OFA1eEdlSFVHRSs4YUcwaW83a1dRRDA0U2E3T3FiWk1HM2NyQlNtcS9JS1hHN3dmTXJmaFhEYTlHdTF1ZlgxZ2wzVC9kVTlNcjRPOEJkK050VFI3U3dvS2ZuaUhFSGpVenJVUFYzSFVZQ1VZYno3T3UyYjdDRVRPRE5pbWJDVTIrNllQTENyTndYd1Y0ak1DL1dPVlN1VlNxKzYzbWlIcnJPa2dRRkJZZGtFeTNiaU84YlZ4QWs2QzlLY3VJb3lmWlIrajF4a1hYZTlsWnFYemRkL2pNOG9Zc0ZDakdVMCtURUE3dDNMODRsRnY4cWl1dUN5dUVuUzdnZzFwL3BNeHlwbXNXZWRrUDhXdzhGNnF4c3dqaXlZS29oL3FKakI5dm9uYU5ZKzAybnloREdnQ3J2Rk5WMlBJemZQTg",
      "resource-additions": 1,
      "resource-changes": 0,
      "resource-destructions": 0
    },
    "relationships": {
      "state-versions": {
        "data": [
          {
            "id": "sv-TpnsuD3iewwsfeRD",
            "type": "state-versions"
          },
          {
            "id": "sv-Fu1n6a3TgJ1Typq9",
            "type": "state-versions"
          }
        ]
      }
    },
    "links": {
      "self": "/api/v2/applies/apply-47MBvjwzBG8YKc2v"
    }
  }
}

Using Terraform Cloud Agents

Terraform Cloud Agents are a solution to allow Terraform Cloud to communicate with isolated, private, or on-premises infrastructure. When a workspace is set to use the agent execution mode, the apply response will include additional details about the agent pool and agent used.

{
  "data": {
    "id": "apply-47MBvjwzBG8YKc2v",
    "type": "applies",
    "attributes": {
      "execution-details": {
        "agent-id": "agent-S1Y7tcKxXPJDQAvq",
        "agent-name": "agent_01",
        "agent-pool-id": "apool-Zigq2VGreKq7nwph",
        "agent-pool-name": "first-pool",
        "mode": "agent",
      },
      "status": "finished",
      "status-timestamps": {
        "queued-at": "2018-10-17T18:58:27+00:00",
        "started-at": "2018-10-17T18:58:29+00:00",
        "finished-at": "2018-10-17T18:58:37+00:00"
      },
      "log-read-url": "https://archivist.terraform.io/v1/object/dmF1bHQ6djE6OFA1eEdlSFVHRSs4YUcwaW83a1dRRDA0U2E3T3FiWk1HM2NyQlNtcS9JS1hHN3dmTXJmaFhEYTlHdTF1ZlgxZ2wzVC9kVTlNcjRPOEJkK050VFI3U3dvS2ZuaUhFSGpVenJVUFYzSFVZQ1VZYno3T3UyYjdDRVRPRE5pbWJDVTIrNllQTENyTndYd1Y0ak1DL1dPVlN1VlNxKzYzbWlIcnJPa2dRRkJZZGtFeTNiaU84YlZ4QWs2QzlLY3VJb3lmWlIrajF4a1hYZTlsWnFYemRkL2pNOG9Zc0ZDakdVMCtURUE3dDNMODRsRnY4cWl1dUN5dUVuUzdnZzFwL3BNeHlwbXNXZWRrUDhXdzhGNnF4c3dqaXlZS29oL3FKakI5dm9uYU5ZKzAybnloREdnQ3J2Rk5WMlBJemZQTg",
      "resource-additions": 1,
      "resource-changes": 0,
      "resource-destructions": 0
    },
    "relationships": {
      "state-versions": {
        "data": [
          {
            "id": "sv-TpnsuD3iewwsfeRD",
            "type": "state-versions"
          },
          {
            "id": "sv-Fu1n6a3TgJ1Typq9",
            "type": "state-versions"
          }
        ]
      }
    },
    "links": {
      "self": "/api/v2/applies/apply-47MBvjwzBG8YKc2v"
    }
  }
}
Edit this page on GitHub

On this page

  1. Applies API
  2. Attributes
  3. Show an apply
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)