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β
| Name | Type | Description |
|---|---|---|
region | string | AWS region to deploy the DNS zone |
zone_name | string | DNS name for the private hosted zone (e.g., internal.example.com) |
vpc_id | string | ID of the VPC to associate with the hosted zone |
environment | string | Tag to specify the deployment environment (e.g., dev, prod) |
π€ Outputsβ
| Name | Description |
|---|---|
zone_id | The ID of the created Route 53 private hosted zone |
zone_name | The full DNS name of the hosted zone |
vpc_id | The 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.