terranix: init #14
Loading…
Reference in a new issue
No description provided.
Delete branch "terranix-init"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds simple
nix run .#apply
&nix run .#destroy
which renders theconfiguration file and let Terraform drive it.
Signed-off-by: Raito Bezarius masterancpp@gmail.com
@ -20,0 +39,4 @@
apply = {
type = "app";
program = toString (pkgs.writers.writeBash "apply" ''
if [[ -e config.tf.json ]]; then rm -f config.tf.json; fi
rm -f
ignores failure anyway, so you don't need to check if it exists.@ -20,0 +40,4 @@
type = "app";
program = toString (pkgs.writers.writeBash "apply" ''
if [[ -e config.tf.json ]]; then rm -f config.tf.json; fi
cp ${terraformCfg} config.tf.json \
We could also
ln -snf
, then we don't even have to remove it first?@ -20,0 +41,4 @@
program = toString (pkgs.writers.writeBash "apply" ''
if [[ -e config.tf.json ]]; then rm -f config.tf.json; fi
cp ${terraformCfg} config.tf.json \
&& ${lib.getExe terraform} init \
set -eo pipefail
rather than chaining&&
?@ -20,0 +45,4 @@
&& ${lib.getExe terraform} apply
'');
};
# nix run ".#destroy"
Is this something we anticipate doing regularly? oO
I just did it out of symmetry.
@lheckemann Can I let you implement your changes directly?
28b4492214
toe422da8f83