ExecuteTerragruntCommand
Run Terragrunt commands (init, plan, apply, destroy, run-all) in specified directories, with optional variables and AWS region settings, to manage infrastructure efficiently using Terraform workflows.
Instructions
Execute Terragrunt workflow commands against an AWS account.
This tool runs Terragrunt commands (init, plan, validate, apply, destroy, run-all) in the
specified working directory, with optional variables and region settings. Terragrunt extends
Terraform's functionality by providing features like remote state management, dependencies
between modules, and the ability to execute Terraform commands on multiple modules at once.
Parameters:
command: Terragrunt command to execute
working_directory: Directory containing Terragrunt files
variables: Terraform variables to pass
aws_region: AWS region to use
strip_ansi: Whether to strip ANSI color codes from output
include_dirs: Directories to include in a multi-module run
exclude_dirs: Directories to exclude from a multi-module run
run_all: Run command on all modules in subdirectories
terragrunt_config: Path to a custom terragrunt config file (not valid with run-all)
Returns:
A TerragruntExecutionResult object containing command output and status
Input Schema
Name | Required | Description | Default |
---|---|---|---|
aws_region | No | AWS region to use | |
command | Yes | Terragrunt command to execute | |
exclude_dirs | No | Directories to exclude from a multi-module run | |
include_dirs | No | Directories to include in a multi-module run | |
run_all | No | Run command on all modules in subdirectories | |
strip_ansi | No | Whether to strip ANSI color codes from output | |
terragrunt_config | No | Path to a custom terragrunt config file (not valid with run-all) | |
variables | No | Terraform variables to pass | |
working_directory | Yes | Directory containing Terragrunt 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": "Terragrunt command to execute",
"enum": [
"init",
"plan",
"validate",
"apply",
"destroy",
"output",
"run-all"
],
"title": "Command",
"type": "string"
},
"exclude_dirs": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Directories to exclude from a multi-module run",
"title": "Exclude Dirs"
},
"include_dirs": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Directories to include in a multi-module run",
"title": "Include Dirs"
},
"run_all": {
"default": false,
"description": "Run command on all modules in subdirectories",
"title": "Run All",
"type": "boolean"
},
"strip_ansi": {
"default": true,
"description": "Whether to strip ANSI color codes from output",
"title": "Strip Ansi",
"type": "boolean"
},
"terragrunt_config": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Path to a custom terragrunt config file (not valid with run-all)",
"title": "Terragrunt Config"
},
"variables": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Terraform variables to pass",
"title": "Variables"
},
"working_directory": {
"description": "Directory containing Terragrunt files",
"title": "Working Directory",
"type": "string"
}
},
"required": [
"command",
"working_directory"
],
"title": "execute_terragrunt_commandArguments",
"type": "object"
}