-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
terraform: provide plugins for 0.10 #28729
Conversation
@copumpkin, thanks for your PR! By analyzing the history of the files in this pull request, we identified @zimbatm, @peterhoeg and @kamilchm to be potential reviewers. |
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.
Sounds good to me.
Even if it's more verbose, the simple approach is probably better because it allows to plug things in different ways. For example we might have a terraform2nix that generates the plugin set and then it will be terraform.withPlugins (import ./terraform2nix.nix { pkgs })
.
We don't know how the terraform2nix tool will look like yet. It might be necessary to scan all the modules if third-parties start including provider version ranges. For now I'm fine with a script that generates all the terraform plugins from the latest git tags.
}; | ||
|
||
# TODO: make me stackable | ||
withPlugins = plugins: stdenv.mkDerivation { |
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.
this could also take terraform:
as the first argument. Then set the passthru in the generic builder where terraform
is a reference to self.
I like the haskell set convention of the |
Any thoughts on Also @shlevy, are you saying you'd prefer |
No strong feelings on the name, yeah I think it should take a function |
No strong objections either. If Haskell takes a function we could do the same for consistency's sake. |
A function it is! |
a4260c1
to
b84fa24
Compare
@shlevy @zimbatm any thoughts on how to handle the Otherwise I think this is ready. |
Also, y'all feel welcome to add other plugins! |
Also add a few starter plugins/providers
b84fa24
to
80319c1
Compare
Okay, I now have AWS, Google, Azure, and K8s plugins, and I've got a not-beautiful-but-not-awful solution to the override question. You can now write this monstrosity and have it work:
I'm going to merge this but I welcome improvements, new plugins, or suggestions on how to do the override crap more nicely. |
Actually, the way I homogenized the |
Fixed in 11753b3 |
LGTM & composable! ❤️ |
Obviously very much a WIP, but this is the sort of thing I had in mind. I don't really care how we plug the plugins into it, but this way seemed to work and didn't take too much hackery.
To use, try:
terraform_0_10.withPlugins [ terraform_0_10.providers.aws ]
That should get you a version of terraform that:
Feedback welcome! I've been considering making
withPlugins
take a function from the available plugins for that version of terraform, so you could write something likewithPlugins (p: [ p.aws ])
or something.Motivation for this change
#28537
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)