-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
29 lines (26 loc) · 871 Bytes
/
main.tf
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
resource "aptible_endpoint" "endpoint" {
env_id = data.aptible_environment.environment.env_id
resource_id = var.aptible_resource
internal = !var.public
domain = local.fqdn
managed = true
ip_filtering = var.allowed_cidrs
# TODO: Should these be configurable? Probably.
resource_type = "app"
endpoint_type = "https"
process_type = "web"
}
resource "aws_route53_record" "endpoint" {
zone_id = data.aws_route53_zone.domain.zone_id
name = aptible_endpoint.endpoint.domain
type = "CNAME"
records = [aptible_endpoint.endpoint.external_hostname]
ttl = 300
}
resource "aws_route53_record" "verification" {
zone_id = data.aws_route53_zone.domain.zone_id
name = aptible_endpoint.endpoint.dns_validation_record
type = "CNAME"
records = [aptible_endpoint.endpoint.dns_validation_value]
ttl = 300
}