You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Device:deployment username$ terragrunt apply
16:00:23.455 INFO Downloading Terraform configurations from ../modules into ./.terragrunt-cache/MRg6BF8iUt6goQDYcu5OoqH_p3k/HfCJfD21cilNj44BjpZsrrU6T90
16:00:23.655 INFO terraform: Initializing the backend...
16:00:23.657 INFO terraform: Initializing provider plugins...
16:00:23.657 INFO terraform: Terraform has been successfully initialized!
16:00:23.657 INFO terraform:
16:00:23.657 INFO terraform: You may now begin working with Terraform. Try running "terraform plan" to see
16:00:23.657 INFO terraform: any changes that are required for your infrastructure. All Terraform commands
16:00:23.657 INFO terraform: should now work.
16:00:23.657 INFO terraform: If you ever set or change modules or backend configuration for Terraform,
16:00:23.657 INFO terraform: rerun this command to reinitialize your working directory. If you forget, other
16:00:23.657 INFO terraform: commands will detect it and remind you to do so if necessary.
16:00:23.661 INFO Executing hook: python_script
usage: my_script.py [-h] -a ARG1 -b ARG2 -c ARG3
my_script.py: error: the following arguments are required: -a/--arg1, -b/--arg2, -c/--arg3
16:00:24.059 ERROR Error running hook python_script with message: Failed to execute "./my_script.py --arg1 argument1 --arg2 argument2 --arg3 argument3" in ./.terragrunt-cache/MRg6BF8iUt6goQDYcu5OoqH_p3k/HfCJfD21cilNj44BjpZsrrU6T90/some-module
usage: my_script.py [-h] -a ARG1 -b ARG2 -c ARG3
my_script.py: error: the following arguments are required: -a/--arg1, -b/--arg2, -c/--arg3
exit status 2
16:00:24.059 ERROR Errors encountered running before_hooks. Not running 'terraform'.
16:00:24.060 ERROR error occurred:
* Failed to execute "./my_script.py --arg1 argument1 --arg2 argument2 --arg3 argument3" in ./.terragrunt-cache/MRg6BF8iUt6goQDYcu5OoqH_p3k/HfCJfD21cilNj44BjpZsrrU6T90/some-module
usage: my_script.py [-h] -a ARG1 -b ARG2 -c ARG3
my_script.py: error: the following arguments are required: -a/--arg1, -b/--arg2, -c/--arg3
exit status 2
Device:deployment username$ cd ./.terragrunt-cache/MRg6BF8iUt6goQDYcu5OoqH_p3k/HfCJfD21cilNj44BjpZsrrU6T90/some-module
Device:some-module username$ ./my_script.py --arg1 argument1 --arg2 argument2 --arg3 argument3
Namespace(arg1='argument1', arg2='argument2', arg3='argument3')
Versions
Terragrunt version: v0.72.5
Terraform version: v1.10.5 on darwin_arm64
Environment details (Ubuntu 20.04, Windows 10, etc.): macOS 15.1.1 (24B91)
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
When I run a Python script from before_hook and use the argparse library arguments are not parsed.
Steps To Reproduce
deployment/terragrunt.hcl:
modules/some-module/main.tf:
modules/some-module/my_script.py:
Expected behavior
Arguments are parsed.
Nice to haves
Versions
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: