Applies

The Apply resource

Applies are the details of a request to apply a Terraform plan.

An apply may or may not be successful as indicated by the status attribute.

Key path

Description

type* (string)

Available values: applies

id (string)

attributes.execution-details (object)

Apply execution details.

attributes.resource-additions (integer)

The number of resources added.

attributes.resource-changes (integer)

The number of resources updated.

attributes.resource-destructions (integer)

The number of resources destroyed.

attributes.status (string)

Available values: pending, queued, running, finished, canceled, errored, unreachable

The Apply’s current status.

Transient states:

  • pending - Apply has been created but not yet queued.

  • queued - Queued and waiting for capacity/and or quota to be available.

  • running - Running.

Final states:

  • canceled - Apply canceled in some way.

  • errored - An error occurred during the apply. See output for details.

  • finished - Apply completed successfully.

  • unreachable - Apply will not be run.

attributes.status-timestamps (object)

Date/Time of transition to each status that has occurred.

links.output (string)

URL to download the apply output.

links.self (string)

Get an Apply

GET /api/iacp/v3/applies/{apply}

Show details of a specific Terraform Apply stage.

Parameters
  • apply (string) – The ID of the apply.

Example Request:

GET /api/iacp/v3/applies/{apply} HTTP/1.1
Host: my.scalr.io
Prefer: profile=preview
Status Codes
  • 200 OK

    Success.

    Example Respone:

    HTTP/1.1 200 OK
    Content-Type: application/vnd.api+json
    Preference-Applied: profile=preview
    
    {
      "data": {
        "attributes": {
          "resource-additions": 0,
          "resource-changes": 1,
          "resource-destructions": 0,
          "status": "finished",
          "status-timestamps": {
            "finished-at": "2020-03-11T00:37:37Z",
            "queued-at": "2020-03-11T00:37:33Z",
            "started-at": "2020-03-11T00:37:34Z"
          }
        },
        "id": "apply-spu6782ukhum1kg",
        "links": {
          "self": "https://my.scalr.io/api/iacp/v3/applies/apply-spu6782ukhum1kg",
          "output": "https://my.scalr.io/api/iacp/v3/blobs/eyJhbGciOiJQQkVTMi1IUzUxMitBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwicDJjIjo4MTkyLCJwMnMiOiI0a1N6dG9DaGJBOW9YdE1LSHFJVnpRIn0.cWDFB1elRHQtPT9MYKUO2RYBiQVyFI1iYlfcP8TlWfXf6_59Z1e9OOHmeGw7jijKa5rbpPPDejcYEiaTb29qvFBG-v0CjgoP.gRv_VcQJLxvdds91-O6LZQ.5JAefkr7xP-G_S-BJQt-MysPX6ioVPIPHem94KXhOH_mTbrMaPzCqB95WmcNIgsFSPZe6KplaUuqeiduQBQZiL1eIxfq0Sbo1iJqUB-NUJ3jpX5UclxOOpfnbQ6GLQus.kCLZjZdRfDlQ9_HmQ6Y6vSEbuXuh5m86VSG7dJVat4A"
        },
        "relationships": {},
        "type": "applies"
      },
      "included": null,
      "meta": null
    }
    

  • 403 Forbidden – Apply not found or user unauthorized to perform action.

  • 4XX – Client error.

  • 5XX – Server error.

Apply Log

GET /api/iacp/v3/applies/{apply}/output

Download the raw output of the terraform apply stage.

Parameters
  • apply (string) – The ID of the apply. Obtain it from the Get a Workspace endpoint.

Example Request:

GET /api/iacp/v3/applies/{apply}/output HTTP/1.1
Host: my.scalr.io
Prefer: profile=preview
Status Codes
  • 200 OK

  • 302 Found – The location of the temporary download link.

  • 404 Not Found – Apply not found or user unauthorized to perform action.

  • 4XX – Client error.

  • 5XX – Server error.