Skip to main content

DNS Zone (Private)

πŸ“¦ Overview​

This Terraform module provisions a private Route 53 DNS zone in AWS and associates it with a specific VPC for internal name resolution.

It’s ideal for microservice architectures, containerized workloads, and service discovery inside isolated cloud networks.


βœ… Key Features​

  • Creates a Route 53 private hosted zone
  • Attaches the zone to a specified VPC
  • Ensures all DNS records remain private and internal
  • Supports environment tagging and resource grouping

πŸ’Ό Use Cases​

  • Private service discovery for ECS/EKS workloads
  • Internal DNS resolution across isolated environments
  • Microservice intercommunication in private subnets
  • Hybrid DNS setups in multi-account or multi-region designs

πŸ“₯ Input Variables​

NameTypeDescription
regionstringAWS region to deploy the DNS zone
zone_namestringDNS name for the private hosted zone (e.g., internal.example.com)
vpc_idstringID of the VPC to associate with the hosted zone
environmentstringTag to specify the deployment environment (e.g., dev, prod)

πŸ“€ Outputs​

NameDescription
zone_idThe ID of the created Route 53 private hosted zone
zone_nameThe full DNS name of the hosted zone
vpc_idThe VPC ID that was associated with the hosted zone

πŸš€ Deployment Readiness​

  • βœ… Compatible with Terraform 1.0+
  • βœ… Tested with AWS provider 5.x
  • πŸ§ͺ Requires existing VPC in the target region

πŸ› οΈ Example Usage​

module "dns_zone_private" {
source = "git::ssh://git@github.com/archiphire/aws-level-1-modules.git//network/dns-zone-private?ref=v1.0.0"

region = "us-east-1"
zone_name = "internal.example.com"
vpc_id = "vpc-0123456789abcdef0"
environment = "dev"
}
terraform init
terraform plan
terraform apply

or

tofu init
tofu plan
tofu apply

🧹 Cleanup Options​

To remove the DNS zone and its VPC association:

terraform destroy

or

tofu destroy

⚠️ Use caution when destroying DNS zones that are actively referenced by internal services.

πŸ›‘οΈ Notes​

This is a Level 1 networking module designed for isolated environments. To scale this for multiple VPCs or regions, consider composing with a Level 2 network stack for cross-VPC associations or DNS forwarding.

πŸ”’ Deployment Package Notice​

This module is part of the Level 1 AWS License Tier. To access the full deployment package and source code, subscribe to Archiphire.