# 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

```hcl
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
      }
    }
  }
}
```

<!-- BEGIN_TF_DOCS — DO NOT EDIT BELOW THIS LINE -->
## Requirements

| Name | Version |
| ---- | ------- |
| <a name="requirement_terraform"></a> [terraform](#requirement_terraform) | ~> 1.5 |
| <a name="requirement_aws"></a> [aws](#requirement_aws) | ~> 6.50 |

## Providers

| Name | Version |
| ---- | ------- |
| <a name="provider_aws"></a> [aws](#provider_aws) | 6.50.0 |

## Resources

| Name | Type |
| ---- | ---- |
| [aws_route53_health_check.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_health_check) | resource |
| [aws_route53_record.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_route53_resolver_rule.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_resolver_rule) | resource |
| [aws_route53_resolver_rule_association.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_resolver_rule_association) | resource |
| [aws_route53_zone.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone) | resource |

## Inputs

| Name | Description | Type | Default | Required |
| ---- | ----------- | ---- | ------- | :------: |
| <a name="input_health_checks"></a> [health_checks](#input_health_checks) | Map of Route 53 health checks | <pre>map(object({<br/>    fqdn              = optional(string, null)<br/>    ip_address        = optional(string, null)<br/>    port              = optional(number, 443)<br/>    type              = optional(string, "HTTPS")<br/>    resource_path     = optional(string, "/health")<br/>    failure_threshold = optional(number, 3)<br/>    request_interval  = optional(number, 30)<br/>  }))</pre> | `{}` | no |
| <a name="input_records"></a> [records](#input_records) | Map of DNS record definitions | <pre>map(object({<br/>    zone_key = string<br/>    name     = string<br/>    type     = string<br/>    ttl      = optional(number, null)<br/>    records  = optional(list(string), null)<br/>    alias = optional(object({<br/>      name                   = string<br/>      zone_id                = string<br/>      evaluate_target_health = optional(bool, true)<br/>    }), null)<br/>    health_check_id        = optional(string, null)<br/>    set_identifier         = optional(string, null)<br/>    weight                 = optional(number, null)<br/>    latency_routing_policy = optional(object({ region = string }), null)<br/>    failover               = optional(string, null)<br/>    allow_overwrite        = optional(bool, false)<br/>  }))</pre> | `{}` | no |
| <a name="input_resolver_rules"></a> [resolver_rules](#input_resolver_rules) | Map of Route 53 resolver rules for hybrid DNS | <pre>map(object({<br/>    domain_name          = string<br/>    rule_type            = optional(string, "FORWARD")<br/>    resolver_endpoint_id = optional(string, null)<br/>    target_ips = optional(list(object({<br/>      ip   = string<br/>      port = optional(number, 53)<br/>    })), [])<br/>    vpc_ids = optional(list(string), [])<br/>  }))</pre> | `{}` | no |
| <a name="input_tags"></a> [tags](#input_tags) | Resource tags to apply to all resources | `map(string)` | `{}` | no |
| <a name="input_zones"></a> [zones](#input_zones) | Map of hosted zone definitions | <pre>map(object({<br/>    name    = string<br/>    comment = optional(string, "Managed by Terraform")<br/>    private = optional(bool, false)<br/>    vpc_ids = optional(list(string), [])<br/>  }))</pre> | `{}` | no |

## Outputs

| Name | Description |
| ---- | ----------- |
| <a name="output_health_check_ids"></a> [health_check_ids](#output_health_check_ids) | Map of health check logical key to ID |
| <a name="output_resolver_rule_ids"></a> [resolver_rule_ids](#output_resolver_rule_ids) | Map of resolver rule logical key to ID |
| <a name="output_zone_arns"></a> [zone_arns](#output_zone_arns) | Map of zone logical key to hosted zone ARN |
| <a name="output_zone_ids"></a> [zone_ids](#output_zone_ids) | Map of zone logical key to hosted zone ID |
| <a name="output_zone_name_servers"></a> [zone_name_servers](#output_zone_name_servers) | Map of zone logical key to NS record values |
<!-- END_TF_DOCS — DO NOT EDIT ABOVE THIS LINE -->
