diff --git a/scripts/terraform/dns/dns-record-web-cms.tf b/scripts/terraform/dns/dns-record-web-cms.tf new file mode 100644 index 0000000..05bb561 --- /dev/null +++ b/scripts/terraform/dns/dns-record-web-cms.tf @@ -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 +} diff --git a/scripts/terraform/dns/dns-record-web-template-configuration.tf b/scripts/terraform/dns/dns-record-web-template-configuration.tf new file mode 100644 index 0000000..786920e --- /dev/null +++ b/scripts/terraform/dns/dns-record-web-template-configuration.tf @@ -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 +} diff --git a/scripts/terraform/dns/dns-zone.tf b/scripts/terraform/dns/dns-zone.tf new file mode 100644 index 0000000..7874b71 --- /dev/null +++ b/scripts/terraform/dns/dns-zone.tf @@ -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 +}