Skip to main content

HashiCorp Terraform

This Integration is part of the HashiCorp Terraform Pack.#

Supported versions

Supported Cortex XSOAR versions: 6.10.0 and later.

Hashicorp Terraform provide infrastructure automation to provision and manage resources in any cloud or data center with Terraform. This integration was integrated and tested with version v1.4.4 of HashicorpTerraform.

Configure HashiCorp Terraform in Cortex#

ParameterDescriptionRequired
Server URLTrue
API TokenThe API Key to use for connection.True
Default Organization NameThere is an option to override with a command input parameter. If not provided, policy commands should require the organization name.False
Default Workspace IDThere is an option to override with an input parameter. If not provided, some commands should require the workspace ID.False
Trust any certificate (not secure)False
Use system proxy settingsFalse

Commands#

You can execute these commands from the CLI, as part of an automation, or in a playbook. After you successfully execute a command, a DBot message appears in the War Room with the command details.

terraform-runs-list#


List runs in a workspace.

Base Command#

terraform-runs-list

Input#

Argument NameDescriptionRequired
workspace_idThe workspace ID to list runs for.Optional
run_idThe run ID to get a specific run.Optional
filter_statusThe run status to filter by. Possible values are: pending, fetching, fetching_completed, pre_plan_running, pre_plan_completed, queuing, plan_queued, planning, planned, cost_estimating, cost_estimated, policy_checking, policy_override, policy_soft_failed, policy_checked, confirmed, post_plan_running, post_plan_completed, planned_and_finished, planned_and_saved, apply_queued, applying, applied, discarded, errored, canceled, force_canceled.Optional
page_numberThe page number of the results to return. Default is 1.Optional
page_sizeThe number of results to return per page. Default is 20, maximum is 100.Optional

Context Output#

PathTypeDescription
Terraform.Run.data.idStringThe run ID.
Terraform.Run.data.attributes.statusStringThe run status.
Terraform.Run.data.relationships.plan.data.idStringThe plan ID.
Terraform.Run.data.attributes.status-timestamps.planned-atDateThe datetime the plan was planned.
Terraform.Run.data.typeStringTHe run type.
Terraform.Run.data.attributes.actions.is-cancelableBooleanFlag indicating whether the Terraform run can be canceled.
Terraform.Run.data.attributes.actions.is-confirmableBooleanFlag indicating whether the Terraform run can be confirmed.
Terraform.Run.data.attributes.actions.is-discardableBooleanFlag indicating whether the Terraform run can be discarded.
Terraform.Run.data.attributes.actions.is-force-cancelableBooleanFlag indicating whether the Terraform run can be force-canceled.
Terraform.Run.data.attributes.canceled-atUnknownTimestamp indicating when the Terraform run was canceled.
Terraform.Run.data.attributes.created-atDateTimestamp indicating when the Terraform run was created.
Terraform.Run.data.attributes.has-changesBooleanFlag indicating whether there are changes in the Terraform run.
Terraform.Run.data.attributes.auto-applyBooleanFlag indicating whether auto-apply is enabled for the Terraform run.
Terraform.Run.data.attributes.allow-empty-applyBooleanFlag indicating whether empty apply is allowed for the Terraform run.
Terraform.Run.data.attributes.allow-config-generationBooleanFlag indicating whether configuration generation is allowed for the Terraform run.
Terraform.Run.data.attributes.is-destroyBooleanFlag indicating whether the Terraform run is a destroy operation.
Terraform.Run.data.attributes.messageStringText message associated with the Terraform run.
Terraform.Run.data.attributes.plan-onlyBooleanFlag indicating whether the Terraform run is for planning only.
Terraform.Run.data.attributes.sourceStringSource of the Terraform run.
Terraform.Run.data.attributes.status-timestamps.plan-queueable-atDateTimestamp indicating when the Terraform run is queueable in the plan stage.
Terraform.Run.data.attributes.trigger-reasonStringReason for triggering the Terraform run.
Terraform.Run.data.attributes.target-addrsUnknownTarget addresses associated with the Terraform run.
Terraform.Run.data.attributes.permissions.can-applyBooleanFlag indicating whether the user has permission to apply changes.
Terraform.Run.data.attributes.permissions.can-cancelBooleanFlag indicating whether the user has permission to cancel the Terraform run.
Terraform.Run.data.attributes.permissions.can-commentBooleanFlag indicating whether the user has permission to add comments.
Terraform.Run.data.attributes.permissions.can-discardBooleanFlag indicating whether the user has permission to discard the Terraform run.
Terraform.Run.data.attributes.permissions.can-force-executeBooleanFlag indicating whether the user has permission to force execute the Terraform run.
Terraform.Run.data.attributes.permissions.can-force-cancelBooleanFlag indicating whether the user has permission to force cancel the Terraform run.
Terraform.Run.data.attributes.permissions.can-override-policy-checkBooleanFlag indicating whether the user has permission to override policy checks.
Terraform.Run.data.attributes.refreshBooleanFlag indicating whether the Terraform run should perform a refresh.
Terraform.Run.data.attributes.refresh-onlyBooleanFlag indicating whether the Terraform run is for refresh only.
Terraform.Run.data.attributes.replace-addrsUnknownReplacement addresses associated with the Terraform run.
Terraform.Run.data.attributes.save-planBooleanFlag indicating whether the Terraform run plan should be saved.
Terraform.Run.data.attributes.variablesUnknownVariables associated with the Terraform run.
Terraform.Run.data.relationships.apply.data.idStringThe apply ID of the run.
Terraform.Run.data.relationships.commentsStringRelationship information for comments associated with the Terraform run.
Terraform.Run.data.relationships.configuration-versionStringRelationship information for the Terraform configuration version associated with the run.
Terraform.Run.data.relationships.cost-estimateStringRelationship information for cost estimates associated with the Terraform run.
Terraform.Run.data.relationships.created-byStringRelationship information for the user who created the Terraform run.
Terraform.Run.data.relationships.input-state-versionStringRelationship information for the input state version associated with the Terraform run.
Terraform.Run.data.relationships.run-eventsStringRelationship information for events associated with the Terraform run.
Terraform.Run.data.relationships.policy-checksStringRelationship information for policy checks associated with the Terraform run.
Terraform.Run.data.relationships.workspaceStringRelationship information for the Terraform workspace associated with the run.
Terraform.Run.data.relationships.workspace-run-alertsStringRelationship information for alerts associated with the Terraform workspace run.
Terraform.Run.data.links.selfStringLink to the Terraform run data.

Command example#

!terraform-runs-list

Context Example#

