During terragrunt run -- plan -out=tf.plan.
inputs = { cli_args = get_terraform_cli_args() # ["plan", "-out=tf.plan"]}get_terraform_cli_args() --> list(string)get_terraform_cli_args returns the command first, then the arguments passed after it. Unlike get_terraform_command, it keeps the command as given, so apply -destroy returns ["apply", "-destroy"].
locals { saving_plan = anytrue([ for arg in get_terraform_cli_args() : startswith(arg, "-out=") ])}During terragrunt run -- plan -out=tf.plan.
inputs = { cli_args = get_terraform_cli_args() # ["plan", "-out=tf.plan"]}