From da572dabc3c8e6a76c192d47101766044cd293a3 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 10 Aug 2022 17:49:50 -0700 Subject: feat(ops/gcp-backups): add terraform configuration for GCP buckets This terraform configuration is to create the buckets that I'm using for various buckets. Doing this through the UI is difficult, as there are too many options, it's easy to have different buckets with different settings when I need them to be identical, no way to review what the change is going to look like, etc. Change-Id: I8ee15939559e7632e2df9d17cfaec75d756930b6 Reviewed-on: https://cl.fcuny.net/c/world/+/713 Tested-by: CI Reviewed-by: Franck Cuny --- ops/gcp-backups/default.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ops/gcp-backups/default.nix (limited to 'ops/gcp-backups/default.nix') diff --git a/ops/gcp-backups/default.nix b/ops/gcp-backups/default.nix new file mode 100644 index 0000000..44252e2 --- /dev/null +++ b/ops/gcp-backups/default.nix @@ -0,0 +1,20 @@ +{ pkgs }: +let + terraform = pkgs.terraform.withPlugins (p: [ + p.google + ]); +in +pkgs.stdenv.mkDerivation rec { + name = "tf-gcp-backups"; + src = ./.; + + setup = pkgs.writeShellScriptBin "tf-gcp-backups-setup" '' + set -ueo pipefail + + cd $(git rev-parse --show-toplevel)/ops/gcp-backups + + ${terraform}/bin/terraform init + ${terraform}/bin/terraform plan + ${terraform}/bin/terraform apply + ''; +} -- cgit 1.4.1