-
Notifications
You must be signed in to change notification settings - Fork 77
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
Implement intermediate-variable module #1
Conversation
@josh-padnick Check out this new repo & module. The code is trivial, so I'm going to merge so I can use it ASAP for usage-patterns. Feedback welcome. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Left minor comments.
|
||
## Motivation | ||
|
||
Occasionally, in Terraform, you need a way to store an derived or intermediate value. If that value is a static string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a derived
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed: 0fce49b
``` | ||
|
||
However, there is no way to use a `template_file` to store an intermediate variable that's a list or a map. Until now. | ||
Check out the [intermediate-variable examples](/examples/intermediate-variable) to see how. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting use case. It's still a little unclear why you need interpolation in a list or map, so it may be worth going one step further under Motivation and explaining a use case that needs this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've expanded the README to explain more: 0fce49b
This PR adds a simple module that returns as output the exact variables you pass to it as inputs. This gives you a way to store intermediate values that contain interpolations.
I needed to use this module in several places in
usage-patterns
and it doesn’t seem to fit in any existing place. I’ve created similar “utility” modules like this in the past and always shoved them into random places. I figure this repo can be a home for this sort of code in the future. We could probably open source this module...