{
"Terraform": {
"Run": {
"data": [
{
"attributes": {
"actions": {
"is-cancelable": false,
"is-confirmable": true,
"is-discardable": true,
"is-force-cancelable": false
},
"allow-config-generation": false,
"allow-empty-apply": false,
"auto-apply": false,
"canceled-at": null,
"created-at": "2023-12-17T10:23:43.258Z",
"has-changes": true,
"is-destroy": false,
"message": "Triggered via UI",
"permissions": {
"can-apply": true,
"can-cancel": true,
"can-comment": true,
"can-discard": true,
"can-force-cancel": true,
"can-force-execute": true,
"can-override-policy-check": true
},
"plan-only": false,
"refresh": true,
"refresh-only": false,
"replace-addrs": [
"fakewebservices_load_balancer.primary_lb"
],
"save-plan": false,
"source": "tfe-ui",
"status": "planned",
"status-timestamps": {
"plan-queueable-at": "2023-12-17T10:23:43+00:00",
"plan-queued-at": "2023-12-17T10:23:43+00:00",
"planned-at": "2023-12-17T10:23:52+00:00",
"planning-at": "2023-12-17T10:23:48+00:00",
"queuing-at": "2023-12-17T10:23:43+00:00"
},
"target-addrs": null,
"terraform-version": "1.4.4",
"trigger-reason": "manual",
"variables": []
},
"id": "run-8wpCneWr4TLSzfat",
"links": {
"self": "/api/v2/runs/run-8wpCneWr4TLSzfat"
},
"relationships": {
"apply": {
"data": {
"id": "apply-uEYtCmrtg5MvjgTr",
"type": "applies"
},
"links": {
"related": "/api/v2/runs/run-8wpCneWr4TLSzfat/apply"
}
},
"comments": {
"data": [],
"links": {
"related": "/api/v2/runs/run-8wpCneWr4TLSzfat/comments"
}
},
"configuration-version": {
"data": {
"id": "cv-YDcZaBNiRbrdy1w1",
"type": "configuration-versions"
},
"links": {
"related": "/api/v2/runs/run-8wpCneWr4TLSzfat/configuration-version"
}
},
"created-by": {
"data": {
"id": "user-LR5kedWrdZXBWF71",
"type": "users"
},
"links": {
"related": "/api/v2/runs/run-8wpCneWr4TLSzfat/created-by"
}
},
"plan": {
"data": {
"id": "plan-T7zpGYFEioRfWEAq",
"type": "plans"
},
"links": {
"related": "/api/v2/runs/run-8wpCneWr4TLSzfat/plan"
}
},
"policy-checks": {
"data": [],
"links": {
"related": "/api/v2/runs/run-8wpCneWr4TLSzfat/policy-checks"
}
},
"run-events": {
"data": [
{
"id": "re-ga2h6eu41RqrmZRn",
"type": "run-events"
},
{
"id": "re-ciqzHkW3bDooRzcn",
"type": "run-events"
},
{
"id": "re-ENvbqnmE72YFj7Wq",
"type": "run-events"
},
{
"id": "re-xkz1fSTKM25GxkMk",
"type": "run-events"
}
],
"links": {
"related": "/api/v2/runs/run-8wpCneWr4TLSzfat/run-events"
}
},
"task-stages": {
"data": [],
"links": {
"related": "/api/v2/runs/run-8wpCneWr4TLSzfat/task-stages"
}
},
"workspace": {
"data": {
"id": "ws-ZTbNWsfXHRWRVNmE",
"type": "workspaces"
}
}
},
"type": "runs"
}
],
"links": {
"first": "https://app.terraform.io/api/v2/workspaces/ws-ZTbNWsfXHRWRVNmE/runs?page%5Bnumber%5D=1&page%5Bsize%5D=20",
"last": "https://app.terraform.io/api/v2/workspaces/ws-ZTbNWsfXHRWRVNmE/runs?page%5Bnumber%5D=1&page%5Bsize%5D=20",
"next": null,
"prev": null,
"self": "https://app.terraform.io/api/v2/workspaces/ws-ZTbNWsfXHRWRVNmE/runs?page%5Bnumber%5D=1&page%5Bsize%5D=20"
},
"meta": {
"pagination": {
"current-page": 1,
"next-page": null,
"page-size": 20,
"prev-page": null,
"total-count": 9,
"total-pages": 1
},
"status-counts": {
"applied": 1,
"apply-queued": 0,
"applying": 0,
"assessed": 0,
"assessing": 0,
"canceled": 2,
"confirmed": 0,
"cost-estimated": 0,
"cost-estimating": 0,
"discarded": 4,
"errored": 0,
"fetching": 0,
"fetching-completed": 0,
"pending": 0,
"plan-queued": 0,
"planned": 1,
"planned-and-finished": 4,
"planned-and-saved": 0,
"planning": 0,
"policy-checked": 0,
"policy-checking": 0,
"policy-override": 0,
"policy-soft-failed": 0,
"post-apply-completed": 0,
"post-apply-running": 0,
"post-plan-awaiting-decision": 0,
"post-plan-completed": 0,
"post-plan-running": 0,
"pre-apply-awaiting-decision": 0,
"pre-apply-completed": 0,
"pre-apply-running": 0,
"pre-plan-awaiting-decision": 0,
"pre-plan-completed": 0,
"pre-plan-running": 0,
"queuing": 0,
"queuing-apply": 0,
"total": 12
}
}
}
}
}

