Skip to content

Commit

Permalink
rought TF for dns?.
Browse files Browse the repository at this point in the history
  • Loading branch information
RossBugginsNHS committed May 17, 2024
1 parent 3cb5fe2 commit db1a393
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/terraform/dns/dns-record-web-cms.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
variable "webcms_zones" {
type = set(string)
description = "Web CMS Zones"
default = ["ns1.example.com", "ns2.example.com", "ns3.example.com", "ns4.example.com"]
}

resource "aws_route53_record" "webCmsZone" {
allow_overwrite = local.default_ns_allow_override
name = "cms"
ttl = local.default_ns_ttl
type = local.default_ns_type
zone_id = aws_route53_zone.primary.zone_id
records = var.webcms_zones
}
15 changes: 15 additions & 0 deletions scripts/terraform/dns/dns-record-web-template-configuration.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

variable "template_configuration_zones" {
type = set(string)
description = "Zones"
default = ["ns1.example.com", "ns2.example.com", "ns3.example.com", "ns4.example.com"]
}

resource "aws_route53_record" "templateZone" {
allow_overwrite = local.default_ns_allow_override
name = "templates"
ttl = local.default_ns_ttl
type = local.default_ns_type
zone_id = aws_route53_zone.primary.zone_id
records = var.webcms_zones
}
30 changes: 30 additions & 0 deletions scripts/terraform/dns/dns-zone.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
variable "root_domain" {
description = "The root domain"
default = "somethingelse.notareaddomain"
}

variable "programme_name" {
description = "The programme name"
default = "nhsnotify"
}

variable "environment_name" {
description = "Environment name"
default = "dev123"
}

variable "environment_type" {
description = "Environment type"
default = "dev"
}

locals {
default_ns_ttl = 172800
default_ns_type = "NS"
default_ns_allow_override = true
domain_name = "${var.environment_name}.${var.environment_type}.${var.programme_name}.${var.root_domain}"
}

resource "aws_route53_zone" "primary" {
name = local.domain_name
}

0 comments on commit db1a393

Please sign in to comment.