-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdns.ts
More file actions
34 lines (30 loc) · 856 Bytes
/
dns.ts
File metadata and controls
34 lines (30 loc) · 856 Bytes
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
import * as digitalocean from "@pulumi/digitalocean";
import * as pulumi from "@pulumi/pulumi";
export type DNSZoneOptions = {
baseDomain: string;
rootDomain: string;
netDomainPrefix: string;
pulicIP: string;
};
const pulumiComponentNamespace: string = "turingev:K8sCluster";
export class DNSZone extends pulumi.ComponentResource {
constructor(
name,
args: DNSZoneOptions,
opts?: pulumi.ComponentResourceOptions,
) {
super(pulumiComponentNamespace, name, args, opts);
new digitalocean.DnsRecord(`${args.baseDomain}`, {
name: `${args.baseDomain}.`,
domain: args.rootDomain,
type: "A",
value: args.pulicIP,
});
new digitalocean.DnsRecord(`*.${args.baseDomain}`, {
name: `*.${args.baseDomain}.`,
domain: args.rootDomain,
type: "A",
value: args.pulicIP,
});
}
}