Human Readable Output#

Terraform Runs#

Plan idPlanned atRun idStatus
plan-T7zpGYFEioRfWEAq2023-12-17T10:23:52+00:00run-8wpCneWr4TLSzfatplanned
plan-1JUTBdedobs1Absf2023-12-11T11:35:35+00:00run-kMNQfAmoDr1k8eaTdiscarded
plan-21bfTFiDJ6Rz1VTZrun-jb2j5r3gBievUPfRcanceled
plan-twBdAcLwiGwuE7kt2023-12-11T11:29:38+00:00run-g7ihSa71hCV9yZt7discarded
plan-JEgrv5aBeNUDDRaA2023-12-11T11:12:04+00:00run-yCYvcx1ZEmmKGXnBdiscarded
plan-kJLmtoaywxkXM54P2023-12-11T09:11:48+00:00run-akCRvcJ6L5cQtAhcdiscarded
plan-ZunKDF28KpCyiZAn2023-12-10T07:10:08+00:00run-rpSjBkbhiKAfMuwXplanned_and_finished
plan-V4fvpvCzGQrsZikD2023-11-30T09:21:42+00:00run-Q2kS54r6pJjdyYfkplanned_and_finished
plan-ZYYZD69ESo16jENX2023-10-25T10:33:11+00:00run-wBdFQ6egn91GGRneapplied

terraform-run-action#


Perform an action on a Terraform run. The available actions are: apply, cancel, discard, force-cancel, force-execute.

Base Command#

terraform-run-action

Input#

Argument NameDescriptionRequired
run_idThe Terraform run ID to execute the action on.Required
actionThe action to execute on the Terraform run. Possible values are: apply, cancel, discard, force-cancel, force-execute.Required
commentAn optional comment to associate with the action. Not available for the action "force-execute".Optional

Context Output#

There is no context output for this command.

Command example#

!terraform-run-action run_id=run-8wpCneWr4TLSzfat action="discard" comment="test comment"

Human Readable Output#

Successfully queued an discard request for run id run-8wpCneWr4TLSzfat

terraform-plan-get#


Get the plan JSON file or the plan meta data.

Base Command#

terraform-plan-get

Input#

Argument NameDescriptionRequired
plan_idThe ID of the Terraform plan to retrieve.Required
json_outputWhether to return the plan as a JSON fileResult. Possible values are: true, false. Default is false.Optional

Context Output#

PathTypeDescription
Terraform.Plan.idStringThe plan ID.
Terraform.Plan.attributes.statusStringThe plan status.
Terraform.Plan.typeStringType of the Terraform plan data.
Terraform.Plan.attributes.has-changesBooleanFlag indicating whether the Terraform plan has changes.
Terraform.Plan.attributes.status-timestamps.started-atDateTimestamp indicating when the Terraform plan started.
Terraform.Plan.attributes.status-timestamps.finished-atDateTimestamp indicating when the Terraform plan finished.
Terraform.Plan.attributes.status-timestamps.agent-queued-atDateTimestamp indicating when the Terraform plan was queued for an agent.
Terraform.Plan.attributes.log-read-urlStringURL for reading the Terraform plan log.
Terraform.Plan.attributes.resource-additionsNumberNumber of resource additions in the Terraform plan.
Terraform.Plan.attributes.resource-changesNumberNumber of resource changes in the Terraform plan.
Terraform.Plan.attributes.resource-destructionsNumberNumber of resource destructions in the Terraform plan.
Terraform.Plan.attributes.resource-importsNumberNumber of resource imports in the Terraform plan.
Terraform.Plan.attributes.structured-run-output-enabledBooleanFlag indicating whether structured run output is enabled in the Terraform plan.
Terraform.Plan.attributes.generated-configurationBooleanFlag indicating whether the Terraform plan has generated configuration.
Terraform.Plan.attributes.actions.is-exportableBooleanFlag indicating whether the Terraform plan is exportable.
Terraform.Plan.attributes.execution-details.modeStringExecution mode details for the Terraform plan.
Terraform.Plan.attributes.permissions.can-exportBooleanFlag indicating whether the user has permission to export the Terraform plan.
Terraform.Plan.relationships.state-versions.dataUnknownRelationship information for state versions associated with the Terraform plan.
Terraform.Plan.relationships.exports.dataUnknownRelationship information for exports associated with the Terraform plan.
Terraform.Plan.links.selfStringLink to the Terraform plan data.
Terraform.Plan.links.json-outputStringLink to the JSON output of the Terraform plan.
Terraform.Plan.links.json-output-redactedStringLink to the redacted JSON output of the Terraform plan.
Terraform.Plan.links.json-schemaStringLink to the JSON schema of the Terraform plan.

