-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudflare.ts
75 lines (67 loc) · 1.84 KB
/
cloudflare.ts
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { Record } from "@pulumi/cloudflare";
// Note: This is needed to establish the chain of trust from the parent
// zone (isomer.gov.sg), so that DNSSEC works
// DO NOT REMOVE, as this WILL break ALL hosted sites
const createRecords = (zoneId: string): Record[] => {
const records = [
new Record("hostedon-ns1", {
name: "hostedon",
type: "NS",
ttl: 60,
zoneId: zoneId,
proxied: false,
value: "ns-1053.awsdns-03.org",
comment: "For indirection layer, DO NOT REMOVE",
}),
new Record("hostedon-ns2", {
name: "hostedon",
type: "NS",
ttl: 60,
zoneId: zoneId,
proxied: false,
value: "ns-641.awsdns-16.net",
comment: "For indirection layer, DO NOT REMOVE",
}),
new Record("hostedon-ns3", {
name: "hostedon",
type: "NS",
ttl: 60,
zoneId: zoneId,
proxied: false,
value: "ns-1615.awsdns-09.co.uk",
comment: "For indirection layer, DO NOT REMOVE",
}),
new Record("hostedon-ns4", {
name: "hostedon",
type: "NS",
ttl: 60,
zoneId: zoneId,
proxied: false,
value: "ns-476.awsdns-59.com",
comment: "For indirection layer, DO NOT REMOVE",
}),
new Record("hostedon-ds", {
name: "hostedon",
type: "DS",
ttl: 60,
zoneId: zoneId,
proxied: false,
data: {
keyTag: 5403,
algorithm: 13,
digestType: 2,
digest:
"AC93FBD6C960986A64A96F696837F934A5839F8E187A053B5EA50E7BA13E1615",
},
comment: "For indirection layer, DO NOT REMOVE",
}),
];
return records;
};
export async function createCloudflareRecords() {
const CLOUDFLARE_ZONE_ID = process.env.CLOUDFLARE_ZONE_ID;
if (!CLOUDFLARE_ZONE_ID) {
throw new Error("CLOUDFLARE_ZONE_ID must be set");
}
createRecords(CLOUDFLARE_ZONE_ID);
}