/terraform-aws-dns

Terraform module which creates DNS records on AWS Route53

Primary LanguageHCLApache License 2.0Apache-2.0

Terraform-aws-dns-terraform-module repository

This repo contains a Terraform module that manages an AWS Route53 Zone and its simple routing policy records.

Features

  • Manage AWS Route53 hosted zone
  • Add/remove AWS Route53 records on the specified hosted zone

Usage

module dns {
  source  = "MauroSoli/terraform-aws-dns"
  version = "3.19"

  records = [
   #[ "name",     "type",  TTL, [ "value" ]]
    [ "", "A",     600, [ "123.123.123.123" ]],
    [ "record01", "CNAME", 600, [ "example.aws.example.com." ]],
    [ "record02", "A",     600, [ "143.204.9.89" ]]
  ]
}
output "aws_ns_records" {
  value       = module.dns.aws_zone_ns
  description = "NS records for hosted zone"
}

The records output from aws_ns_records must be added to the parent DNS Zone


Requirements

Name Version
terraform >= 1.2.9
aws ~> 4.41

Providers

Name Version
aws ~> 4.41

Modules

No modules.

Resources

Name Type
aws_route53_record.aws_zone resource
aws_route53_record.records resource
aws_route53_zone.aws_zone resource
aws_route53domains_registered_domain.aws_zone resource
aws_caller_identity.current data source

Inputs

Name Description Type Default Required
dns_zone AWS hosted zone name string n/a yes
is_it_a_registered_domain Is the specified domain an AWS registered domain? bool false no
records DNS records list(any) [] no

Outputs

Name Description
aws_zone_id hosted zone ID
aws_zone_ns NS records for hosted zone