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
A way to identity the after_hook trigger if hook can be triggered by multiple commands
Motivation
I am running an after_hook which executes on both commands plan and apply.
The hook starts a Go script which creates database users.
I wish to know within the script which of those has initiated the trigger such that I can print the outcome of what will happen when an apply will be performed (simply a dry run of the script).
For my use case, this is a Go CLI with quite many arguments, thus I do not want to split it into two distinct after_hooks. I also have to update the CLI arguments on both hooks for it to work in that case.
My proposal is for example to add some type of environment variable such that I can do a os.Getenv(...) in the Go script.
Technical Details
A non-breaking feature for hooks.
Press Release
A new environment variable for hooks to distinguish between triggers.
Drawbacks
No drawbacks.
Alternatives
No response
Migration Strategy
No response
Unresolved Questions
Any alternative or existing solution?
References
No response
Proof of Concept Pull Request
No response
Support Level
I have Terragrunt Enterprise Support
I am a paying Gruntwork customer
Customer Name
No response
The text was updated successfully, but these errors were encountered:
Summary
A way to identity the after_hook trigger if hook can be triggered by multiple commands
Motivation
I am running an after_hook which executes on both commands plan and apply.
The hook starts a Go script which creates database users.
I wish to know within the script which of those has initiated the trigger such that I can print the outcome of what will happen when an apply will be performed (simply a dry run of the script).
Proposal
A simplified version of the hook:
For my use case, this is a Go CLI with quite many arguments, thus I do not want to split it into two distinct after_hooks. I also have to update the CLI arguments on both hooks for it to work in that case.
My proposal is for example to add some type of environment variable such that I can do a
os.Getenv(...)
in the Go script.Technical Details
A non-breaking feature for hooks.
Press Release
A new environment variable for hooks to distinguish between triggers.
Drawbacks
No drawbacks.
Alternatives
No response
Migration Strategy
No response
Unresolved Questions
Any alternative or existing solution?
References
No response
Proof of Concept Pull Request
No response
Support Level
Customer Name
No response
The text was updated successfully, but these errors were encountered: