-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathoutputs.tf
68 lines (61 loc) · 2.31 KB
/
outputs.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
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
output "zone" {
description = "The information for Hosted Zone of the record set."
value = {
arn = data.aws_route53_zone.this.arn
id = values(aws_route53_record.this)[0].zone_id
name = data.aws_route53_zone.this.name
}
}
output "name" {
description = "The name of the record."
value = values(aws_route53_record.this)[0].name
}
output "fqdn" {
description = "The FQDN (Fully-qualified Domain Name) of the record."
value = values(aws_route53_record.this)[0].fqdn
}
output "type" {
description = "The DNS record type of the record set."
value = values(aws_route53_record.this)[0].type
}
output "ttl" {
description = "The record cache time to live (TTL) in seconds."
value = values(aws_route53_record.this)[0].ttl
}
output "routing_policy" {
description = "The routing policy of the record set."
value = var.routing_policy
}
output "records" {
description = <<EOF
A list of records for the record set. Each item of `records` as defined below.
`id` - A unique ID to differentiate this record from other records with the same domain name and type.
`value` - A configuration for non-alias record with a list of the record values.
`alias` - A configuration for alias record. Conflicts with `value`. `alias` as defined below.
`name` - DNS domain name for a CloudFront distribution, S3 bucket, ELB, or another record set in this hosted zone.
`zone` - Hosted zone ID for a CloudFront distribution, S3 bucket, ELB, or Route 53 hosted zone.
`evaluate_target_health` - Whether to respond to DNS queries using this record by checking the health of the alias target.
EOF
value = {
for id, record in aws_route53_record.this :
id => {
id = record.set_identifier == "" ? null : record.set_identifier
value = record.records
alias = (one(record.alias) != null
? {
name = record.alias[0].name
zone = record.alias[0].zone_id
evaluate_target_health = record.alias[0].evaluate_target_health
}
: null
)
}
}
}
# output "debug" {
# value = {
# for k, v in values(aws_route53_record.this)[0] :
# k => v
# if !contains(["zone_id", "type", "ttl", "name", "fqdn", "id", "allow_overwrite", "alias", "set_identifier", "records"], k)
# }
# }