Terraform ACTION
Create Run
Creates a new run in Terraform. See the documentation
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Terraform account once, then configure and run Create Run from your backend or agent.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "terraform-create-run",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
terraform: { authProvisionId: "apn_xxxxxxx" },
orgId: "Organization",
workspaceId: "Workspace",
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "terraform-create-run",
"configured_props": {
"terraform": { "authProvisionId": "apn_xxxxxxx" },
"orgId": "Organization",
"workspaceId": "Workspace"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "terraform",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "terraform-create-run",
arguments: {
orgId: "Organization",
workspaceId: "Workspace",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
orgId Organization | string | Identifier of an organization Required Dynamic |
workspaceId Workspace | string | Identifier of a workspace Required Dynamic |
configurationVersion Configuration Version | string | Specifies the configuration version to use for this run. If the configuration-version object is omitted, the run will be created using the workspace's latest configuration version. Required Dynamic |
message Message | string | Specifies the message associated with this run. Optional |
allowEmptyApply Allow Empty Apply | boolean | Specifies whether Terraform can apply the run even when the plan contains no changes. Often used to upgrade state after upgrading a workspace to a new terraform version. Required |
allowConfigGeneration Allow Config Generation | boolean | Specifies whether Terraform can generate resource configuration when planning to import new resources. If false, import blocks without a corresponding resource block will error. Optional |
autoApply Auto Apply | boolean | Whether to automatically apply changes when a Terraform plan is successful. Defaults to the Auto Apply workspace setting. Optional |
isDestroy Is Destroy | boolean | Specifies whether this plan is a destroy plan that will destroy all provisioned resources. Mutually exclusive with refresh-only. Optional |
refresh Refresh | boolean | Specifies whether or not to refresh the state before a plan. Optional |
refreshOnly Refresh Only | boolean | Whether this run should refresh the state without modifying any resources. Mutually exclusive with is-destroy. Optional |
planOnly Plan Only | boolean | Specifies if this is a speculative, plan-only run that Terraform cannot apply. Often used in conjunction with terraform-version in order to test whether an upgrade would succeed. Optional |
savePlan Save Plan | boolean | Specifies if this should be a saved plan run. Terraform can apply saved plan runs, but they perform their plan and checks without becoming the workspace's current run (like a plan-only run), and will only become the current run if you confirm them for apply. When creating new configuration versions for saved plan runs, be sure to make them provisional Optional |
terraformVersion Terraform Version | string | Specifies the Terraform version to use in this run. Only valid for plan-only runs; must be a valid Terraform version available to the organization. Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- terraform-create-run
- Version
- 0.0.2
- App
- Terraform
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