Command example#

!terraform-plan-get plan_id=plan-V4fvpvCzGQrsZikD

Context Example#

{
"Terraform": {
"Plan": {
"attributes": {
"actions": {
"is-exportable": true
},
"execution-details": {
"mode": "remote"
},
"generated-configuration": false,
"has-changes": false,
"log-read-url": "url",
"permissions": {
"can-export": true
},
"resource-additions": 0,
"resource-changes": 0,
"resource-destructions": 0,
"resource-imports": 0,
"status": "finished",
"status-timestamps": {
"agent-queued-at": "2023-11-30T09:21:33+00:00",
"finished-at": "2023-11-30T09:21:41+00:00",
"started-at": "2023-11-30T09:21:37+00:00"
},
"structured-run-output-enabled": true
},
"id": "plan-V4fvpvCzGQrsZikD",
"links": {
"json-output": "/api/v2/plans/plan-V4fvpvCzGQrsZikD/json-output",
"json-output-redacted": "/api/v2/plans/plan-V4fvpvCzGQrsZikD/json-output-redacted",
"json-schema": "/api/v2/plans/plan-V4fvpvCzGQrsZikD/json-schema",
"self": "/api/v2/plans/plan-V4fvpvCzGQrsZikD"
},
"relationships": {
"exports": {
"data": []
},
"state-versions": {
"data": []
}
},
"type": "plans"
}
}
}

Human Readable Output#

Terraform Plan#

Agent Queued atPlan idStatus
2023-11-30T09:21:33+00:00plan-V4fvpvCzGQrsZikDfinished

Command example#

!terraform-plan-get plan_id=plan-V4fvpvCzGQrsZikD json_output="true"

Context Example#

{
"InfoFile": {
"EntryID": "375@03d8b507-a516-4959-8133-979b2d80a807",
"Extension": "json",
"Info": "application/json",
"Name": "plan-V4fvpvCzGQrsZikD.json",
"Size": 3686,
"Type": "JSON data"
}
}

Human Readable Output#

terraform-policies-list#


List the policies for an organization or get a specific policy.

Base Command#

terraform-policies-list

Input#

Argument NameDescriptionRequired
organization_nameThe name of the organization.Optional
policy_kindIf specified, restricts results to those with the matching policy kind value. Possible values are: sentinel, opa.Optional
policy_nameIf specified, search the organization's policies by name.Optional
policy_idIf specified, get the specific policy.Optional

Context Output#

