cytopia / terraform-aws-route53-zone

A Terraform module that handles creation of multiple Route53 zones including attachment to new or existing delegation set
https://registry.terraform.io/modules/cytopia/route53-zone/aws/
MIT License
14 stars 18 forks source link

Terraform 012 #8

Closed cytopia closed 4 years ago

cytopia commented 4 years ago

Terraform 012

Related

Scope

This PR only adjusts the current state, hence not adding private zones (as they were not available before).

New usage

module "public_zone" {
  source = "github.com/cytopia/terraform-aws-route53-zone?ref=v1.0.0"

  # Create as many delegation sets as are required
  delegation_sets = [
    "root-zone",
    "sub-zone",
  ]

  # If delegation set is null, it will use AWS defaults.
  public_root_zones = [
    {
      name           = "example.com",
      delegation_set = "root-zones",
    },
    {
      name           = "example.org",
      delegation_set = null,
    },
  ]

  # If delegation set is null, it will use AWS defaults.
  # Specify your own nameserver or use an empty list to use AWS defaults.
  public_subdomain_zones = [
    {
      name           = "internal.example.org",
      root           = "example.org",
      ns_ttl         = 30,
      nameservers    = [],
      delegation_set = null,
    },
    {
      name           = "private.example.org",
      root           = "example.org",
      ns_ttl         = 30,
      nameservers    = ["1.1.1.1", "2.2.2.2", "3.3.3.3", "4.4.4.4"],
      delegation_set = "sub-zone",
    },
  ]

  tags = {
    Environment    = "prod"
    Infrastructure = "core"
    Owner          = "terraform"
    Project        = "zones-public"
  }

  comment = "Managed by Terraform"
}

Tagging

As the current PR introduces breaking changes, so the major version will be updated and tagged with v0.1.0