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

Add the ability to create custom interpolate functions via a plugin. #15603

Closed
joestump opened this issue Jul 20, 2017 · 3 comments
Closed

Add the ability to create custom interpolate functions via a plugin. #15603

joestump opened this issue Jul 20, 2017 · 3 comments

Comments

@joestump
Copy link

It would be nice if there was a way to write your own interpolation functions in Go using the TF plugin framework. e.g. terraform-interpolation-function-myfunc would surface as ${myfunc(arg1, arg2, ...)}

On a second glance, it's not clear if data resources can be created via plugins either.

@apparentlymart
Copy link
Contributor

Hi @joestump! Thanks for this feature request.

At this time we're not planning to allow custom functions, since it creates another compatibility surface to maintain over time and is thus likely to hamper our attempts to improve the configuration language over the next few major versions. However, we may do this eventually when things are more stable, since indeed it would be useful to be able to add custom behavior here.

Data sources are part of a provider, so they can be implemented by plugins... in fact, that is the only way they are implemented. Provider plugins include both managed resource and data source implementations, since the two are usually closely related.

I assume you're interested in data sources as an alternative to a custom function to do some custom behavior, and indeed that is possible. Data sources are in fact often more useful than functions because they participate in the dependency graph and can thus take actions that require earlier work to already have been done, though of course the syntax for using them is decidedly more verbose.

Another option -- with some caveats -- is the external data source. This allows an external program implementing a specific protocol to be used as a data source, as a lighter-touch way to extend Terraform.

@apparentlymart
Copy link
Contributor

In reviewing some older issues I noticed that this one actually duplicates #2771, so I'm going to close this just to consolidate discussion over here.

At this time we're still not planning to support plugin functions in the short term, but we'll keep the other issue open to remember the use-case and revisit it at a later time.

@ghost
Copy link

ghost commented Apr 4, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants