Skip to content

Commit

Permalink
issue #36: Create DNS zone for inspection.alpha.canada.ca (#46)
Browse files Browse the repository at this point in the history
* issue #36: created DNS zone for inspection.alpha.canada.ca

* issue #36: removed unused variables

* issue #36: fixed terraform linting errors

* issue #36: renamed versions.tf to providers.tf

* issue #36: renamed versions.tf to providers.tf for every modules

* issue #36: renamed wronf file

* issue #36: added A records for the DNS zone

* issue #36: deployed ingress nginx on the AKS cluster + folder structure

* issue #36: fixed yaml linting errors

* issue #36: fixed linting yaml error

* issue #36: fixed linting yaml error

* issue #36: fixed linting yaml error

* issue #36: added tags for azurerm_dns_a_record
  • Loading branch information
ThomasCardin authored Feb 19, 2024
1 parent 8bbc10f commit 2e49407
Show file tree
Hide file tree
Showing 26 changed files with 737 additions and 0 deletions.
645 changes: 645 additions & 0 deletions kubernetes/aks/system/ingress-nginx/ingress-nginx.yaml

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions terraform/modules/azure-dns/dns.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
resource "azurerm_dns_zone" "dns_zone" {
name = var.dns_zone_name
resource_group_name = var.rg_name

soa_record {
email = var.soa_record_tech_contact_email
}

tags = var.tags
}

resource "azurerm_dns_a_record" "dns_zone_a_record" {
name = var.dns_a_record_name
zone_name = azurerm_dns_zone.dns_zone.name
resource_group_name = var.rg_name
ttl = 300
records = var.dns_a_records

tags = var.tags
}
11 changes: 11 additions & 0 deletions terraform/modules/azure-dns/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
terraform {

required_version = ">= 1.7.2"

required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.25"
}
}
}
29 changes: 29 additions & 0 deletions terraform/modules/azure-dns/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
variable "rg_name" {
description = "Name of the resource group"
type = string
}

variable "dns_zone_name" {
description = "azurerm_dns_zone name"
type = string
}

variable "tags" {
description = "(Optional) A mapping of tags to assign to the resource."
type = map(string)
}

variable "soa_record_tech_contact_email" {
description = "SOA Record tech contact email"
type = string
}

variable "dns_a_record_name" {
description = "DNS A Record name"
type = string
}

variable "dns_a_records" {
description = "DNS A records list"
type = list(string)
}
12 changes: 12 additions & 0 deletions terraform/staging/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ module "cluster-network-0" {
# # ..
# }

module "azure-dns-staging" {
source = "../modules/azure-dns"

rg_name = azurerm_resource_group.rg.name

dns_zone_name = var.dns_zone_name
dns_a_record_name = var.dns_a_record_name
dns_a_records = var.dns_a_records

tags = var.tags
soa_record_tech_contact_email = var.soa_record_tech_contact_email
}

module "aks-cluster-0" {

Expand Down
20 changes: 20 additions & 0 deletions terraform/staging/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,26 @@ variable "aks_admin_group_object_ids" {
type = list(string)
}

variable "soa_record_tech_contact_email" {
description = "SOA Record tech contact email"
type = string
}

variable "dns_zone_name" {
description = "azurerm_dns_zone name"
type = string
}

variable "dns_a_record_name" {
description = "DNS A Record name"
type = string
}

variable "dns_a_records" {
description = "DNS A records list"
type = list(string)
}

# variable "ad_groups" {
# description = "ad groups to be used in aks rolebindings"
# type = list(string)
Expand Down

0 comments on commit 2e49407

Please sign in to comment.