PathTypeDescription
Terraform.Policy.idStringThe policy ID.
Terraform.Policy.typeStringThe policy type.
Terraform.Policy.attributes.nameStringName of the Terraform policy.
Terraform.Policy.attributes.descriptionUnknownDescription of the Terraform policy.
Terraform.Policy.attributes.enforce.pathStringPath for enforcing the Terraform policy.
Terraform.Policy.attributes.enforce.modeStringEnforcement mode for the Terraform policy.
Terraform.Policy.attributes.policy-set-countNumberCount of policy sets associated with the Terraform policy.
Terraform.Policy.attributes.updated-atDateTimestamp indicating when the Terraform policy was last updated.
Terraform.Policy.attributes.kindStringKind of the Terraform policy.
Terraform.Policy.attributes.enforcement-levelStringEnforcement level for the Terraform policy.
Terraform.Policy.relationships.organization.data.idStringUnique identifier for the organization associated with the Terraform policy.
Terraform.Policy.relationships.organization.data.typeStringType of the organization associated with the Terraform policy.
Terraform.Policy.relationships.policy-sets.data.idStringThe IDs of the policy sets that contain this policy.
Terraform.Policy.relationships.policy-sets.data.typeStringType of the policy sets associated with the Terraform policy.
Terraform.Policy.links.selfStringLink to the Terraform policy data.
Terraform.Policy.links.uploadStringLink for uploading the Terraform policy.
Terraform.Policy.links.downloadStringLink for downloading the Terraform policy.
Terraform.Policy.links.selfStringLink to the Terraform policy.
Terraform.Policy.links.firstStringLink to the first page of Terraform policies.
Terraform.Policy.links.prevUnknownLink to the previous page of Terraform policies.
Terraform.Policy.links.nextUnknownLink to the next page of Terraform policies.
Terraform.Policy.links.lastStringLink to the last page of Terraform policies.
Terraform.Policy.meta.pagination.current-pageNumberCurrent page number in the pagination of Terraform policies.
Terraform.Policy.meta.pagination.page-sizeNumberNumber of policies displayed per page in pagination.
Terraform.Policy.meta.pagination.prev-pageUnknownPrevious page number in the pagination of Terraform policies.
Terraform.Policy.meta.pagination.next-pageUnknownNext page number in the pagination of Terraform policies.
Terraform.Policy.meta.pagination.total-pagesNumberTotal number of pages in the pagination of Terraform policies.
Terraform.Policy.meta.pagination.total-countNumberTotal count of Terraform policies.

Command example#

!terraform-policies-list

Context Example#

{
"Terraform": {
"Policy": {
"attributes": {
"description": null,
"enforce": [
{
"mode": "hard-mandatory",
"path": "nat-policies.sentinel"
}
],
"enforcement-level": "hard-mandatory",
"kind": "sentinel",
"name": "nat-policies",
"policy-set-count": 1,
"updated-at": "2023-11-14T18:12:36.702Z"
},
"id": "pol-ycCqXorxsFjaH5aK",
"links": {
"download": "/api/v2/policies/pol-ycCqXorxsFjaH5aK/download",
"self": "/api/v2/policies/pol-ycCqXorxsFjaH5aK",
"upload": "/api/v2/policies/pol-ycCqXorxsFjaH5aK/upload"
},
"relationships": {
"organization": {
"data": {
"id": "example-org-40dc3b",
"type": "organizations"
}
},
"policy-sets": {
"data": [
{
"id": "polset-hc2bvqDW8YRgHEt8",
"type": "policy-sets"
}
]
}
},
"type": "policies"
}
}
}

Human Readable Output#

Terraform Policies#

KindOrganization idPolicy Set idsPolicy idPolicy name
sentinelexample-org-40dc3bpolset-hc2bvqDW8YRgHEt8pol-ycCqXorxsFjaH5aKnat-policies

terraform-policy-set-list#


List the policy sets for an organization or get a specific policy set.

Base Command#

terraform-policy-set-list

Input#

Argument NameDescriptionRequired
organization_nameThe name of the organization.Optional
policy_set_idIf specified, get the specific policy set.Optional
versionedAllows filtering policy sets based on whether they are versioned, or use individual policy relationships. A true value returns versioned sets, and a false value returns sets with individual policy relationships. If omitted, all policy sets are returned. Possible values are: true, false.Optional
policy_set_kindIf specified, restricts results to those with the matching policy kind value. Possible values are: sentinel, opa.Optional
includeEnables you to include related resource data. Value must be a comma-separated list containing one or more projects, workspaces, workspace-exclusions, policies, newest_version, or current_version.Optional
policy_set_nameAllows searching the organization's policy sets by name.Optional
page_numberThe page number of the results to return. Default is 1.Optional
page_sizeThe number of results to return per page. Default is 20, maximum is 100.Optional

