DNS Zone (Public)
π¦ Overviewβ
This Terraform module provisions a public Route 53 hosted zone for a given domain name, allowing DNS resolution over the internet.
It serves as the foundational layer for routing traffic to cloud-hosted services like websites, APIs, or load balancers.
β Key Featuresβ
- Creates a Route 53 public hosted zone
- Accepts domain name and AWS region as input
- Tags all resources with environment and ownership metadata
- Outputs name servers for registrar configuration
πΌ Use Casesβ
- Hosting public websites or APIs behind custom domain names
- Registering subdomains for cloud infrastructure (e.g.,
app.example.com) - Managing domain routing to S3 static sites, ALBs, or CloudFront distributions
- Starting point for full public DNS management infrastructure
π₯ Input Variablesβ
| Name | Type | Description |
|---|---|---|
region | string | AWS region where the DNS zone will be managed |
domain_name | string | Public domain name (e.g., example.com) |
environment | string | Tag to specify the deployment environment (e.g., dev, prod) |
π€ Outputsβ
| Name | Description |
|---|---|
zone_id | The ID of the created Route 53 public hosted zone |
zone_name_servers | List of name servers to configure with your domain registrar |
π Deployment Readinessβ
- β Compatible with Terraform 1.0+
- β Tested with AWS provider 5.x
- π§ͺ Requires domain ownership and access to a registrar for NS configuration
π οΈ Example Usageβ
module "dns_zone_public" {
source = "git::ssh://git@github.com/archiphire/aws-level-1-modules.git//network/dns-zone-public?ref=v1.0.0"
region = "us-east-1"
domain_name = "example.com"
environment = "prod"
}
terraform init
terraform plan
terraform apply
or
tofu init
tofu plan
tofu apply
π§Ή Cleanup Optionsβ
For testing:
terraform destroy
or
tofu destroy
For production:
Manually delete the hosted zone via the AWS Console or CLI if it is actively routing internet traffic to avoid outages or DNS failures.
π‘οΈ Notesβ
This is a Level 1 foundational networking module. To activate the zone, update your domain registrarβs NS records using the zone_name_servers output provided by this module.
π 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.