I am trying to deploy AWS Step Function using Terraform but the deployment is failing with the below error
Failed to execute "terraform init"
fork/exec /usr/local/bin/terraform: argument list too long
Terragrunt code I'm executing
terragrunt init --terragrunt-non-interactive -terragrunt-log-level error
terragrunt plan --terragrunt-non-interactive -terragrunt-log-level error
The problem is I have a step function which is of 10900 lines
Please provide me some help. Am I right in identifying the problem? or is there any other issue?
I am trying to deploy AWS Step Function using Terraform but the deployment is failing with the below error
Failed to execute "terraform init"
fork/exec /usr/local/bin/terraform: argument list too long
Terragrunt code I'm executing
terragrunt init --terragrunt-non-interactive -terragrunt-log-level error
terragrunt plan --terragrunt-non-interactive -terragrunt-log-level error
The problem is I have a step function which is of 10900 lines
Please provide me some help. Am I right in identifying the problem? or is there any other issue?
Share Improve this question edited Mar 18 at 4:12 Sathish Pandurangan asked Mar 17 at 9:55 Sathish PanduranganSathish Pandurangan 387 bronze badges 2- 2 There's probably something else you added to the command, I'm just guessing. Would you mind posting the exact command you are running in the terminal? – Marko E Commented Mar 17 at 10:33
- Do you mind adding the tf code you wrote? – Bert Cafecito Commented Mar 17 at 18:21
1 Answer
Reset to default 0I had the same issue as that of https://github/gruntwork-io/terragrunt/issues/2132
The problem was the step function's definition was getting as an command line argument which hit the kernel's limit of 128KB (ref)
Tweaked the solution posted in https://github/gruntwork-io/terragrunt/issues/2132#issuecomment-1188287900
Created a *.tfvars.json
file instead of *.tfvars
file using the generate function and the definition
variable gets created on the fly and this definition
is used by the parent terraform module.(ref)
generate "vars_input" {
path = "variables.auto.tfvars.json"
if_exists = "overwrite"
disable_signature = true
contents = <<EOF
{
"definition": ${file("${get_path_to_repo_root()}/step_function_file.json")}
}
EOF
}