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

Embedding terraform #16648

Closed
waghanza opened this issue Nov 14, 2017 · 5 comments
Closed

Embedding terraform #16648

waghanza opened this issue Nov 14, 2017 · 5 comments

Comments

@waghanza
Copy link

Hi there,

I love terraform as a cloud agnostic building tool.

However, I'd like to embed it into a third-party tool.

I have two options :

  • Writing a RESTful API that use terraform (Terraform as API? #415)
  • Creating a dynamic module (I now that a go app could be compiled as a so file)

Those two solutions has their pros/cons, but I think a dynamic module is more flexible (to embed it into a desktop application).

What do you think ?

Regards,

@apparentlymart
Copy link
Contributor

Hi @waghanza,

Since we're still heavily developing Terraform's internal architecture, we aren't yet committing to maintaining internal API compatibility between versions, and indeed are expecting some quite significant refactoring in the near future. However, Terraform's Go packages can be used as libraries if desired, with the caveat that you should vendor a particular version of Terraform and expect to have to make updates when moving to new versions. This constraint applies whether you wrap Terraform in a REST API or via a shared library wrapper.

At present we recommend using Terraform via its CLI as a child process, following the guidelines in our Running Terraform in Automation guide. The workflows suggested there are more likely to remain stable between releases (breaking changes are still possible but will be called out prominently in the changelog) and terraform is a statically-linked Go binary so it is relatively easy to distribute as part of a larger package.

@waghanza
Copy link
Author

Hi,

Thanks for this information. However, I do not understand when you speak about a statically-linked binary.

Regards,

@apparentlymart
Copy link
Contributor

"Statically-linked binary" means that the terraform program has no external library dependencies (apart from, on some platforms, some mandatory system libraries) and so generally you can copy it onto any system of the same operating system and architecture and it should work.

This is not true of some applications that may require shared libraries and thus would be harder to distribute without special compilation steps.

@waghanza
Copy link
Author

Understood ;-)

I'll create a REST api using go code

@ghost
Copy link

ghost commented Apr 6, 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 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants