Skip to content

Senora-dev/terraform-aws-route53-zone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Route53 Zones Terraform Module

This Terraform module creates Route53 hosted zones in AWS.

Features

  • Support for both public and private hosted zones
  • Multiple zones can be created at once using a map
  • VPC associations for private hosted zones
  • Configurable zone parameters (comments, delegation sets, etc.)
  • Comprehensive tagging support

Usage

Public Zone

module "zones" {
  source = "Senora-dev/route53-zone/aws"

  zones = {
    "example.com" = {
      comment = "Public zone for example.com"
      tags = {
        Environment = "production"
      }
    }
  }

  tags = {
    Terraform = "true"
  }
}

Private Zone

module "zones" {
  source = "path/to/terraform-aws-route53-zones"

  zones = {
    "internal.example.com" = {
      comment = "Private zone for internal.example.com"
      vpc = [{
        vpc_id = "vpc-12345678"
      }]
      tags = {
        Environment = "production"
      }
    }
  }
}

Multiple Zones

module "zones" {
  source = "path/to/terraform-aws-route53-zones"

  zones = {
    "example.com" = {
      comment = "Public zone for example.com"
    }
    "internal.example.com" = {
      comment = "Private zone for internal.example.com"
      vpc = [{
        vpc_id = "vpc-12345678"
      }]
    }
  }

  tags = {
    Terraform = "true"
    Environment = "production"
  }
}

Requirements

Name Version
terraform >= 1.0
aws >= 4.0

Providers

Name Version
aws >= 4.0

Inputs

Name Description Type Default Required
zones Map of Route53 zone parameters map(object({...})) n/a yes
tags Tags to apply to all resources map(string) {} no

zones

The zones variable accepts a map of zone names to zone configurations. Each zone configuration can include:

  • comment - (Optional) A comment for the hosted zone
  • delegation_set_id - (Optional) The ID of the reusable delegation set
  • force_destroy - (Optional) Whether to destroy all records in the zone when destroying the zone
  • vpc - (Optional) Configuration block(s) for VPC association
    • vpc_id - The VPC ID to associate with
    • vpc_region - (Optional) The VPC's region (defaults to the current region)
  • tags - (Optional) A map of tags to assign to the zone

Outputs

Name Description
route53_zone_zone_id Map of zone names to zone IDs
route53_zone_name_servers Map of zone names to name servers
route53_zone_name Map of zone names to zone names

Examples

Examples are available in the examples directory:

  • complete - A complete example showing all features
  • public-zones - Example of public hosted zones
  • private-zones - Example of private hosted zones with VPC association

Authors

Module created and maintained by [Your Name]

License

Apache 2 Licensed. See LICENSE for full details.

Maintainers

This module is maintained by Senora.dev.

About

This Terraform module creates Route53 hosted zones in AWS.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages