-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubdomain.tf
More file actions
27 lines (23 loc) · 775 Bytes
/
subdomain.tf
File metadata and controls
27 lines (23 loc) · 775 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
data "ns_subdomain" "this" {
stack_id = data.ns_workspace.this.stack_id
block_id = data.ns_workspace.this.block_id
env_id = data.ns_workspace.this.env_id
}
locals {
fqdn = data.ns_subdomain.this.fqdn
subdomain_domain_name = data.ns_subdomain.this.domain_name
}
resource "aws_route53_zone" "this" {
name = trimsuffix(local.fqdn, ".")
tags = local.tags
}
locals {
subdomain_name = aws_route53_zone.this.name
subdomain_zone_id = aws_route53_zone.this.zone_id
subdomain_nameservers = aws_route53_zone.this.name_servers
}
resource "ns_autogen_subdomain_delegation" "to_aws" {
subdomain_id = data.ns_workspace.this.block_id
env_id = data.ns_workspace.this.env_id
nameservers = aws_route53_zone.this.name_servers
}