From f83e36ca1aab723276193eb29a47bd9d59abb1df Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 7 Jul 2025 16:04:59 -0700 Subject: add scripts related to terraform --- nix/tofu/backups.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 nix/tofu/backups.nix (limited to 'nix/tofu/backups.nix') diff --git a/nix/tofu/backups.nix b/nix/tofu/backups.nix new file mode 100644 index 0000000..e76ed2e --- /dev/null +++ b/nix/tofu/backups.nix @@ -0,0 +1,42 @@ +{ + pkgs, +}: +pkgs.writeTextFile { + name = "backups.tf.json"; + text = builtins.toJSON ([ + { + terraform = { + backend = { + gcs = { + bucket = "fcuny-infra-tofu-state"; + prefix = "backups"; + }; + }; + }; + } + { + provider = { + google = [ + { + project = "fcuny-infra"; + region = "us-west1"; + } + ]; + }; + } + { + resource = { + google_storage_bucket = { + "backups" = { + name = "fcuny-infra-backups"; + location = "us-west1"; + uniform_bucket_level_access = true; + force_destroy = true; + public_access_prevention = "enforced"; + storage_class = "NEARLINE"; + }; + }; + }; + } + ]); +} -- cgit v1.2.3