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

Implement intermediate-variable module #1

Merged
merged 2 commits into from
Mar 7, 2017
Merged

Implement intermediate-variable module #1

merged 2 commits into from
Mar 7, 2017

Conversation

brikis98
Copy link
Member

@brikis98 brikis98 commented Mar 7, 2017

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...

@brikis98
Copy link
Member Author

brikis98 commented Mar 7, 2017

@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.

@brikis98 brikis98 merged commit f9cb95f into master Mar 7, 2017
@brikis98 brikis98 deleted the v1 branch March 7, 2017 15:13
Copy link
Contributor

@josh-padnick josh-padnick left a 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a derived

Copy link
Member Author

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.
Copy link
Contributor

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.

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants