Skip to content

Commit a3b0d47

Browse files
committed
feat(zones): Add primary name server to outputs
1 parent e3e3548 commit a3b0d47

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

examples/complete/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ module "records" {
5959
# zone_id = local.zone_id
6060

6161
records = [
62+
{
63+
name = ""
64+
type = "SOA"
65+
records = [
66+
"${module.zones.primary_name_server[local.zone_name]}. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 60",
67+
]
68+
},
6269
{
6370
name = ""
6471
type = "A"

modules/zones/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ No modules.
3838

3939
| Name | Description |
4040
|------|-------------|
41+
| <a name="output_primary_name_server"></a> [primary\_name\_server](#output\_primary\_name\_server) | The Route 53 name server that created the SOA record. |
4142
| <a name="output_route53_static_zone_name"></a> [route53\_static\_zone\_name](#output\_route53\_static\_zone\_name) | Name of Route53 zone created statically to avoid invalid count argument error when creating records and zones simmultaneously |
4243
| <a name="output_route53_zone_name"></a> [route53\_zone\_name](#output\_route53\_zone\_name) | Name of Route53 zone |
4344
| <a name="output_route53_zone_name_servers"></a> [route53\_zone\_name\_servers](#output\_route53\_zone\_name\_servers) | Name servers of Route53 zone |

modules/zones/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ output "route53_zone_name_servers" {
1313
value = { for k, v in aws_route53_zone.this : k => v.name_servers }
1414
}
1515

16+
output "primary_name_server" {
17+
description = "The Route 53 name server that created the SOA record."
18+
value = { for k, v in aws_route53_zone.this : k => v.primary_name_server }
19+
}
20+
1621
output "route53_zone_name" {
1722
description = "Name of Route53 zone"
1823
value = { for k, v in aws_route53_zone.this : k => v.name }

0 commit comments

Comments
 (0)