### Sample Response for Listing Installations Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/github-app-installations This is a sample JSON response when listing GitHub App installations. It includes details like the installation's ID, name, and associated GitHub information. ```json { "data": [ { "id": "ghain-BYrbNeGQ8nAzKouu", "type": "github-app-installations", "attributes": { "name": "octouser", "installation-id": 54810170, "icon-url": "https://avatars.githubusercontent.com/u/29916665?v=4", "installation-type": "User", "installation-url": "https://github.com/settings/installations/54810170" } } ] } ``` ```json { "data": [ { "id": "ghain-BYrbNeGQ8nAzKouu", "type": "github-app-installations", "attributes": { "name": "octouser", "installation-id": 54810170, "icon-url": "https://avatars.githubusercontent.com/u/29916665?v=4", "installation-type": "User", "installation-url": "https://github.com/settings/installations/54810170" } } ] } ``` -------------------------------- ### Show Installation Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/github-app-installations Retrieves details for a specific GitHub App installation. ```APIDOC ## GET /github-app/installation/:gh_app_installation_id ### Description Retrieves details for a specific GitHub App installation using its ID. ### Method GET ### Endpoint /github-app/installation/:gh_app_installation_id ### Parameters #### Path Parameters - **:gh_app_installation_id** (string) - Required - The Github App Installation ID. ### Request Example ```bash curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ https://app.terraform.io/api/v2/github-app/installation/ghain-R4xmKTaxnhLFioUq ``` ### Response #### Success Response (200) - **data** (object) - The GitHub App installation object. - **id** (string) - The unique identifier for the GitHub App installation. - **type** (string) - The resource type, always "github-app-installations". - **attributes** (object) - Contains the attributes of the installation. - **name** (string) - The name of the GitHub organization or user. - **installation-id** (integer) - The GitHub installation ID. - **icon-url** (string) - The URL of the GitHub App icon. - **installation-type** (string) - The type of installation (e.g., "User", "Organization"). - **installation-url** (string) - The URL to the installation settings in GitHub. #### Response Example ```json { "data": { "id": "ghain-R4xmKTaxnhLFioUq", "type": "github-app-installations", "attributes": { "name": "octouser", "installation-id": 54810170, "icon-url": "https://avatars.githubusercontent.com/u/29916665?v=4", "installation-type": "User", "installation-url": "https://github.com/settings/installations/54810170" } } } ``` ``` -------------------------------- ### Example Custom Provider Path Source: https://developer.hashicorp.com/terraform/cloud-docs/workspaces/run/install-software An example of the expected file path for a custom provider binary, following the specified structure. ```shell terraform.d/plugins/my-host/my-namespace/custom/1.0.0/linux_amd64/terraform-provider-custom ``` -------------------------------- ### Create VCS-backed Component Configuration with Source Directory and Tag Prefix Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/private-registry/stack-component-configurations Example payload for sourcing a VCS-backed component configuration from a repository with a GitHub App installation, source directory, and tag prefix. ```json { "data": { "type": "registry-components", "attributes": { "name": "hashibank-app-security", "vcs-repo": { "identifier": "my-org/hashibank-monorepo", "github-app-installation-id": "ghain-abc123xyz456", "source-directory": "components/security", "tag-prefix": "security/" } } } } ``` -------------------------------- ### Sample Response for Showing a Specific Installation Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/github-app-installations This sample response shows the details of a single GitHub App installation, including its ID, name, and other relevant attributes. ```json { "data": { "id": "ghain-R4xmKTaxnhLFioUq", "type": "github-app-installations", "attributes": { "name": "octouser", "installation-id": 54810170, "icon-url": "https://avatars.githubusercontent.com/u/29916665?v=4", "installation-type": "User", "installation-url": "https://github.com/settings/installations/54810170" } } } ``` ```json { "data": { "id": "ghain-R4xmKTaxnhLFioUq", "type": "github-app-installations", "attributes": { "name": "octouser", "installation-id": 54810170, "icon-url": "https://avatars.githubusercontent.com/u/29916665?v=4", "installation-type": "User", "installation-url": "https://github.com/settings/installations/54810170" } } } ``` -------------------------------- ### Start Agent (Linux) Source: https://developer.hashicorp.com/terraform/cloud-docs/agents/hooks Starts the Terraform Cloud Agent binary on a Linux instance. ```bash tfc-agent ``` -------------------------------- ### Resource Example within Module Source: https://developer.hashicorp.com/terraform/cloud-docs/policy-enforcement/import-reference/tfstate Example of a null_resource defined within a module. ```HCL resource "null_resource" "foo" { triggers = { foo = "bar" } } ``` -------------------------------- ### Local File Resource Example Source: https://developer.hashicorp.com/terraform/cloud-docs/policy-enforcement/import-reference/tfconfig An example of a local_file resource block used to demonstrate configuration access. ```hcl resource "local_file" "accounts" { content = "some text" filename = "${var.subdomain}.${var.domain}/accounts.txt" } ``` -------------------------------- ### Example Local File Resource Block for Config Access Source: https://developer.hashicorp.com/terraform/cloud-docs/policy-enforcement/import-reference/tfconfig This example demonstrates a local file resource block used to illustrate accessing specific configuration values like 'filename'. ```hcl resource "local_file" "accounts" { content = "some text" filename = "accounts.txt" } ``` -------------------------------- ### Module v2 Configuration Example Source: https://developer.hashicorp.com/terraform/cloud-docs/integrations/kubernetes/ops-v2-migration This example shows the v2 configuration for a Module CRD, specifying the module source, version, and associated workspace. ```yaml apiVersion: app.terraform.io/v1alpha2 kind: Module metadata: name: migration spec: name: operator module: source: app.terraform.io/org-name/module-name/provider version: 0.0.42 workspace: name: migration ``` ```yaml apiVersion: app.terraform.io/v1alpha2 kind: Module metadata: name: migration spec: name: operator module: source: app.terraform.io/org-name/module-name/provider version: 0.0.42 workspace: name: migration ``` -------------------------------- ### Sample Response for Get SSH Key Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/ssh-keys Example JSON response when successfully retrieving an SSH key's metadata. ```json { "data": { "attributes": { "name": "SSH Key" }, "id": "sshkey-GxrePWre1Ezug7aM", "links": { "self": "/api/v2/ssh-keys/sshkey-GxrePWre1Ezug7aM" }, "type": "ssh-keys" } } ``` ```json { "data": { "attributes": { "name": "SSH Key" }, "id": "sshkey-GxrePWre1Ezug7aM", "links": { "self": "/api/v2/ssh-keys/sshkey-GxrePWre1Ezug7aM" }, "type": "ssh-keys" } } ``` -------------------------------- ### Terraform Configuration for Example Resources Source: https://developer.hashicorp.com/terraform/cloud-docs/policy-enforcement/import-reference/tfplan Defines two null_resource instances, where 'bar' depends on the 'id' of 'foo'. This setup is used to demonstrate the 'computed' attribute in policy. ```terraform resource "null_resource" "foo" { triggers = { foo = "bar" } } resource "null_resource" "bar" { triggers = { foo_id = "${null_resource.foo.id}" } } ``` -------------------------------- ### Flash Message Example Source: https://developer.hashicorp.com/terraform/cloud-docs/agents/logging Flash Messages are used by HashiCorp to communicate important or breaking changes to agents. They are emitted when new messages are added or when an agent starts for the first time. ```text 2021-09-22T15:20:59.269Z [WARN] notice: A breaking change is incoming. ``` ```text 2021-09-22T15:20:59.269Z [WARN] notice: A breaking change is incoming. ``` -------------------------------- ### Retrieve VCS-backed Component Configuration Details Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/private-registry/stack-component-configurations Example response body returning the details of a VCS-backed component configuration. ```json { "data": { "id": "comp-UnpBkfLQJZUXARc6", "type": "registry-components", "attributes": { "name": "hashibank-app-security", "namespace": "my-organization", "status": "completed", "created-at": "2024-12-03T10:31:53Z", "updated-at": "2024-12-03T10:31:53Z", "version-statuses": [ { "version": "1.0.0", "status": "completed" } ], "vcs-repo": { "identifier": "my-org/hashibank-app-security", "display-identifier": "my-org/hashibank-app-security", "source-directory": null, "tag-prefix": null, "oauth-token-id": "ot-eNzYfKyB11MMTqEx" } }, "relationships": { "organization": { "data": { "id": "org-rT5Smhs7tBfjGnsZ", "type": "organizations" } }, "registry-component-versions": { "links": { "related": "/api/v2/registry-components/comp-UnpBkfLQJZUXARc6/versions" } } }, "links": { "self": "/api/v2/registry-components/comp-UnpBkfLQJZUXARc6" } } } ``` -------------------------------- ### Free Feature Set Example Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/feature-sets This JSON object represents the 'Free' feature set. It includes details on resource limits, available features like cost estimation and policy enforcement, and tier information. This is suitable for users starting with Terraform Cloud. ```json { "data": [ { "id": "fs-GN3kSR1GqWNfcFaW", "type": "feature-sets", "attributes": { "assessments": false, "audit-logging": false, "cost-estimation": true, "cost": 0, "default-agents-ceiling": 1, "default-runs-ceiling": 1, "description": "Free 500 managed resources, then downgrade to limited features", "global-run-tasks": false, "identifier": "free_standard", "is-current": true, "is-free-tier": true, "module-tests-generation": false, "name": "Free", "no-code-modules": false, "plan": null, "policy-enforcement": true, "policy-limit": null, "policy-mandatory-enforcement-limit": null, "policy-set-limit": null, "private-networking": true, "private-policy-agents": false, "private-run-tasks": false, "private-vcs": false, "run-task-limit": null, "run-task-mandatory-enforcement-limit": null, "run-task-workspace-limit": null, "run-tasks": true, "self-serve-billing": true, "sentinel": true, "sso": true, "teams": false, "user-limit": null, "versioned-policy-set-limit": null } } ``` -------------------------------- ### Sample Response for Creating Configuration Version Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/private-registry/tests This is a sample JSON response received after successfully creating a configuration version for a private module test run. ```json { "data": { "id": "cv-aaady7niJMY1wAvx", "type": "configuration-versions", "attributes": { "auto-queue-runs": true, "error": null, "error-message": null, "source": "tfe-api", "speculative": false, "status": "pending", "status-timestamps": {}, "changed-files": [], "provisional": false, "upload-url": "https://archivist.terraform.io/v1/object/dmF1bHQ6djM6eFliQ0l1ZEhNUDRMZmdWeExoYWZ1WnFwaCtYQUFSQjFaWVcySkEyT0tyZTZXQ0hjN3ZYQkFvbkJHWkg2Y0U2MDRHRXFvQVl6cUJqQzJ0VkppVHBXTlJNWmpVc1ZTekg5Q1hMZ0hNaUpNdUhib1hGS1RpT3czRGdRaWtPZFZ3VWpDQ1U0S2dhK2xLTUQ2ZFZDaUZ3SktiNytrMlpoVHd0cXdGVHIway8zRkFmejdzMSt0Rm9TNFBTV3dWYjZUTzJVNE1jaW9UZ2VKVFJNRnUvbjBudUp4U0l6VzFDYkNzVVFsb2VFbC9DRFlCTWFsbXBMNzZLUGQxeTJHb09ZTkxHL1d2K1NtcmlEQXptZTh1Q1BwR1dhbVBXQTRiREdlTkI3Qyt1YTRRamFkRzBWYUg3NE52TGpqT1NKbzFrZ3J3QmxnMGhHT3VaTHNhSmo0eXpv" }, "relationships": { "ingress-attributes": { "data": null, "links": { "related": "/api/v2/configuration-versions/cv-aaady7niJMY1wAvx/ingress-attributes" } } }, "links": { "self": "/api/v2/configuration-versions/cv-aaady7niJMY1wAvx" } } } ``` ```json { "data": { "id": "cv-aaady7niJMY1wAvx", "type": "configuration-versions", "attributes": { "auto-queue-runs": true, "error": null, "error-message": null, "source": "tfe-api", "speculative": false, "status": "pending", "status-timestamps": {}, "changed-files": [], "provisional": false, "upload-url": "https://archivist.terraform.io/v1/object/dmF1bHQ6djM6eFliQ0l1ZEhNUDRMZmdWeExoYWZ1WnFwaCtYQUFSQjFaWVcySkEyT0tyZTZXQ0hjN3ZYQkFvbkJHWkg2Y0U2MDRHRXFvQVl6cUJqQzJ0VkppVHBXTlJNWmpVc1ZTekg5Q1hMZ0hNaUpNdUhib1hGS1RpT3czRGdRaWtPZFZ3VWpDQ1U0S2dhK2xLTUQ2ZFZDaUZ3SktiNytrMlpoVHd0cXdGVHIway8zRkFmejdzMSt0Rm9TNFBTV3dWYjZUTzJVNE1jaW9UZ2VKVFJNRnUvbjBudUp4U0l6VzFDYkNzVVFsb2VFbC9DRFlCTWFsbXBMNzZLUGQxeTJHb09ZTkxHL1d2K1NtcmlEQXptZTh1Q1BwR1dhbVBXQTRiREdlTkI3Qyt1YTRRamFkRzBWYUg3NE52TGpqT1NKbzFrZ3J3QmxnMGhHT3VaTHNhSmo0eXpv" }, "relationships": { "ingress-attributes": { "data": null, "links": { "related": "/api/v2/configuration-versions/cv-aaady7niJMY1wAvx/ingress-attributes" } } }, "links": { "self": "/api/v2/configuration-versions/cv-aaady7niJMY1wAvx" } } } ``` -------------------------------- ### List Installations Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/github-app-installations Lists GitHub App installations available to the current user. Queries only return GitHub App Installations that the current user has access to within GitHub. ```APIDOC ## GET /github-app/installations ### Description Lists GitHub App installations available to the current user. Queries only return GitHub App Installations that the current user has access to within GitHub. ### Method GET ### Endpoint /github-app/installations ### Parameters #### Query Parameters - **filter[name]** (string) - Optional. If present, returns a list of available GitHub App installations that match the GitHub organization or login. - **filter[installation_id]** (integer) - Optional. If present, returns a list of available GitHub App installations that match the installation ID within GitHub. (Not HCP Terraform) ### Request Example ```bash curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ https://app.terraform.io/api/v2/github-app/installations ``` ### Response #### Success Response (200) - **data** (array) - An array of GitHub App installation objects. - **id** (string) - The unique identifier for the GitHub App installation. - **type** (string) - The resource type, always "github-app-installations". - **attributes** (object) - Contains the attributes of the installation. - **name** (string) - The name of the GitHub organization or user. - **installation-id** (integer) - The GitHub installation ID. - **icon-url** (string) - The URL of the GitHub App icon. - **installation-type** (string) - The type of installation (e.g., "User", "Organization"). - **installation-url** (string) - The URL to the installation settings in GitHub. #### Response Example ```json { "data": [ { "id": "ghain-BYrbNeGQ8nAzKouu", "type": "github-app-installations", "attributes": { "name": "octouser", "installation-id": 54810170, "icon-url": "https://avatars.githubusercontent.com/u/29916665?v=4", "installation-type": "User", "installation-url": "https://github.com/settings/installations/54810170" } } ] } ``` ``` -------------------------------- ### Show a Specific GitHub App Installation Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/github-app-installations Retrieve details for a specific GitHub App installation using its unique ID. This is useful for fetching information about a single installation. ```bash $ curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ https://app.terraform.io/api/v2/github-app/installation/ghain-R4xmKTaxnhLFioUq ``` ```bash $ curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ https://app.terraform.io/api/v2/github-app/installation/ghain-R4xmKTaxnhLFioUq ``` -------------------------------- ### Sample Request to Create a Provider Platform Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/private-registry/provider-versions-platforms This `curl` command demonstrates how to send a POST request to create a provider platform. It includes the necessary authorization header, content type, and the path to the payload JSON file. ```bash curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ --request POST \ --data @payload.json \ https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions/3.1.1/platforms ``` ```bash curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ --request POST \ --data @payload.json \ https://app.terraform.io/api/v2/organizations/hashicorp/registry-providers/private/hashicorp/aws/versions/3.1.1/platforms ``` -------------------------------- ### List GitHub App Installations Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/github-app-installations Use this endpoint to list all GitHub App installations available to the authenticated user. You can optionally filter by organization name or installation ID. ```bash $ curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ https://app.terraform.io/api/v2/github-app/installations ``` ```bash $ curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ https://app.terraform.io/api/v2/github-app/installations ``` -------------------------------- ### Create Pre-Plan Hook Script (Linux) Source: https://developer.hashicorp.com/terraform/cloud-docs/agents/hooks Creates an example executable pre-plan hook script that prints a message. ```bash #!/bin/bash echo "Example hook output." ``` -------------------------------- ### Create Provider Platform JSON Source: https://developer.hashicorp.com/terraform/cloud-docs/registry/publish-providers Create a JSON file defining the provider platform. Ensure 'os', 'arch', 'filename', and 'shasum' match your provider binary. ```json { "data": { "type": "registry-provider-version-platforms", "attributes": { "os": "linux", "arch": "amd64", "shasum": "f1d83b3e5a29bae471f9841a4e0153eac5bccedbdece369e2f6186e9044db64e", "filename": "terraform-provider-aws_5.14.0_linux_amd64.zip" } } } ``` -------------------------------- ### Module Block Example Source: https://developer.hashicorp.com/terraform/cloud-docs/policy-enforcement/import-reference/tfplan An example of a Terraform module block definition. ```hcl module "foo" { # ... } ``` ```hcl module "foo" { # ... } ``` -------------------------------- ### Sample Stack Deployment Steps Response Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/stacks/deployments This is a sample JSON response when listing Stack deployment steps. It includes details about the step's status, operation type, timestamps, and relationships to other resources. ```json { "data": [ { "id": "sds-c8qjj4urpyh1wFrU", "type": "stack-deployment-steps", "attributes": { "status": "pending_operator", "operation-type": "plan", "requires-state-lock": false, "created-at": "2025-09-10T21:22:31.577Z", "updated-at": "2025-09-11T17:38:13.903Z", "queued-at": "2025-09-10T21:22:31.606Z", "running-at": "2025-09-10T21:22:32.797Z", "pending-operator-at": "2025-09-10T21:22:39.862Z", "completed-at": null, "failed-at": null, "abandoned-at": null }, "relationships": { "stack-deployment-run": { "data": { "id": "sdr-qreEJHTfJ9i3qooa", "type": "stack-deployment-runs" } }, "stack-diagnostics": { "links": { "related": "/api/v2/stack-deployment-steps/sds-c8qjj4urpyh1wFrU/stack-diagnostics" }, "meta": { "count": 0 } }, "stack-approval": { "data": null } }, "links": { "self": "/api/v2/stack-deployment-steps/sds-c8qjj4urpyh1wFrU", "plan-description": "/api/v2/stack-deployment-steps/sds-c8qjj4urpyh1wFrU/artifacts?name=plan-description", "structured-log": "https://app.terraform.io/_archivist/v1/object/dmF1bHQ6djE6QUFxZHhyS2xHcjA0MzVvbWhXOTVXU1gwQW1MS2hVNiszcHRLd01RZWgxT3phMmdJMWo0RC8xT1liWGZBaFFhalF2NG11R3dmdndIdnBmWWsyeWQzYnlnUW1sYjdTRm5rM1BjMlN0dVFXZWJMbmtkeWVaamMvYkhMcjZzLytvVVpJc3NtVFpJSng5MVVrTmd3eWNKM2JWd1ZNUXVUZWR3bzRHSU5qb3JzWW5FeEE0WlJlTHJySFlQMzJhMmRaSUJKMU5GYy9kQUJwOCs3M1k1WEhNa0o1VTdPK1FwRmYwVThqdkx1eklNQzVuYXphOUVBRTZzYUlERk1Pc3JXWnpwRnFYR3BGTGZleGNNSE1RVE0yTGVseFhkd3M0Ymo5ZkV4RXVZTUdrR0ZId215d2U3SllwaGFhRkUvT2VRUTVlTmZoUGp1SklxVkhTZ05IRktlVDNCeEN3UVpCUDlHRnpveUwrWTZ6aW81ZVM1YUM0QVZvV1BUMDA0WkF4VmtwTDVRclVRPQ" } } ], "links": { "self": "https://app.terraform.io/api/v2/stack-deployment-runs/sdr-qreEJHTfJ9i3qooa/stack-deployment-steps?page%5Bnumber%5D=1&page%5Bsize%5D=20", "first": "https://app.terraform.io/api/v2/stack-deployment-runs/sdr-qreEJHTfJ9i3qooa/stack-deployment-steps?page%5Bnumber%5D=1&page%5Bsize%5D=20", "prev": null, "next": null, "last": "https://app.terraform.io/api/v2/stack-deployment-runs/sdr-qreEJHTfJ9i3qooa/stack-deployment-steps?page%5Bnumber%5D=1&page%5Bsize%5D=20" }, "meta": { "pagination": { "current-page": 1, "page-size": 20, "prev-page": null, "next-page": null, "total-pages": 1, "total-count": 1 } } } ``` -------------------------------- ### Sample API Request Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/private-registry/tests Demonstrates how to make a POST request to create a test run using curl, including authentication and content type headers. ```bash curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ --request POST \ --data @payload.json \ https://app.terraform.io/api/v2/organizations/my-organization/tests/registry-modules/private/my-organization/private/registry-provider/test-runs ``` ```bash curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ --request POST \ --data @payload.json \ https://app.terraform.io/api/v2/organizations/my-organization/tests/registry-modules/private/my-organization/private/registry-provider/test-runs ``` -------------------------------- ### Sample Response for Created Configuration Version Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/configuration-versions This JSON response shows the details of a newly created configuration version, including its ID, status, and the upload URL for configuration files. ```json { "data": { "id": "cv-UYwHEakurukz85nW", "type": "configuration-versions", "attributes": { "auto-queue-runs": true, "error": null, "error-message": null, "source": "tfe-api", "speculative":false, "status": "pending", "status-timestamps": {}, "upload-url": "https://archivist.terraform.io/v1/object/9224c6b3-2e14-4cd7-adff-ed484d7294c2", "provisional": false }, "relationships": { "ingress-attributes": { "data": null, "links": { "related": "/api/v2/configuration-versions/cv-UYwHEakurukz85nW/ingress-attributes" } } }, "links": { "self": "/api/v2/configuration-versions/cv-UYwHEakurukz85nW" } } } ``` ```json { "data": { "id": "cv-UYwHEakurukz85nW", "type": "configuration-versions", "attributes": { "auto-queue-runs": true, "error": null, "error-message": null, "source": "tfe-api", "speculative":false, "status": "pending", "status-timestamps": {}, "upload-url": "https://archivist.terraform.io/v1/object/9224c6b3-2e14-4cd7-adff-ed484d7294c2", "provisional": false }, "relationships": { "ingress-attributes": { "data": null, "links": { "related": "/api/v2/configuration-versions/cv-UYwHEakurukz85nW/ingress-attributes" } } }, "links": { "self": "/api/v2/configuration-versions/cv-UYwHEakurukz85nW" } } } ``` -------------------------------- ### Module Paths Value Example Source: https://developer.hashicorp.com/terraform/cloud-docs/policy-enforcement/import-reference/tfstate Example of the module_paths value, showing the root module and a nested module. ```HCL [ [], ["foo"], ] ``` -------------------------------- ### Create Pre-Plan Hook Script (Docker) Source: https://developer.hashicorp.com/terraform/cloud-docs/agents/hooks Creates an example pre-plan hook script within a Docker build context. ```bash cat < hooks/terraform-pre-plan #!/bin/bash echo "Example hook output." EOF ``` -------------------------------- ### Module Block for Module Paths Example Source: https://developer.hashicorp.com/terraform/cloud-docs/policy-enforcement/import-reference/tfplan An example of a Terraform module block used to illustrate the module_paths value. ```hcl module "foo" { # ... } ``` ```hcl module "foo" { # ... } ``` -------------------------------- ### Module Test Token Header Example Source: https://developer.hashicorp.com/terraform/cloud-docs/workspaces/dynamic-provider-credentials/workload-identity-tokens This is an example of the header section of a decoded module test workload identity token. ```json { "typ": "JWT", "alg": "RS256", "kid": "j-fFp9evPJAzV5I2_58HY5UvdCK6Q4LLB1rnPOUfQAk" } ``` ```json { "typ": "JWT", "alg": "RS256", "kid": "j-fFp9evPJAzV5I2_58HY5UvdCK6Q4LLB1rnPOUfQAk" } ``` -------------------------------- ### Sample cURL Request to Create Configuration Version Source: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/configuration-versions This cURL command demonstrates how to send a POST request to create a configuration version, including necessary headers and the payload file. ```bash curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ --request POST \ --data @payload.json \ https://app.terraform.io/api/v2/workspaces/ws-2Qhk7LHgbMrm3grF/configuration-versions ``` ```bash curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ --request POST \ --data @payload.json \ https://app.terraform.io/api/v2/workspaces/ws-2Qhk7LHgbMrm3grF/configuration-versions ``` -------------------------------- ### Accessing Specific Resource Instance Source: https://developer.hashicorp.com/terraform/cloud-docs/workspaces/policy-enforcement/import-reference/tfplan This example shows how to access a specific resource instance by its type, name, and count index. Note that square-bracket notation is required for the index. ```hcl tfplan.resources.aws_instance.foo[0] ``` -------------------------------- ### Example Subject Claim Source: https://developer.hashicorp.com/terraform/cloud-docs/registry/test/dynamic-credentials An example of a subject claim for a module test run, demonstrating how to reference a specific organization and module. ```text organization:my-org:module:terraform-aws-vpc:operation:test_run ``` -------------------------------- ### Module Paths Value Example Source: https://developer.hashicorp.com/terraform/cloud-docs/policy-enforcement/import-reference/tfplan An example showing the expected output for the module_paths value when a module 'foo' is present in the diff. ```hcl [ [], ["foo"], ] ``` ```hcl [ [], ["foo"], ] ```