poc: terranix-hcloud
This commit is contained in:
parent
0af550d642
commit
183790d365
|
@ -1,7 +1,24 @@
|
|||
# This file is maintained automatically by "tofu init".
|
||||
# Manual edits may be lost in future updates.
|
||||
|
||||
provider "registry.opentofu.org/hashicorp/hcloud" {
|
||||
provider "registry.opentofu.org/hashicorp/local" {
|
||||
version = "2.4.1"
|
||||
hashes = [
|
||||
"h1:ZmiQvqAmblLC08P/NR+AVQtZrD+GGRpjFWcl+qX3+tE=",
|
||||
"zh:0d4d7a980ba3479459ab8a231019588d38615b22b97600419c3c7482ee82bc8b",
|
||||
"zh:16cf003a5bff1c5cae32e29af30f54376aec29b21ce26768d5fa59cc8b3bac3e",
|
||||
"zh:469539918519547b2b87a9301ad811e59e50d4f217c36da01e0d981b45a393e9",
|
||||
"zh:620234f4c7dcfd00fa4b7d15e71fa055ada4a8afe084f84a40d06d02fc7e7c08",
|
||||
"zh:68fd2f982c5fecff972e03eced690077911083f782a237d5a026597ab387f737",
|
||||
"zh:7bc30de9089a3d060f9866e08f6bd766351880026a458a4b7443cb110d47dc16",
|
||||
"zh:ad772631dfa005fdd6f7cc2ce33d1771218574b5153c5d601d7584fe9e8a0da2",
|
||||
"zh:cb6f16481607a3899e1d0a8f9fcacf246fb4927ee274da69c7d1e75fc4960713",
|
||||
"zh:dcac954e9e401c53db3750ab3df22173f7ba288e978da348f97ddbbc4a33abb1",
|
||||
"zh:eeeb0583e152403bdb473de5f133b48cef04af8f7c3f38ee7dc6d034df91534d",
|
||||
]
|
||||
}
|
||||
|
||||
provider "registry.opentofu.org/hetznercloud/hcloud" {
|
||||
version = "1.45.0"
|
||||
hashes = [
|
||||
"h1:BEE0B6hv1ZAmTLIO12uqIm7s3oSjmGzZLm6OzudlxAw=",
|
||||
|
@ -21,20 +38,3 @@ provider "registry.opentofu.org/hashicorp/hcloud" {
|
|||
"zh:fb0e083d2925f289999dc561ef1c2f84a9e0ab11388c40162ca8b470f50f71f5",
|
||||
]
|
||||
}
|
||||
|
||||
provider "registry.opentofu.org/hashicorp/local" {
|
||||
version = "2.4.1"
|
||||
hashes = [
|
||||
"h1:ZmiQvqAmblLC08P/NR+AVQtZrD+GGRpjFWcl+qX3+tE=",
|
||||
"zh:0d4d7a980ba3479459ab8a231019588d38615b22b97600419c3c7482ee82bc8b",
|
||||
"zh:16cf003a5bff1c5cae32e29af30f54376aec29b21ce26768d5fa59cc8b3bac3e",
|
||||
"zh:469539918519547b2b87a9301ad811e59e50d4f217c36da01e0d981b45a393e9",
|
||||
"zh:620234f4c7dcfd00fa4b7d15e71fa055ada4a8afe084f84a40d06d02fc7e7c08",
|
||||
"zh:68fd2f982c5fecff972e03eced690077911083f782a237d5a026597ab387f737",
|
||||
"zh:7bc30de9089a3d060f9866e08f6bd766351880026a458a4b7443cb110d47dc16",
|
||||
"zh:ad772631dfa005fdd6f7cc2ce33d1771218574b5153c5d601d7584fe9e8a0da2",
|
||||
"zh:cb6f16481607a3899e1d0a8f9fcacf246fb4927ee274da69c7d1e75fc4960713",
|
||||
"zh:dcac954e9e401c53db3750ab3df22173f7ba288e978da348f97ddbbc4a33abb1",
|
||||
"zh:eeeb0583e152403bdb473de5f133b48cef04af8f7c3f38ee7dc6d034df91534d",
|
||||
]
|
||||
}
|
||||
|
|
15
config.nix
15
config.nix
|
@ -7,7 +7,7 @@ in rec {
|
|||
provider = {
|
||||
|
||||
# Configure the Hetzner Cloud Provider
|
||||
hcloud.token = lib.tfRef "var.hcloud_token";
|
||||
hcloud.token = lib.mkForce (lib.tfRef "var.hcloud_api_token");
|
||||
|
||||
};
|
||||
|
||||
|
@ -16,10 +16,10 @@ in rec {
|
|||
};
|
||||
|
||||
# Set the variable value in *.tfvars file
|
||||
# or using -var="hetzner_token=..." CLI option
|
||||
# or using -var="hcloud_api_token=..." CLI option
|
||||
variable = {
|
||||
|
||||
hcloud_token = {
|
||||
hcloud_api_token = {
|
||||
type = "string";
|
||||
description = "Hetzner Cloud API Token";
|
||||
sensitive = true;
|
||||
|
@ -27,6 +27,15 @@ in rec {
|
|||
|
||||
};
|
||||
|
||||
# https://github.com/terranix/terranix-hcloud/blob/main/options.md
|
||||
hcloud = {
|
||||
enable = true;
|
||||
# can also be specified with the TF_VAR_hcloud_api_token environment variable
|
||||
provider.token = builtins.getEnv "TF_VAR_hcloud_api_token";
|
||||
export.nix = "hetzner.nix";
|
||||
|
||||
};
|
||||
|
||||
data = {
|
||||
|
||||
hcloud_ssh_keys."all_keys" = {};
|
||||
|
|
Loading…
Reference in New Issue