Context Output#

PathTypeDescription
Terraform.PolicySet.idStringThe policy set ID.
Terraform.PolicySet.typeStringThe policy set type.
Terraform.PolicySet.attributes.nameStringName of the Terraform policy set.
Terraform.PolicySet.attributes.descriptionUnknownDescription of the Terraform policy set.
Terraform.PolicySet.attributes.globalBooleanFlag indicating whether the Terraform policy set is global.
Terraform.PolicySet.attributes.workspace-countNumberNumber of workspaces associated with the Terraform policy set.
Terraform.PolicySet.attributes.project-countNumberNumber of projects associated with the Terraform policy set.
Terraform.PolicySet.attributes.created-atDateTimestamp indicating when the Terraform policy set was created.
Terraform.PolicySet.attributes.updated-atDateTimestamp indicating when the Terraform policy set was last updated.
Terraform.PolicySet.attributes.kindStringKind of the Terraform policy set.
Terraform.PolicySet.attributes.agent-enabledBooleanFlag indicating whether the Terraform policy set has agents enabled.
Terraform.PolicySet.attributes.policy-countNumberNumber of policies associated with the Terraform policy set.
Terraform.PolicySet.attributes.versionedBooleanFlag indicating whether the Terraform policy set is versioned.
Terraform.PolicySet.relationships.organization.data.idStringID of the organization associated with the Terraform policy set.
Terraform.PolicySet.relationships.organization.data.typeStringType of the organization associated with the Terraform policy set.
Terraform.PolicySet.relationships.policies.data.idStringID of the policies associated with the Terraform policy set.
Terraform.PolicySet.relationships.policies.data.typeStringType of the policies associated with the Terraform policy set.
Terraform.PolicySet.relationships.workspaces.data.idStringID of the workspaces associated with the Terraform policy set.
Terraform.PolicySet.relationships.workspaces.data.typeStringType of the workspaces associated with the Terraform policy set.
Terraform.PolicySet.relationships.projects.data.idStringRelationship information for projects associated with the Terraform policy set.
Terraform.PolicySet.relationships.workspace-exclusions.dataUnknownRelationship information for workspace exclusions associated with the Terraform policy set.
Terraform.PolicySet.links.selfStringLink to the Terraform policy set data.
Terraform.PolicySet.links.selfStringLink to the Terraform policy set.
Terraform.PolicySet.links.firstStringLink to the first page of Terraform policy sets.
Terraform.PolicySet.links.prevUnknownLink to the previous page of Terraform policy sets.
Terraform.PolicySet.links.nextUnknownLink to the next page of Terraform policy sets.
Terraform.PolicySet.links.lastStringLink to the last page of Terraform policy sets.
Terraform.PolicySet.meta.pagination.current-pageNumberCurrent page number in the pagination of Terraform policy sets.
Terraform.PolicySet.meta.pagination.page-sizeNumberNumber of items per page in the pagination of Terraform policy sets.
Terraform.PolicySet.meta.pagination.prev-pageUnknownLink to the previous page in the pagination of Terraform policy sets.
Terraform.PolicySet.meta.pagination.next-pageUnknownLink to the next page in the pagination of Terraform policy sets.
Terraform.PolicySet.meta.pagination.total-pagesNumberTotal number of pages in the pagination of Terraform policy sets.
Terraform.PolicySet.meta.pagination.total-countNumberTotal number of Terraform policy sets.

Command example#

!terraform-policy-set-list

Context Example#

