rvn-route53 · Latest version: 0.2.0
Readme
Manage Route 53 hosted zones, DNS records, query logging, and DNSSEC.Overview
Use this module to create a Route 53 public or private hosted zone, manage DNS records in a created or existing zone, and optionally enable query logging or DNSSEC signing. A hosted zone is Route 53’s term for the DNS zone and name-server setup for a domain. If you are not familiar with the term, think of it as the place where Route 53 serves DNS records for your domain. The module supports standard records, alias records for AWS targets, and advanced Route 53 routing policies such as weighted, failover, latency, geolocation, and multivalue answer routing.Use cases
Hosted zone mode
Enable Create hosted zone to create a new public or private hosted zone. In practical terms, this creates the Route 53-managed DNS zone that provides the name servers for your domain. Public zones return AWS name servers that you can delegate from your registrar or parent zone. Private zones require at least one VPC association. Disable Create hosted zone when the zone already exists and you only want this stack to manage records in it. In that mode, provide Hosted zone ID.DNS records
DNS records are configured as structured entries. Terraform derives each resource key from the record name, type, and optional set identifier. Each record includes a record name, record type, and either standard record values with a TTL or an alias target. Standard records use TTL seconds and Record values. CNAME and SOA records use a single Record value because those record types accept exactly one value. Alias targets are exposed for A and AAAA records, which is the normal pattern for routing to AWS resources such as load balancers, CloudFront distributions, API Gateway domains, and S3 website endpoints. Alias records use Alias target DNS name and Alias target hosted zone ID. The alias target hosted zone ID belongs to the AWS target resource, not this domain’s hosted zone. For an ALB or NLB, use the load balancer canonical hosted zone ID. For CloudFront, use Z2FDTNDATAQYW2. Regional services such as API Gateway and S3 website endpoints have service and region-specific hosted zone IDs. Routing policy is optional. Use Set identifier for records that share the same name and type with weighted, failover, latency, or geolocation routing.Query logging
Query logging streams Route 53 DNS query logs for public hosted zones to CloudWatch Logs. By default, the module creates the log group and resource policy in us-east-1, which is where Route 53 requires query logging destinations and permissions. Disable Create query log group only when you want to reuse an existing us-east-1 CloudWatch Logs log group. In that mode, provide Query log group ARN. The module still creates the resource policy that allows Route 53 to create log streams and write log events.DNSSEC
DNSSEC signing is supported for public hosted zones and requires a customer-managed KMS key in us-east-1 with a key policy that allows Route 53 DNSSEC signing. After enabling DNSSEC, publish the DS record from the stack output in the parent zone or registrar.Configuration
Design decisions
Hosted zone identity inputs are immutable because changing them can move records between zones or create a different zone. Operational settings such as records, query logging, DNSSEC status, and tags remain editable. Route 53 hosted zones are global resources. The Region input controls where the Terraform runner and AWS provider operate, and some features such as public-zone query logging and DNSSEC KMS keys still require us-east-1 resources. The module uses us-east-1 automatically for managed query log groups and resource policies. Ravion adds standard tags for ownership and traceability. User-provided Tags are merged on top for team, cost, or environment metadata.Learn more
Inputs reference
All inputs forrvn-route53 version 0.2.0. Use the name shown for each field as the input key in module config.
AWS account & region
AWS account.
- Immutable after creation
Region.
- Immutable after creation
Hosted zone and name server
Create hosted zone. Create a new Route 53 hosted zone, which is Route 53’s DNS zone and name-server setup for a domain. Disable this to manage records in an existing hosted zone.
- Default:
true - Immutable after creation
Hosted zone ID. Existing Route 53 hosted zone ID to manage records in. A hosted zone is Route 53’s DNS zone and name-server setup for a domain. Required when Create hosted zone is disabled.
- Immutable after creation
- Pattern:
^Z[0-9A-Z]+$— Use a valid Route 53 hosted zone ID, for example Z1234567890ABC. - Shown when:
{"zone_creation_enabled":false}
Domain name. Fully qualified domain name for the hosted zone.
- Immutable after creation
- Pattern:
^[a-zA-Z0-9]([a-zA-Z0-9-._]*[a-zA-Z0-9])?$— Use a valid domain name, for example example.com. - Shown when:
{"zone_creation_enabled":true}
Comment. Comment stored on the hosted zone.
- Default:
Managed in Ravion - Shown when:
{"zone_creation_enabled":true}
Force destroy records. Destroy all records in the hosted zone when the created zone is destroyed.
- Default:
false - Shown when:
{"zone_creation_enabled":true}
Delegation set ID. Reusable delegation set ID for a public hosted zone. Use this when you want multiple hosted zones to use the same authoritative name servers, for example to keep registrar or parent-zone delegation consistent across related domains.
- Shown when:
{"private_zone_enabled":false,"zone_creation_enabled":true}
Private hosted zone. Create a private hosted zone associated with VPCs instead of a public hosted zone.
- Default:
false - Immutable after creation
- Shown when:
{"zone_creation_enabled":true}
VPC associations. VPCs to associate with the private hosted zone.
- Shown when:
{"private_zone_enabled":true,"zone_creation_enabled":true}
DNS records
Records. DNS records to create in the hosted zone.
Query logging
Query logging. Enable Route 53 query logging for the public hosted zone.
- Default:
false - Shown when:
{"private_zone_enabled":false}
Create query log group. Create the CloudWatch Logs log group and resource policy in us-east-1 for Route 53 query logs.
- Default:
true - Shown when:
{"private_zone_enabled":false,"query_logging_enabled":true}
Query log group name. Name for the created CloudWatch Logs log group. Defaults to /aws/route53/<hosted-zone-name>.
- Shown when:
{"private_zone_enabled":false,"query_log_group_creation_enabled":true,"query_logging_enabled":true}
Query log retention days. Number of days to retain query logs. Use 0 to retain logs indefinitely.
- Default:
90 - Allowed values:
0(Never expire),1(1 day),3(3 days),5(5 days),7(7 days),14(14 days),30(30 days),60(60 days),90(90 days),180(180 days),365(1 year),731(2 years),1827(5 years),3653(10 years) - Shown when:
{"private_zone_enabled":false,"query_log_group_creation_enabled":true,"query_logging_enabled":true}
Query log resource policy name. Name for the CloudWatch Logs resource policy that allows Route 53 to write query logs. Defaults to a hosted-zone-derived name.
- Shown when:
{"private_zone_enabled":false,"query_logging_enabled":true}
Query log group ARN. Existing CloudWatch Logs log group ARN for Route 53 query logs. The module will still create the required Route 53 resource policy.
- Pattern:
^arn:aws:logs:— Use a valid CloudWatch Logs log group ARN. - Shown when:
{"private_zone_enabled":false,"query_log_group_creation_enabled":false,"query_logging_enabled":true}
DNSSEC
DNSSEC signing. Enable DNSSEC signing for the hosted zone.
- Default:
false - Shown when:
{"private_zone_enabled":false}
DNSSEC KMS key ARN. Customer-managed KMS key ARN in us-east-1 used for DNSSEC signing.
- Pattern:
^arn:aws:kms:us-east-1:— Use a valid KMS key ARN in us-east-1. - Shown when:
{"dnssec_enabled":true,"private_zone_enabled":false}
DNSSEC signing status. DNSSEC key signing status.
- Default:
SIGNING - Allowed values:
SIGNING(Signing),NOT_SIGNING(Not signing) - Shown when:
{"dnssec_enabled":true,"private_zone_enabled":false}
Misc
Tags. A map of tags to assign to all resources. Default tags are
Owner, ProjectGivenId, EnvironmentGivenId, ModuleGivenId, ModuleIdTerraform settings
OpenTofu version override. Override the environment’s default version for this module
Ravion Terraform workspace name. Override Terraform state backend workspace name. Defaults to project + environment + module given ids.
- Immutable after creation
Advanced Terraform variables. Optional raw Terraform variable overrides for advanced module inputs or one-off overrides. Values here override the generated variables above.
- Default:
{}
Terraform execution environment. Override the execution environment for Terraform runners. Must use the same AWS account as selected above.