ExecuteTerraformCommand
Run Terraform commands (init, plan, validate, apply, destroy) in a specified directory for AWS infrastructure. Supports custom variables, AWS region settings, and ANSI output stripping for clear results.
Instructions
Execute Terraform workflow commands against an AWS account.
This tool runs Terraform commands (init, plan, validate, apply, destroy) in the
specified working directory, with optional variables and region settings.
Parameters:
command: Terraform command to execute
working_directory: Directory containing Terraform files
variables: Terraform variables to pass
aws_region: AWS region to use
strip_ansi: Whether to strip ANSI color codes from output
Returns:
A TerraformExecutionResult object containing command output and status
Input Schema
Name | Required | Description | Default |
---|---|---|---|
aws_region | No | AWS region to use | |
command | Yes | Terraform command to execute | |
strip_ansi | No | Whether to strip ANSI color codes from output | |
variables | No | Terraform variables to pass | |
working_directory | Yes | Directory containing Terraform files |
Input Schema (JSON Schema)
{
"properties": {
"aws_region": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "AWS region to use",
"title": "Aws Region"
},
"command": {
"description": "Terraform command to execute",
"enum": [
"init",
"plan",
"validate",
"apply",
"destroy"
],
"title": "Command",
"type": "string"
},
"strip_ansi": {
"default": true,
"description": "Whether to strip ANSI color codes from output",
"title": "Strip Ansi",
"type": "boolean"
},
"variables": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Terraform variables to pass",
"title": "Variables"
},
"working_directory": {
"description": "Directory containing Terraform files",
"title": "Working Directory",
"type": "string"
}
},
"required": [
"command",
"working_directory"
],
"title": "execute_terraform_commandArguments",
"type": "object"
}