{
"Terraform": {
"PolicySet": {
"attributes": {
"agent-enabled": false,
"created-at": "2023-11-08T11:25:06.196Z",
"description": null,
"global": false,
"kind": "sentinel",
"name": "test-policy-set",
"policy-count": 1,
"project-count": 0,
"updated-at": "2023-11-08T11:25:06.196Z",
"versioned": false,
"workspace-count": 1
},
"id": "polset-hc2bvqDW8YRgHEt8",
"links": {
"self": "/api/v2/policy-sets/polset-hc2bvqDW8YRgHEt8"
},
"relationships": {
"organization": {
"data": {
"id": "example-org-40dc3b",
"type": "organizations"
}
},
"policies": {
"data": [
{
"id": "pol-ycCqXorxsFjaH5aK",
"type": "policies"
}
]
},
"projects": {
"data": []
},
"workspace-exclusions": {
"data": []
},
"workspaces": {
"data": [
{
"id": "ws-u7kVixWpJYWiERMG",
"type": "workspaces"
}
]
}
},
"type": "policy-sets"
}
}
}

Human Readable Output#

Terraform Policy Sets#

OrganizationPolicies idsPolicy Set namePolicy set idWorkspaces
example-org-40dc3bpol-ycCqXorxsFjaH5aKtest-policy-setpolset-hc2bvqDW8YRgHEt8ws-u7kVixWpJYWiERMG

terraform-policies-checks-list#


List the policy checks for a Terraform run.

Base Command#

terraform-policies-checks-list

Input#

Argument NameDescriptionRequired
run_idThe run ID to list results for.Optional
policy_check_idThe policy check ID to retrieve details for.Optional
page_numberThe page number of the results to return. Default is 1.Optional
page_sizeThe number of results to return per page. Default is 20, maximum is 100.Optional

Context Output#

PathTypeDescription
Terraform.PolicyCheck.idStringThe policy check ID.
Terraform.PolicyCheck.typeStringType of the Terraform policy check data.
Terraform.PolicyCheck.attributes.result.resultBooleanOverall result of the Terraform policy check.
Terraform.PolicyCheck.attributes.result.passedNumberNumber of policy checks that passed.
Terraform.PolicyCheck.attributes.result.total-failedNumberTotal number of policy checks that failed.
Terraform.PolicyCheck.attributes.result.hard-failedNumberNumber of policy checks that resulted in hard failures.
Terraform.PolicyCheck.attributes.result.soft-failedNumberNumber of policy checks that resulted in soft failures.
Terraform.PolicyCheck.attributes.result.advisory-failedNumberNumber of policy checks that resulted in advisory failures.
Terraform.PolicyCheck.attributes.result.duration-msNumberDuration of the policy check execution in milliseconds.
Terraform.PolicyCheck.attributes.result.sentinelUnknownSentinel-specific result of the policy check.
Terraform.PolicyCheck.attributes.scopeStringScope or context of the Terraform policy check.
Terraform.PolicyCheck.attributes.statusStringStatus of the Terraform policy check.
Terraform.PolicyCheck.attributes.status-timestamps.queued-atDateTimestamp indicating when the Terraform policy check was queued.
Terraform.PolicyCheck.attributes.status-timestamps.soft-failed-atDateTimestamp indicating when the Terraform policy check encountered a soft failure.
Terraform.PolicyCheck.attributes.actions.is-overridableBooleanFlag indicating whether the Terraform policy check is overridable.
Terraform.PolicyCheck.attributes.permissions.can-overrideBooleanFlag indicating whether the user has permission to override the Terraform policy check.
Terraform.PolicyCheck.relationships.run.data.idStringUnique identifier for the Terraform run associated with the policy check.
Terraform.PolicyCheck.relationships.run.data.typeStringType of the Terraform run associated with the policy check.
Terraform.PolicyCheck.links.outputStringLink to the output of the Terraform policy check.

Command example#

!terraform-policies-checks-list run_id=run-8wpCneWr4TLSzfat

Human Readable Output#

Terraform Policy Checks#

No entries.