-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutputs.tf
More file actions
84 lines (70 loc) · 3.16 KB
/
outputs.tf
File metadata and controls
84 lines (70 loc) · 3.16 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
# =============================================================================
# HOSTED ZONE OUTPUTS
# =============================================================================
output "zone_id" {
description = "The hosted zone ID"
value = var.create_zone ? try(aws_route53_zone.this[0].zone_id, null) : try(data.aws_route53_zone.existing[0].zone_id, null)
}
output "zone_arn" {
description = "The ARN of the hosted zone"
value = var.create_zone ? try(aws_route53_zone.this[0].arn, null) : try(data.aws_route53_zone.existing[0].arn, null)
}
output "name_servers" {
description = "List of name servers for the hosted zone"
value = var.create_zone ? try(aws_route53_zone.this[0].name_servers, []) : try(data.aws_route53_zone.existing[0].name_servers, [])
}
output "zone_name" {
description = "The name of the hosted zone"
value = var.create_zone ? try(aws_route53_zone.this[0].name, null) : try(data.aws_route53_zone.existing[0].name, null)
}
# =============================================================================
# RECORDS OUTPUTS
# =============================================================================
output "record_names" {
description = "Map of record names to their FQDNs"
value = var.create_zone ? merge(
{ for k, v in aws_route53_record.this : k => v.fqdn },
{ for k, v in aws_route53_record.alias : k => v.fqdn }
) : {}
}
output "record_ids" {
description = "Map of record names to their IDs"
value = var.create_zone ? merge(
{ for k, v in aws_route53_record.this : k => v.id },
{ for k, v in aws_route53_record.alias : k => v.id }
) : {}
}
# =============================================================================
# HEALTH CHECK OUTPUTS
# =============================================================================
output "health_check_ids" {
description = "Map of health check names to their IDs"
value = merge(
{ for k, v in aws_route53_health_check.endpoint : k => v.id },
{ for k, v in aws_route53_health_check.calculated : k => v.id },
{ for k, v in aws_route53_health_check.cloudwatch : k => v.id }
)
}
output "health_check_arns" {
description = "Map of health check names to their ARNs"
value = merge(
{ for k, v in aws_route53_health_check.endpoint : k => v.arn },
{ for k, v in aws_route53_health_check.calculated : k => v.arn },
{ for k, v in aws_route53_health_check.cloudwatch : k => v.arn }
)
}
# =============================================================================
# DNSSEC OUTPUTS
# =============================================================================
output "dnssec_key_signing_key_id" {
description = "The ID of the DNSSEC key signing key"
value = var.create_zone && var.enable_dnssec ? aws_route53_key_signing_key.this[0].id : null
}
output "dnssec_key_signing_key_status" {
description = "The status of the DNSSEC key signing key"
value = var.create_zone && var.enable_dnssec ? aws_route53_key_signing_key.this[0].status : null
}
output "dnssec_status" {
description = "The status of DNSSEC for the hosted zone"
value = var.create_zone && var.enable_dnssec ? aws_route53_hosted_zone_dnssec.this[0].id : null
}