AWS Route53 (DNS) Terraform Module
Terraform module to provision Route53 DNS records
on AWS.
Usage
Simple setup
Create a simple Route53 DNS CNAME Record.
module "record" {
source = "app.terraform.io/ncodelibrary/route53-record/aws"
version = "0.1.2"
domain_name = "ncodelibrary.com"
records = ["something.example.com"]
name = "example"
type = "CNAME"
ttl = 300
}
For more details on a working example, please visit examples/simple
Advanced Setup
If you want to create Route53 DNS Record with enhanced configuration e.g alias to other AWS Service etc., you can use the module like this:
module "record" {
source = "app.terraform.io/ncodelibrary/route53-record/aws"
version = "0.1.2"
domain_name = "ncodelibrary.com"
alias = [{
evaluate_target_health = true,
zone_id = "Z1H1xxxxxxxx",
name = "dualstack.some-alb.some-region.elb.amazonaws.com."
}]
name = "example"
type = "CNAME"
}
For more options refer to a working example at examples/advanced
Examples
Here are some working examples of using this module:
Requirements
Name | Version |
---|---|
terraform | >= 0.12 |
Providers
Name | Version |
---|---|
aws | n/a |
Inputs
Name | Description | Type | Default | Required |
---|---|---|---|---|
alias | n/a | list(object({ |
[] |
no |
domain_name | The name of the hosted zone to use | string |
n/a | yes |
name | The name of the record | string |
n/a | yes |
private_zone | Whether this is a private hosted zone or not (defaults to false) | bool |
false |
no |
records | (Required for non-alias records) A string list of records | list(string) |
null |
no |
ttl | (Required for non-alias records) The TTL of the record | number |
null |
no |
type | The record type. Valid values are A, AAAA, CAA, CNAME, MX, NAPTR, NS, PTR, SOA, SPF, SRV and TXT | string |
"A" |
no |
Outputs
Name | Description |
---|---|
output | n/a |
Contributing
If you want to contribute to this repository check all the guidelines specified here before submitting a new PR.