-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
terraform-full: fix evaluation #100072
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-full: fix evaluation #100072
Conversation
We will be relying on the pname to figure out where to link the plugin.
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.
Successfully tested with the setup below.
# main.tf
terraform {
required_providers {
acme = {
source = "getstackhead/acme"
version = "1.5.0-patched"
}
auth0 = {
source = "nixpkgs/auth0"
}
ansible = {
source = "nixpkgs/ansible"
}
}
}
# provider available on registry.terraform.io
provider "acme" {}
# custom providers
provider "ansible" {}
provider "auth0" {}
# hashicorp providers
provider "cloudinit" {}
provider "dns" {}
rm -rf .terraform
nix-shell -I nixpkgs=$HOME/projects/nix/nixpkgs -p 'terraform_0_13.withPlugins (p : with p;[acme auth0 cloudinit dns ansible])' --command "terraform init"
Initializing provider plugins...
- Finding getstackhead/acme versions matching "1.5.0-patched"...
- Finding latest version of nixpkgs/auth0...
- Finding latest version of nixpkgs/ansible...
- Finding latest version of hashicorp/cloudinit...
- Finding latest version of hashicorp/dns...
- Installing nixpkgs/auth0 v0.11.0...
- Installed nixpkgs/auth0 v0.11.0 (unauthenticated)
- Installing nixpkgs/ansible v1.0.3...
- Installed nixpkgs/ansible v1.0.3 (unauthenticated)
- Installing hashicorp/cloudinit v1.0.0...
- Installed hashicorp/cloudinit v1.0.0 (unauthenticated)
- Installing hashicorp/dns v2.2.0...
- Installed hashicorp/dns v2.2.0 (unauthenticated)
- Installing getstackhead/acme v1.5.0-patched...
- Installed getstackhead/acme v1.5.0-patched (unauthenticated)
The following providers do not have any version constraints in configuration,
so the latest version was installed.
To prevent automatic upgrades to new major versions that may contain breaking
changes, we recommend adding version constraints in a required_providers block
in your configuration, with the constraint strings suggested below.
* hashicorp/cloudinit: version = "~> 1.0.0"
* hashicorp/dns: version = "~> 2.2.0"
* nixpkgs/ansible: version = "~> 1.0.3"
* nixpkgs/auth0: version = "~> 0.11.0"
Terraform has been successfully initialized!
Move the providerSourceAddress fallback to the terraform.withPlugins function. Since plugins can be arbitrary derivations, there is no guarantee that this attribute will be exposed. While doing that I also cleaned the toDrv function to only pass attributes to the builder which are required by the build. The Terraform 0.13 fallback slug has changed from `nixpkgs/<provider-owner>/<provider-name>` to `nixpkgs/<provider-name>` as the owner is also not always available. As a nixpkgs user, all I know is that the provider is in nixpkgs and his name, the owner information is not necessarily easy to get by.
fe9b869
to
c79ff8d
Compare
@zimbatm Would it be an option to backport this to 20.09 release to be able to use terraform 0.13 in 20.09 ? I can cherry pick if you want |
Was the 0.13 initial work also ported to 20.09? Normally I would say no, as 20.09 should only get fixes at this point. |
The initial work is not in @jfroche you may want to acquire these changes through an overlay. |
@timstott Sure understand your point. We already use this wonderful commit (thank you !) within our overlay. But is that mean that terraform 0.13 is available in 20.09 but that we cannot use it with providers ? |
Fix the nixpkgs evaluation that was broken by
cd1b594 (#99198)
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)