Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement request: TERRAGRUNT_INCLUDE_MODULE_PREFIX strip pwd #2529

Open
bushong1 opened this issue Apr 14, 2023 · 2 comments · May be fixed by #2716
Open

Enhancement request: TERRAGRUNT_INCLUDE_MODULE_PREFIX strip pwd #2529

bushong1 opened this issue Apr 14, 2023 · 2 comments · May be fixed by #2716
Assignees
Labels
enhancement New feature or request

Comments

@bushong1
Copy link

It would be great if there were an option to strip the pwd from the output of TERRAGRUNT_INCLUDE_MODULE_PREFIX=1. It's great that now we can read the terraform output and easily figure out which module is running, but for systems that have a deep directory structure, it's easy for the output to get spammed across the terminal since it lists the whole pwd.

[/home/charles/working/customer/my-project-name/my-infrastructure-directory/some-subdirectory/this-environment/terraform-module-1] 
[/home/charles/working/customer/my-project-name/my-infrastructure-directory/some-subdirectory/this-environment/terraform-module-1] Initializing the backend...
[/home/charles/working/customer/my-project-name/my-infrastructure-directory/some-subdirectory/this-environment/terraform-module-1]  
[/home/charles/working/customer/my-project-name/my-infrastructure-directory/some-subdirectory/this-environment/terraform-module-2/submodule] 
[/home/charles/working/customer/my-project-name/my-infrastructure-directory/some-subdirectory/this-environment/terraform-module-2/submodule] Initializing the backend...
[/home/charles/working/customer/my-project-name/my-infrastructure-directory/some-subdirectory/this-environment/terraform-module-2/submodule] 

It would be great it the output were configurable to be just:

[./terraform-module-1] 
[./terraform-module-1] Initializing the backend...
[./terraform-module-1]  
[./terraform-module-2/submodule] 
[./terraform-module-2/submodule] Initializing the backend...
[./terraform-module-2/submodule] 
@denis256 denis256 added the enhancement New feature or request label Apr 17, 2023
@dhirschfeld
Copy link

I came here to request the same!

Tested to find the answer myself, it is the absolute path...

Yeah, it's the absolute path:

[/home/sysop/code/github/dhirschfeld/azure-infra-test/terraform/dev/network]

That takes up a lot of screen real-estate. It would be great if the path could be relative to the cwd - i.e. running in the dev folder that would be:

[./network]

Originally posted by @dhirschfeld in #2493 (comment)

@stv-io
Copy link

stv-io commented Jun 8, 2023

Bump!

This gist https://gist.github.com/antonbabenko/675049186e54b770b4789886d2056639#file-bash_profile attempts to do that, but doesn't completely work for me.

Also, it feels like this should be a native terragrunt cli implementation.

@denis256 denis256 self-assigned this Sep 15, 2023
@denis256 denis256 linked a pull request Sep 15, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

Successfully merging a pull request may close this issue.

4 participants