Plans¶
The Plan resource¶
Provides details of a Terraform plan operation.
Key path
Description
type* (string)
Available values:plans
id (string)
attributes.execution-details (object)
Plan execution details.
attributes.has-changes (boolean)
Indicates if plan has proposed resource changes.
attributes.resource-additions (integer)
The number of new resources that will be added.
attributes.resource-changes (integer)
The number of resources that will be updated in place.
attributes.resource-destructions (integer)
The number of resources that will be destroyed.
attributes.status (string)
Available values:pending
,queued
,running
,finished
,canceled
,errored
,unreachable
The Plan’s current status.
Transient states:
pending
- Plan has been created but not yet queued.
queued
- Queued and waiting for capacity/and or quota to be available.
running
- Running.Final states:
canceled
- Plan canceled in some way.
errored
- An error occurred during the plan. Seeoutput
for details.
finished
- Plan completed successfully.
unreachable
- Plan will not be run.attributes.status-timestamps (object)
Date/Time of transition to each status that has occurred.
links.json-output (string)
URL to retrieve the JSON execution plan
links.output (string)
Link to download the raw output of the terraform plan.
links.self (string)
Get a Plan¶
-
GET
/api/iacp/v3/plans/{plan}
¶ Show details of a specific Terraform Plan stage.
- Parameters
plan (string) – The ID of the plan.
Example Request:
GET /api/iacp/v3/plans/{plan} 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": { "has-changes": true, "resource-additions": 10, "resource-changes": 0, "resource-destructions": 0, "status": "finished", "status-timestamps": { "finished-at": "2020-10-05T10:39:09Z", "queued-at": "2020-10-05T10:38:34Z", "started-at": "2020-10-05T10:38:38Z" } }, "id": "plan-t4djd75nc170hhg", "links": { "self": "https://my.scalr.io/api/iacp/v3/plans/plan-t4djd75nc170hhg", "output": "https://my.scalr.io/api/iacp/v3/blobs/eyJhbGciOiJQQkVTMi1IUzUxMitBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwicDJjIjo4MTkyLCJwMnMiOiI2UzllOVJGdGJjNnNpVmx5VllMY1lnIn0.DUal2j6Btnu9Ji7x6mw-gJ86Hnu80fxUqivacQHoTQgjPUxZh4dhkWNR_MjMJ8R69qOJBOugne4M2Vkg7Eqwu8JAJ9HYr43v.XusmYBeTnbO1vIH4HYf78w.E4qiD2CMSw8j9bY67i-4hq6GWJkfkKS8aYEIAUTKvGgrRF7MswpXozOgsejWr-vjLEEHJzOnQ3O929VVe9brG4xSXTxUsnwPy0um1De80kPt7mrZoiT9c_vhhEIIZjSC.weG6Pglv55efpn-haFrgTLPEPcoRC6Otwz4wyVkLuQM" }, "relationships": {}, "type": "plans" }, "included": null, "meta": null }
403 Forbidden – Plan not found or user unauthorized to perform action.
4XX – Client error.
5XX – Server error.
JSON Output¶
-
GET
/api/iacp/v3/plans/{plan}/json-output
¶ Download JSON formatted execution plan.
- Parameters
plan (string) – The ID of the plan. Obtain it from the Get a Workspace endpoint.
Example Request:
GET /api/iacp/v3/plans/{plan}/json-output HTTP/1.1 Host: my.scalr.io Prefer: profile=preview
- Status Codes
204 No Content – Plan has not yet completed.
307 Temporary Redirect – The location of the temporary download link.
404 Not Found – Plan not found or user unauthorized to perform action.
4XX – Client error.
5XX – Server error.
Plan Log¶
-
GET
/api/iacp/v3/plans/{plan}/output
¶ Download the raw output of the terraform plan stage.
- Parameters
plan (string) –
The ID of the plan. Obtain it from the Get a Workspace endpoint.
- Query Parameters
clean (string) – Strip ANSI escape codes.
Example Request:
GET /api/iacp/v3/plans/{plan}/output HTTP/1.1 Host: my.scalr.io Prefer: profile=preview
- Status Codes
200 OK – Plan log.
204 No Content – Plan has not yet completed or can’t be served.
302 Found – The location of the temporary download link.
404 Not Found – Plan not found or user unauthorized to perform action.
4XX – Client error.
5XX – Server error.
Sanitized JSON Output¶
-
GET
/api/iacp/v3/plans/{plan}/sanitized-json-output
¶ Download plan file in machine-readable format with sanitized sensitive values.
- Parameters
plan (string) –
The ID of the plan. Obtain it from the Get a Workspace endpoint.
Example Request:
GET /api/iacp/v3/plans/{plan}/sanitized-json-output HTTP/1.1 Host: my.scalr.io Prefer: profile=preview
- Status Codes
200 OK – Sanitized terraform json plan.
204 No Content – Plan has not yet completed or can’t be served.
307 Temporary Redirect – Redirects to JSON Output if the API server is not sure that the plan can be correctly sanitized and a user permissions allow to read sensitive plan values.
404 Not Found – Plan not found or user unauthorized to perform action.
4XX – Client error.
5XX – Server error.