merged
parent
8862d1b843
commit
72ade764a3
|
@ -156,7 +156,8 @@ let
|
|||
modules = [ { imports = [ ./config.nix ]; } ];
|
||||
};
|
||||
in
|
||||
(sanitize result.config)
|
||||
# we whitelist the resource argument
|
||||
{ resource = (sanitize result.config).resource ; }
|
||||
```
|
||||
|
||||
In `config.nix` we can now focus on the configuration content. And we write it
|
||||
|
@ -324,14 +325,6 @@ Let's look at the different `config.nix` results.
|
|||
```json
|
||||
$> nix-instantiate --eval --strict --json test3.nix --show-trace | jq
|
||||
{
|
||||
"hcloud": {
|
||||
"server": {
|
||||
"test": {
|
||||
"image": "ubuntu",
|
||||
"server_type": "cx11"
|
||||
}
|
||||
}
|
||||
},
|
||||
"resource": {
|
||||
"hcloud_server": {
|
||||
"test": {
|
||||
|
@ -346,10 +339,6 @@ $> nix-instantiate --eval --strict --json test3.nix --show-trace | jq
|
|||
|
||||
The output is like we expected it to be.
|
||||
|
||||
The `hcloud` parameter should be removed, but for now I will leave it here,
|
||||
to see the original configuration.
|
||||
To make this work in terraform, you have to remove everything except `resource`.
|
||||
|
||||
#### With `additionalFileSize`
|
||||
|
||||
Let's add some `additionalFileSize`.
|
||||
|
@ -374,15 +363,6 @@ Let's add some `additionalFileSize`.
|
|||
```json
|
||||
$> nix-instantiate --eval --strict --json test3.nix --show-trace | jq
|
||||
{
|
||||
"hcloud": {
|
||||
"server": {
|
||||
"test": {
|
||||
"additionalFileSize": 100,
|
||||
"image": "ubuntu",
|
||||
"server_type": "cx11"
|
||||
}
|
||||
}
|
||||
},
|
||||
"resource": {
|
||||
"hcloud_server": {
|
||||
"test": {
|
||||
|
|
Loading…
Reference in New Issue