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

Render templates from strings e.g. templatestring function similar to templatefile #301

Closed
nitrocode opened this issue Aug 31, 2023 · 8 comments · Fixed by #1223
Closed
Assignees
Labels
accepted This issue has been accepted for implementation. enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@nitrocode
Copy link

nitrocode commented Aug 31, 2023

Context

Suggest an existing issue in legacy Terraform to fix in OpenTF.


I'd like to use template from a string instead of a file. At the moment, templatefile() requires a file to be present on disk prior to plan. If I can instead use a string, then I no longer need a file and my string can be even more dynamic. This is the functionality that we used to have with the original hashicorp/terraform-provider-template. However, that has been deprecated by templatefile with the missing string functionality and never had an arm release which is why the original was forked as cloudposse/terraform-provider-template. Since this fork provider is a workaround, a new string function would be much more beneficial.

A few attempts have been made to PR the templatestring function and those have been closed.

@roni-frantchi roni-frantchi transferred this issue from opentofu/roadmap Sep 6, 2023
@roni-frantchi roni-frantchi changed the title Open existing Terraform Issue [#26838]: [Render templates in a different module to where they are defined] Render templates in a different module to where they are defined Sep 6, 2023
@roni-frantchi
Copy link
Collaborator

Hey @nitrocode thanks for submitting!

To help us maintain a clear separation between opentf and hashicorp's offerings, we're asking that people describe issues that are in other repositories rather than linking those directly.
I've thus scrubbed out any links to said issues/PRs.

It is also worth mentioning that as an author of a PR to legacy your are permitted under legacy Terraform CLA to resubmit your code elsewhere as well. Of course a prior RFC would be appreciated

Thanks!

@nitrocode
Copy link
Author

Thanks @roni-frantchi . I added some more information above on why it's needed and the previous PRs. If I have time, I'd be happy to contribute the code that I previously submitted.

@roni-frantchi roni-frantchi added the enhancement New feature or request label Sep 13, 2023
@cube2222 cube2222 added the pending-decision This issue has not been accepted for implementation nor rejected. It's still open to discussion. label Sep 14, 2023
@nitrocode nitrocode changed the title Render templates in a different module to where they are defined Render templates from strings e.g. templatestring function similar to templatefile Oct 25, 2023
@cam72cam cam72cam removed the legacy label Jan 18, 2024
@cube2222 cube2222 added good first issue Good for newcomers help wanted Extra attention is needed accepted This issue has been accepted for implementation. and removed pending-decision This issue has not been accepted for implementation nor rejected. It's still open to discussion. labels Jan 18, 2024
@janosdebugs
Copy link
Contributor

Hey @nitrocode thank you for this issue. We believe this would be a great addition to OpenTofu and added the corresponding labels. When implementing this, it would be great to have as much reuse of existing code as possible.

@sanskruti-shahu
Copy link
Contributor

Hey, I would like to work upon this issue.

@janosdebugs
Copy link
Contributor

Hey @sanskruti-shahu , thank you for your help. I've assigned you to the issue. Please let us know what your estimate on time is so we can unassign the issue at that time if we don't hear back from you and someone else wants to work on it.

@sanskruti-shahu
Copy link
Contributor

I hope to contribute by end of next week probably.

@janosdebugs
Copy link
Contributor

Thank you @sanskruti-shahu please reach out on the #dev-general channel on the OpenTofu Slack if you run into trouble.

@sanskruti-shahu
Copy link
Contributor

Hey, @janosdebugs, I have created a pull request for this issue. Could you please take a look at it? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This issue has been accepted for implementation. enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants