-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Azure-Terraform/sanitize
Sanitize
- Loading branch information
Showing
5 changed files
with
44 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
|
||
# SRE Resources | ||
resource "azurerm_dns_zone" "sre" { | ||
name = "${lower(var.domain_prefix)}.lnrisk.io" | ||
resource_group_name = var.sre_resource_group_name | ||
resource "azurerm_dns_zone" "child" { | ||
provider = azurerm.child | ||
name = "${lower(var.child_domain_prefix)}.${lower(var.parent_domain)}" | ||
resource_group_name = var.child_domain_resource_group_name | ||
tags = var.tags | ||
} | ||
|
||
# IOG Resources | ||
resource "azurerm_dns_ns_record" "iog" { | ||
|
||
provider = azurerm.iog | ||
name = lower(var.domain_prefix) | ||
zone_name = "lnrisk.io" | ||
resource_group_name = var.iog_resource_group_name | ||
resource "azurerm_dns_ns_record" "child" { | ||
provider = azurerm.parent | ||
name = lower(var.child_domain_prefix) | ||
zone_name = lower(var.parent_domain) | ||
resource_group_name = var.parent_domain_resource_group_name | ||
ttl = 300 | ||
tags = var.tags | ||
|
||
records = azurerm_dns_zone.sre.name_servers | ||
|
||
records = azurerm_dns_zone.child.name_servers | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
output "id" { | ||
description = "id of dns child zone" | ||
value = azurerm_dns_zone.child.id | ||
} | ||
|
||
output "name" { | ||
value = "${lower(var.domain_prefix)}.lnrisk.io" | ||
value = "${lower(var.child_domain_prefix)}.${lower(var.parent_domain)}" | ||
description = "The DNS zone that has been delegated to you" | ||
depends_on = [ | ||
# ensure resources are created prior to outputs | ||
azurerm_dns_ns_record.iog, | ||
azurerm_dns_zone.sre | ||
azurerm_dns_ns_record.child, | ||
azurerm_dns_zone.child | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,35 @@ | ||
# SRE Subscription | ||
## This should be the output of the subscription module | ||
variable "sre_subscription_id" { | ||
variable "child_domain_subscription_id" { | ||
description = "ID of the target subscription" | ||
type = string | ||
} | ||
|
||
variable "sre_resource_group_name" { | ||
variable "child_domain_resource_group_name" { | ||
description = "Name of the target resource group" | ||
type = string | ||
} | ||
|
||
# IOG Subscription | ||
variable "iog_subscription_id" { | ||
description = "ID of the parent subscription - This is the owner of the root domain" | ||
variable "child_domain_prefix" { | ||
description = "child domain prefix (<child>.<domain>.<prefix>.<parent domain>)" | ||
type = string | ||
} | ||
|
||
variable "iog_resource_group_name" { | ||
description = "Name of the parent subscription - This is the owner of the root domain" | ||
variable "parent_domain_subscription_id" { | ||
description = "ID of the parent subscription - This is the owner of the parent domain" | ||
type = string | ||
} | ||
|
||
# Domain | ||
variable "domain_prefix" { | ||
description = "Zone prefix" | ||
variable "parent_domain_resource_group_name" { | ||
description = "Name of the parent resource_group - This is the owner of the root domain" | ||
type = string | ||
} | ||
|
||
variable "parent_domain" { | ||
description = "parent domain" | ||
type = string | ||
} | ||
|
||
# Meta Data | ||
variable "tags" { | ||
description = "Tags to be applied to resources (inclusive)" | ||
type = map(string) | ||
} | ||
|
||
variable "names" { | ||
description = "Names to be applied to resources (inclusive)" | ||
type = object({ | ||
environment = string | ||
location = string | ||
market = string | ||
product_name = string | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters