about summary refs log tree commit diff
path: root/users/grfn/terraform/globals.nix
blob: 5f373c664604f94c352bf95be5e5556f19eedf10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{ 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}";
  };
}