This repository was archived by the owner on Dec 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroute53.ts
More file actions
101 lines (90 loc) · 2.68 KB
/
route53.ts
File metadata and controls
101 lines (90 loc) · 2.68 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import * as aws from "@pulumi/aws"
import * as pulumi from "@pulumi/pulumi"
import * as acm from "./acm"
import * as config from "./config"
import * as ec2 from "./ec2"
import * as lb from "./lb"
import * as vpc from "./vpc"
const publicZone = new aws.route53.Zone("public", {
comment: "Public name resolution",
name: config.domains.app,
tags: {
deployment: config.deploymentName,
},
})
new aws.route53.Record("alb", {
aliases: [{
evaluateTargetHealth: false,
name: pulumi.interpolate`dualstack.${lb.externalAlb.dnsName}`,
zoneId: lb.externalAlb.zoneId,
}],
name: config.domains.app,
type: aws.route53.RecordTypes.A,
zoneId: publicZone.zoneId,
})
const sslCertValidationRecord = new aws.route53.Record("ssl-cert-validation", {
name: acm.sslCert.domainValidationOptions[0].resourceRecordName,
records: [acm.sslCert.domainValidationOptions[0].resourceRecordValue],
ttl: 300,
type: acm.sslCert.domainValidationOptions[0].resourceRecordType,
zoneId: publicZone.id,
})
new aws.acm.CertificateValidation("ssl-cert", {
certificateArn: acm.sslCert.arn,
validationRecordFqdns: [sslCertValidationRecord.fqdn],
})
const registryZone = new aws.route53.Zone("registry", {
comment: "Internal name resolution in VPC",
name: config.services.registryHost,
vpcs: [{
vpcId: vpc.vpc.id,
vpcRegion: config.aws.region,
}],
tags: {
deployment: config.deploymentName,
},
})
new aws.route53.Record("registry", {
aliases: [{
evaluateTargetHealth: false,
name: pulumi.interpolate`dualstack.${lb.internalAlb.dnsName}`,
zoneId: lb.internalAlb.zoneId,
}],
name: config.services.registryHost,
type: aws.route53.RecordTypes.A,
zoneId: registryZone.zoneId,
})
const servicesZone = new aws.route53.Zone("services", {
comment: "Internal service name resolution in VPC",
name: "svc",
vpcs: [{
vpcId: vpc.vpc.id,
vpcRegion: config.aws.region,
}],
tags: {
deployment: config.deploymentName,
},
})
if (!config.services.aws.redis.enabled) {
new aws.route53.Record("redis", {
name: "redis.svc",
records: [ec2.servicesInstance.privateIp],
ttl: 60,
type: aws.route53.RecordTypes.A,
zoneId: servicesZone.zoneId,
})
}
new aws.route53.Record("wapi", {
name: "wapi.svc",
records: [ec2.servicesInstance.privateIp],
ttl: 60,
type: aws.route53.RecordTypes.A,
zoneId: servicesZone.zoneId,
})
new aws.route53.Record("flexlm", {
name: "flexlm.svc",
records: [ec2.servicesInstance.privateIp],
ttl: 60,
type: aws.route53.RecordTypes.A,
zoneId: servicesZone.zoneId,
})