diff --git a/corp/ops/.envrc b/corp/ops/.envrc new file mode 100644 index 000000000..26049cf42 --- /dev/null +++ b/corp/ops/.envrc @@ -0,0 +1,4 @@ +out=$(nix-build ../.. -A corp.ops.deps --out-link ../../.gcroots/corp-deps) +PATH_add "$out/bin" + +watch_file default.nix diff --git a/corp/ops/.gitignore b/corp/ops/.gitignore new file mode 100644 index 000000000..c035e7291 --- /dev/null +++ b/corp/ops/.gitignore @@ -0,0 +1,2 @@ +.terraform +.terraform.lock.hcl diff --git a/corp/ops/default.nix b/corp/ops/default.nix new file mode 100644 index 000000000..59a998cca --- /dev/null +++ b/corp/ops/default.nix @@ -0,0 +1,21 @@ +{ depot, lib, pkgs, ... }: + +depot.nix.readTree.drvTargets rec { + # Provide a Terraform wrapper with Yandex Cloud support. + terraform = pkgs.terraform.withPlugins (p: [ + p.yandex + ]); + + validate = depot.tools.checks.validateTerraform { + inherit terraform; + name = "corp"; + src = lib.cleanSource ./.; + }; + + deps = depot.tools.depot-deps.overrideDeps { + tf-yandex = { + attr = "corp.ops.terraform"; + cmd = "terraform"; + }; + }; +} diff --git a/corp/ops/main.tf b/corp/ops/main.tf new file mode 100644 index 000000000..98cea4c63 --- /dev/null +++ b/corp/ops/main.tf @@ -0,0 +1,10 @@ +# Terraform configuration for TVL corp infrastructure (on Yandex +# Cloud). + +terraform { + required_providers { + yandex = { + source = "yandex-cloud/yandex" + } + } +}