Coder Social home page Coder Social logo

inf-tf-route-53's Introduction

INF-tf-route-53

Terraform module for configuring route 53 with maps

This project is internal open source and currently maintained by the INF.

This project is using pre-commit to generate parts of the readme.

Requirements

The following requirements are needed by this module:

  • terraform (>= 0.12)

Providers

The following providers are used by this module:

  • aws

Required Inputs

The following input variables are required:

zone_id

Description: zone id of domain

Type: string

Optional Inputs

The following input variables are optional (have default values):

a_alias_records

Description: map of objects for A alias records

Type:

map(object({
    name    = string
    record  = string
    zone_id = string
  }))

Default: {}

a_records

Description: map of objects for A records

Type:

map(object({
    name    = string
    records = list(string)
  }))

Default: {}

aaaa_alias_records

Description: map of objects for AAAA alias records

Type:

map(object({
    name    = string
    record  = string
    zone_id = string
  }))

Default: {}

aaaa_records

Description: map of objects for AAAA records

Type:

map(object({
    name    = string
    records = list(string)
  }))

Default: {}

cname_records

Description: map of objects for CNAME records

Type:

map(object({
    name    = string
    records = list(string)
  }))

Default: {}

mx_records

Description: list of mx records with weight

Type: list(string)

Default: []

ns_records

Description: map of objects for NS records

Type:

map(object({
    name    = string
    records = list(string)
  }))

Default: {}

srv_records

Description: map of objects for SRV records

Type:

map(object({
    name    = string
    records = list(string)
  }))

Default: {}

ttl

Description: ttl

Type: string

Default: "300"

txt_records

Description: map of objects for TXT records

Type:

map(object({
    name    = string
    records = list(string)
  }))

Default: {}

Outputs

The following outputs are exported:

a_alias_records

Description: n/a

a_records

Description: n/a

aaaa_alias_records

Description: n/a

aaaa_records

Description: n/a

cname_records

Description: n/a

mx_records

Description: n/a

srv_records

Description: n/a

txt_records

Description: n/a

Usage

get the zone

data "aws_route53_zone" "zone" {
  name = "${var.domain}."
}
module "route_53" {
    zone_id = data.aws_route53_zone.zone.id
    ttl  = 300

    a_records = {
        1 = {
            name    = ""
            records = ["1.2.3.4"]
        }
    }

    aaaa_records = {
        1 = {
            name    = ""
            records = ["1.2.3.4"]
        }
    }

    a_alias_records = {
        1 = {
            name    = "www"
            record  = "webservice-main-alb-123465789012.eu-central-1.elb.amazonaws.com"
            zone_id = "ABCDEFGHIJKLMN" // zone_id of the loadbalancer
        }
    }

    aaaa_alias_records = {
        1 = {
            name    = "www"
            record  = "webservice-main-alb-123465789012.eu-central-1.elb.amazonaws.com"
            zone_id = "ABCDEFGHIJKLMN" // zone_id of the loadbalancer
        }
    }

    cname_records = {
        1 = {
            name    = "name"
            records = ["foo.bar"]
        }
    }

    txt_records = {
        root = {
          name = ""
          records = ["v=spf1", "site-verification=dummy"]
        }
        1 = {
          name    = "name"
          records = ["domainkey=foo", "challenge=other"]
        }
    }

    mx_records = [
        "1 aspmx.l.google.com",
        "5 alt2.aspmx.l.google.com",
        "5 alt1.aspmx.l.google.com",
        "10 aspmx2.googlemail.com",
        "10 aspmx3.googlemail.com",
    ]

    ns_records = {
      1 = {
        name = "kite"
        records = [
          "ns-420.awsdns.com",
          "ns-69.awsdns.org",
          "ns-42069.awsdns.net",
        ]
      }
    }

    source = "github.com/ryte/INF-tf-route-53.git?ref=v0.3.1"
}

Authors

Changelog

  • 0.3.1 - Add support for AAAA and AAAA Alias records
  • 0.3.0 - Add support for creating NS records subdomain
  • 0.2.1 - Utilize terraform 0.12.x features
  • 0.2.0 - Upgrade to terraform 0.12.x
  • 0.1.2 - Update output variable of all records
  • 0.1.1 - Separate variable for TXT records for root domain
  • 0.1.0 - Initial release.

License

This software is released under the MIT License (see LICENSE).

inf-tf-route-53's People

Contributors

al-dexter avatar dannylinden avatar h0raz avatar phuong-leeo avatar x4121 avatar

Watchers

 avatar  avatar  avatar

inf-tf-route-53's Issues

The output variables after terraform apply

Hi there,
Could you please tell me why the module dont have the output value like this:

output "a_records" {
value = "${aws_route53_record.a_records..fqdn}"
}
output "cname_records" {
value = "${aws_route53_record.cname_records.
.fqdn}"
}

Since I need to run terraform output to get the data.

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.