-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b68437
commit 98f9b3e
Showing
84 changed files
with
4,527 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#Reference to module that provisions azure dns zone | ||
module "DNSZone_module" { | ||
source = "../../modules/module_DNSZone_Creation/DNS_zone" | ||
|
||
resource_group = var.resource_group | ||
create_resource_group = var.create_resource_group | ||
location = var.location | ||
DNSZone_name = var.DNSZone_name | ||
email = var.email | ||
host_name = var.host_name | ||
expire_time = var.expire_time | ||
minimum_ttl = var.minimum_ttl | ||
refresh_time = var.refresh_time | ||
retry_time = var.retry_time | ||
serial_number = var.serial_number | ||
ttl = var.ttl | ||
tags = var.tags | ||
private_dns_zone_name = var.private_dns_zone_name | ||
} | ||
|
||
#Reference to module that provisions role assignment for each resource | ||
module "module_resource-role-assignment" { | ||
source = "../../modules/module_DNSZone_Creation/rbac" | ||
scope = module.DNSZone_module.resource_id | ||
role_definition_name = var.role_definition_name | ||
|
||
} | ||
|
||
#Reference to module that provisions diagnostic settings of a particular resource | ||
module "dns_monitoring" { | ||
source = "../../modules/module_DNSZone_Creation/diag_setting" | ||
resource_id = module.DNSZone_module.resource_id | ||
resource_group_name = module.DNSZone_module.resource_group | ||
resource_group_id = module.DNSZone_module.resource_group_id | ||
resource_group_location = module.DNSZone_module.resource_group_location | ||
} |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
terraform { | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "~>2.46" | ||
} | ||
} | ||
} | ||
|
||
provider "azurerm" { | ||
features {} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#----DEFAULT VALUES: DATA SOURCE: RESOURCE GROUP----# | ||
resource_group = "rg-002" | ||
create_resource_group = true | ||
location = "East US" | ||
|
||
#----DEFAULT VALUES: RESOURCE: DNS ZONE----# | ||
DNSZone_name = "mydomainref.com" | ||
email = "abc.ey.com" | ||
host_name = "ns1-03.azure-dns.com." | ||
expire_time = 2419200 | ||
minimum_ttl = 300 | ||
refresh_time = 3600 | ||
retry_time = 300 | ||
serial_number = 1 | ||
ttl = 3600 | ||
tags = { | ||
Contact_name = "ABC" | ||
Cost_Center = "999" | ||
Application_name = "Azure_DNS_ZONE" | ||
} | ||
|
||
#----DEFAULT VALUES: RESOURCE: PRIVATE DNS ZONE----# | ||
private_dns_zone_name = "mydomain.com" |
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#----------------------------------VARIABLES: DATA SOURCE: RESOURCE GROUP-------------------------------# | ||
variable "resource_group" { | ||
type = string | ||
description = "RG name in Azure" | ||
} | ||
|
||
variable "create_resource_group" { | ||
type = bool | ||
description = "create resource group" | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
description = "RG location in Azure" | ||
} | ||
|
||
#----------------------------------VARIABLES: DNS ZONE--------------------------------------------------# | ||
variable "DNSZone_name" { | ||
type = string | ||
description = "DNSZone name in Azure" | ||
} | ||
|
||
variable "email" { | ||
type = string | ||
description = "The email contact for the SOA record" | ||
} | ||
|
||
variable "host_name" { | ||
type = string | ||
description = "The domain name of the authoritative name server for the SOA record. Defaults to ns1-03.azure-dns.com." | ||
} | ||
|
||
variable "expire_time" { | ||
type = number | ||
description = "The expire time for the SOA record. Defaults to 2419200." | ||
} | ||
|
||
variable "minimum_ttl" { | ||
type = number | ||
description = "The minimum Time To Live for the SOA record. By convention, it is used to determine the negative caching duration. Defaults to 300." | ||
} | ||
|
||
variable "refresh_time" { | ||
type = number | ||
description = " The refresh time for the SOA record. Defaults to 3600." | ||
} | ||
|
||
variable "retry_time" { | ||
type = number | ||
description = "The retry time for the SOA record. Defaults to 300." | ||
} | ||
|
||
variable "serial_number" { | ||
type = number | ||
description = "The serial number for the SOA record. Defaults to 1." | ||
} | ||
|
||
variable "ttl" { | ||
type = number | ||
description = "The Time To Live of the SOA Record in seconds. Defaults to 3600." | ||
} | ||
|
||
variable "tags" { | ||
type = map(string) | ||
description = "The tags to associate with the resource." | ||
} | ||
|
||
#----------------------------------VARIABLE: PRIVATE DNS ZONE-------------------------------------------# | ||
variable "private_dns_zone_name" { | ||
type = string | ||
description = "Private DNSZone name in Azure" | ||
} | ||
|
||
#----------------------------------VARIABLES: RBAC MODULE----------------------------------------------# | ||
|
||
variable "role_definition_name" { | ||
type = list(string) | ||
description = "List of Role Definitions" | ||
default = ["Reader", "Contributor"] | ||
} | ||
|
||
#------------------------------------------------------------------------------------------------------# |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#Reference to module that provisions azure dns zone | ||
module "DNSZone_module" { | ||
source = "../../modules/module_DNSrecord_a_Creation/DNS_A_record" | ||
|
||
resource_group = var.resource_group | ||
create_resource_group = var.create_resource_group | ||
location = var.location | ||
DNSZone_name = var.DNSZone_name | ||
email = var.email | ||
host_name = var.host_name | ||
expire_time = var.expire_time | ||
minimum_ttl = var.minimum_ttl | ||
refresh_time = var.refresh_time | ||
retry_time = var.retry_time | ||
serial_number = var.serial_number | ||
ttl = var.ttl | ||
tags = var.tags | ||
DNSrecord_name = var.DNSrecord_name | ||
dns_a_ttl = var.dns_a_ttl | ||
dns_a_records = var.dns_a_records | ||
private_dns_zone_name = var.private_dns_zone_name | ||
} | ||
|
||
#Reference to module that provisions role assignment for each resource | ||
module "module_resource-role-assignment" { | ||
source = "../../modules/module_DNSrecord_a_Creation/rbac" | ||
scope = module.DNSZone_module.resource_id | ||
role_definition_name = var.role_definition_name | ||
|
||
} | ||
|
||
#Reference to module that provisions diagnostic settings of a particular resource | ||
module "dns_monitoring" { | ||
source = "../../modules/module_DNSrecord_a_Creation/diag_setting" | ||
resource_id = module.DNSZone_module.resource_id | ||
resource_group_name = module.DNSZone_module.resource_group | ||
resource_group_id = module.DNSZone_module.resource_group_id | ||
resource_group_location = module.DNSZone_module.resource_group_location | ||
} |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
terraform { | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "~>2.46" | ||
} | ||
} | ||
} | ||
|
||
provider "azurerm" { | ||
features {} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#----DEFAULT VALUES: DATA SOURCE: RESOURCE GROUP----# | ||
resource_group = "rg-002" | ||
create_resource_group = true | ||
location = "East US" | ||
|
||
#----DEFAULT VALUES: RESOURCE: DNS ZONE----# | ||
DNSZone_name = "mydomainref.com" | ||
email = "abc.ey.com" | ||
host_name = "ns1-03.azure-dns.com." | ||
expire_time = 2419200 | ||
minimum_ttl = 300 | ||
refresh_time = 3600 | ||
retry_time = 300 | ||
serial_number = 1 | ||
ttl = 3600 | ||
tags = { | ||
Contact_name = "ABC" | ||
Cost_Center = "999" | ||
Application_name = "Azure_DNS_ZONE" | ||
} | ||
|
||
#----DEFAULT VALUES: RESOURCE: DNS A RECORD----# | ||
DNSrecord_name = "Test" | ||
dns_a_ttl = 300 | ||
dns_a_records = ["10.0.180.17"] | ||
|
||
#----DEFAULT VALUES: RESOURCE: PRIVATE DNS ZONE----# | ||
private_dns_zone_name = "mydomain.com" |
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 |
---|---|---|
@@ -0,0 +1,98 @@ | ||
#----------------------------------VARIABLES: DATA SOURCE: RESOURCE GROUP-------------------------------# | ||
variable "resource_group" { | ||
type = string | ||
description = "RG name in Azure" | ||
} | ||
|
||
variable "create_resource_group" { | ||
type = bool | ||
description = "create resource group" | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
description = "RG location in Azure" | ||
} | ||
|
||
#----------------------------------VARIABLES: DNS ZONE--------------------------------------------------# | ||
variable "DNSZone_name" { | ||
type = string | ||
description = "DNSZone name in Azure" | ||
} | ||
|
||
variable "email" { | ||
type = string | ||
description = "The email contact for the SOA record" | ||
} | ||
|
||
variable "host_name" { | ||
type = string | ||
description = "The domain name of the authoritative name server for the SOA record. Defaults to ns1-03.azure-dns.com." | ||
} | ||
|
||
variable "expire_time" { | ||
type = number | ||
description = "The expire time for the SOA record. Defaults to 2419200." | ||
} | ||
|
||
variable "minimum_ttl" { | ||
type = number | ||
description = "The minimum Time To Live for the SOA record. By convention, it is used to determine the negative caching duration. Defaults to 300." | ||
} | ||
|
||
variable "refresh_time" { | ||
type = number | ||
description = " The refresh time for the SOA record. Defaults to 3600." | ||
} | ||
|
||
variable "retry_time" { | ||
type = number | ||
description = "The retry time for the SOA record. Defaults to 300." | ||
} | ||
|
||
variable "serial_number" { | ||
type = number | ||
description = "The serial number for the SOA record. Defaults to 1." | ||
} | ||
|
||
variable "ttl" { | ||
type = number | ||
description = "The Time To Live of the SOA Record in seconds. Defaults to 3600." | ||
} | ||
|
||
variable "tags" { | ||
type = map(string) | ||
description = "The tags to associate with the resource." | ||
} | ||
|
||
#------------------------------VARIABLE: RESOURCE: DNS A RECORD--------------------------------------------# | ||
variable "DNSrecord_name" { | ||
type = string | ||
description = "DNSrecord name in Azure" | ||
} | ||
|
||
variable "dns_a_ttl" { | ||
type = number | ||
description = "Time To Live of the DNS record in seconds" | ||
} | ||
|
||
variable "dns_a_records" { | ||
type = list(string) | ||
description = "List of IPv4 Addresses" | ||
} | ||
|
||
#----------------------------------VARIABLE: PRIVATE DNS ZONE-------------------------------------------# | ||
variable "private_dns_zone_name" { | ||
type = string | ||
description = "Private DNSZone name in Azure" | ||
} | ||
|
||
#----------------------------------VARIABLES: RBAC MODULE----------------------------------------------# | ||
|
||
variable "role_definition_name" { | ||
type = list(string) | ||
description = "List of Role Definitions" | ||
default = ["Reader", "Contributor"] | ||
} | ||
|
||
#------------------------------------------------------------------------------------------------------# |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#Reference to module that provisions azure dns zone | ||
module "DNSZone_module" { | ||
source = "../../modules/module_DNSrecord_aaaa_Creation/DNS_zone" | ||
|
||
resource_group = var.resource_group | ||
create_resource_group = var.create_resource_group | ||
location = var.location | ||
DNSZone_name = var.DNSZone_name | ||
email = var.email | ||
host_name = var.host_name | ||
expire_time = var.expire_time | ||
minimum_ttl = var.minimum_ttl | ||
refresh_time = var.refresh_time | ||
retry_time = var.retry_time | ||
serial_number = var.serial_number | ||
ttl = var.ttl | ||
tags = var.tags | ||
DNSrecord_name = var.DNSrecord_name | ||
dns_aaaa_ttl = var.dns_aaaa_ttl | ||
dns_aaaa_records = var.dns_aaaa_records | ||
private_dns_zone_name = var.private_dns_zone_name | ||
} | ||
|
||
#Reference to module that provisions role assignment for each resource | ||
module "module_resource-role-assignment" { | ||
source = "../../modules/module_DNSrecord_aaaa_Creation/rbac" | ||
scope = module.DNSZone_module.resource_id | ||
role_definition_name = var.role_definition_name | ||
|
||
} | ||
|
||
#Reference to module that provisions diagnostic settings of a particular resource | ||
module "dns_monitoring" { | ||
source = "../../modules/module_DNSrecord_aaaa_Creation/diag_setting" | ||
resource_id = module.DNSZone_module.resource_id | ||
resource_group_name = module.DNSZone_module.resource_group | ||
resource_group_id = module.DNSZone_module.resource_group_id | ||
resource_group_location = module.DNSZone_module.resource_group_location | ||
} |
Oops, something went wrong.