blob: 531b2de85abd76aef8c939912487610a5b605c4e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
{ lib, ... }:
let
setDomainsFor =
{
account_id,
project,
domains,
}:
lib.listToAttrs (
map (domain: {
name = "${project}_${builtins.replaceStrings [ "." ] [ "_" ] domain}";
value = {
inherit account_id;
project_name = lib.tfRef "resource.cloudflare_pages_project.${project}.name";
inherit domain;
};
}) domains
);
in
{
resource.cloudflare_pages_domain =
setDomainsFor {
account_id = lib.tfRef "var.account_id";
project = "personal_website";
domains = [ "getchoo.com" ];
}
// setDomainsFor {
account_id = lib.tfRef "var.account_id";
project = "teawie_api";
domains = [ "api.getchoo.com" ];
};
}
|