about summary refs log tree commit diff
path: root/users/aspen/terraform/globals.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/aspen/terraform/globals.nix')
-rw-r--r--users/aspen/terraform/globals.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/users/aspen/terraform/globals.nix b/users/aspen/terraform/globals.nix
new file mode 100644
index 000000000000..c6bc24c22b65
--- /dev/null
+++ b/users/aspen/terraform/globals.nix
@@ -0,0 +1,27 @@
+{ pkgs, ... }:
+
+{
+  provider.aws = map
+    (region: {
+      inherit region;
+      alias = region;
+      profile = "personal";
+    }) [
+    "us-east-1"
+    "us-east-2"
+    "us-west-2"
+  ];
+
+  data.external.cloudflare_api_key = {
+    program = [
+      (pkgs.writeShellScript "cloudflare_api_key" ''
+        jq -n --arg api_key "$(pass cloudflare-api-key)" '{"api_key":$api_key}'
+      '')
+    ];
+  };
+
+  provider.cloudflare = {
+    email = "root@gws.fyi";
+    api_key = "\${data.external.cloudflare_api_key.result.api_key}";
+  };
+}