Giter Site home page Giter Site logo

goci-io / aws-route53-zone Goto Github PK

View Code? Open in Web Editor NEW
3.0 6.0 2.0 79 KB

Provisions a AWS Route53 Hosted Zone and optionally synchronises Nameservers with a Parent Zone

License: Apache License 2.0

Makefile 4.58% HCL 95.42%
terraform route53 dns nameserver aws delegation route53-zone

aws-route53-zone's Introduction

aws-route53-zone

terraform

This Terraform Module provisions a new AWS Route53 Hosted Zone and optionally synchronizes Nameserver with a Parent Zone.

The domain_name can either be specified in the terraform.tfvars or autogenerated from a label module. When autogenerating the name the following convention is applied: <name>.<stage>.<attributes>.<namespace>.tld. The tld will be sourced either from parent_domain_zone if set or the tld variable itself. For the following stages the stage will be omitted when using the autogenerated label (prod, production, main)

Usage

module "zone" {
  source      = "git::https://github.com/goci-io/aws-route53-zone.git?ref=tags/<latest-version>"
  namespace   = "goci"
  attributes  = ["eu1"]
  stage       = "staging"
  domain_name = "staging.goci.io"
}

This example will result in a hosted zone with the name staging.eu1.goci.io

Take a look into the terraform.tfvars to see more Examples. See Delegated Zone Access on how to configure Nameserver Synchronization with a parent Zone.

Configuration

Name Description Default
namespace The company or organization prefix (eg: goci) -
stage The stage this configuration is for (eg: staging or prod) -
name Optional name (subdomain) for this hosted zone ""
attributes Additional attributes (e.g. ["eu1"]) []
tags Additional tags (e.g. map("BusinessUnit", "XYZ") {}
delimiter  Delimiter between namespace, stage, name and attributes  -
domain_name Overwrite auto generated domain name ""
enabled Set to false to prevent the module from creating any resources true
tld The top level domain to use if not already specified via domain_name or parent_domain_name -
parent_domain_name The parent hosted zone to sync Nameservers with ""
is_parent_private_zone Whether the parent hosted zone is private false
certificate_enabled Whether to create an AWS ACM certificate true
certificate_alternative_names Additional domains to include in the certificate. Includes always *. []
omit_prod_stage Whether the prod stage should be omitted from the zone name (when stage is prod, production or main) true
create_public_zone If the new hosted zone is private and you want to validate for example an ACM certificate an additional public zone can be created true
zone_vpcs VPC IDs to attach to the hosted zone. This makes the hosted zone private. []
tf_bucket The bucket name to read the remote state from (required if vpc_module_state is used) ""
vpc_module_state The key to the state file of an vpc module. Must expose vpc_id output ""
force_destroy Whether to destroy all records (possibly managed outside of Terraform) in the zone when destroying the zone false

Delegated Zone Access

Specifying parent_domain_name allows you to delegate Access from a parent Domain to your new Hosted Zone. This is useful when you have an AWS Root Account for example which owns your Domains and delegates stage bound Hosted Zones to your Child Accounts.

To create Nameserver Records in a Parent Domain which is not owned by your current AWS Account you can configure AWS Providers like this:

provider "aws" {
  # Current Account
  version = "~> 2.70"
}

provider "aws" {
  alias   = "parent"
  version = "~> 2.70"

  assume_role {
    role_arn = "arn:aws:iam::<ACCOUNT_ID>:role/<ROLE_NAME>"
  }
}

module "zone" {
  source = "git::https://github.com/goci-io/aws-route53-zone.git?ref=tags/<latest-version>"
  ...

  providers = {
    aws.owner  = aws.parent
    # aws      = aws.target If you are running in a completely different Account
  }
}

aws-route53-zone's People

Contributors

etwillbefine avatar goci-bot avatar morton avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

morton nabadger

aws-route53-zone's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.