route53
Manages Route 53 public and private hosted zones, DNS records, health checks, and resolver rules.
Creates public and private hosted zones with optional VPC associations, all common record types including alias records, weighted/latency/failover routing policies, HTTP/HTTPS health checks, and Resolver forwarding rules for hybrid DNS. Private zones are associated with the supplied VPC IDs.
Usage
module "route53" {
source = "hcassc.jfrog.io/iac-terraform-modules-virtual/networking/route53/aws"
version = "0.1.0"
zones = {
public = { name = "example.com" }
private = { name = "internal.example.com", private = true, vpc_ids = [module.vpc.id] }
}
records = {
api = {
zone_key = "public"
name = "api"
type = "A"
alias = {
name = module.load_balancer.dns_name
zone_id = module.load_balancer.zone_id
}
}
}
}
Requirements
| Name | Version |
|---|---|
| terraform | ~> 1.5 |
| aws | ~> 6.50 |
Providers
| Name | Version |
|---|---|
| aws | 6.50.0 |
Resources
| Name | Type |
|---|---|
| aws_route53_health_check.this | resource |
| aws_route53_record.this | resource |
| aws_route53_resolver_rule.this | resource |
| aws_route53_resolver_rule_association.this | resource |
| aws_route53_zone.this | resource |
Inputs
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| health_checks | Map of Route 53 health checks | map(object({ fqdn = optional(string, null) ip_address = optional(string, null) port = optional(number, 443) type = optional(string, "HTTPS") resource_path = optional(string, "/health") failure_threshold = optional(number, 3) request_interval = optional(number, 30) })) | {} |
no |
| records | Map of DNS record definitions | map(object({ zone_key = string name = string type = string ttl = optional(number, null) records = optional(list(string), null) alias = optional(object({ name = string zone_id = string evaluate_target_health = optional(bool, true) }), null) health_check_id = optional(string, null) set_identifier = optional(string, null) weight = optional(number, null) latency_routing_policy = optional(object({ region = string }), null) failover = optional(string, null) allow_overwrite = optional(bool, false) })) | {} |
no |
| resolver_rules | Map of Route 53 resolver rules for hybrid DNS | map(object({ domain_name = string rule_type = optional(string, "FORWARD") resolver_endpoint_id = optional(string, null) target_ips = optional(list(object({ ip = string port = optional(number, 53) })), []) vpc_ids = optional(list(string), []) })) | {} |
no |
| tags | Resource tags to apply to all resources | map(string) |
{} |
no |
| zones | Map of hosted zone definitions | map(object({ name = string comment = optional(string, "Managed by Terraform") private = optional(bool, false) vpc_ids = optional(list(string), []) })) | {} |
no |
Outputs
| Name | Description |
|---|---|
| health_check_ids | Map of health check logical key to ID |
| resolver_rule_ids | Map of resolver rule logical key to ID |
| zone_arns | Map of zone logical key to hosted zone ARN |
| zone_ids | Map of zone logical key to hosted zone ID |
| zone_name_servers | Map of zone logical key to NS record values |