Skip to content

Commit

Permalink
update code docu and fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelamattes committed Dec 17, 2021
1 parent 0b5cc2d commit b655e35
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
17 changes: 13 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# DNS Zone
/**
* # dns
*
* This module manages Azure DNS Zones.
*
*/

/** DNS Zone */
resource "azurerm_dns_zone" "dns_zone" {
for_each = local.dns_zone

Expand All @@ -11,6 +18,7 @@ resource "azurerm_dns_zone" "dns_zone" {
}
}

/** Private DNS Zone */
resource "azurerm_private_dns_zone" "private_dns_zone" {
for_each = local.private_dns_zone

Expand All @@ -23,7 +31,7 @@ resource "azurerm_private_dns_zone" "private_dns_zone" {
}
}

# A Records
/** DNS A Records */
resource "azurerm_dns_a_record" "dns_a_record" {
for_each = local.dns_a_record

Expand All @@ -38,7 +46,8 @@ resource "azurerm_dns_a_record" "dns_a_record" {
tag => local.tags[tag]
}
}
# alias records to azure resources

/** DNS Alias Records to Azure Resources */
resource "azurerm_dns_a_record" "dns_a_target" {
for_each = local.dns_a_target

Expand All @@ -54,7 +63,7 @@ resource "azurerm_dns_a_record" "dns_a_target" {
}
}

# CNAME Records
/** DNS CNAME Records */
resource "azurerm_dns_cname_record" "dns_cname_record" {
for_each = local.dns_cname_record

Expand Down
22 changes: 11 additions & 11 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ variable "tags" {
}
# resource definition
variable "dns_zone" {
type = any
default = {}
type = any
default = {}
description = "resource definition, default settings are defined within locals and merged with var settings"
}
variable "private_dns_zone" {
type = any
default = {}
type = any
default = {}
description = "resource definition, default settings are defined within locals and merged with var settings"
}
variable "dns_a_record" {
type = any
default = {}
type = any
default = {}
description = "resource definition, default settings are defined within locals and merged with var settings"
}
variable "dns_a_target" {
type = any
default = {}
type = any
default = {}
description = "resource definition, default settings are defined within locals and merged with var settings"
}
variable "dns_cname_record" {
type = any
default = {}
type = any
default = {}
description = "resource definition, default settings are defined within locals and merged with var settings"
}

Expand All @@ -39,7 +39,7 @@ locals {
default = {
tags = {}
# resource definition
dns_zone = {}
dns_zone = {}
private_dns_zone = {}
dns_a_record = {
ttl = "900"
Expand Down

0 comments on commit b655e35

Please sign in to comment.