Skip to content

Terraform module for creating domain zone and its records on the DigitalOcean cloud.

License

Notifications You must be signed in to change notification settings

opsd-io/terraform-module-digitalocean-dns

Repository files navigation

OPSd - the unique and effortless way of managing cloud infrastructure.

Meet OPSd. The unique and effortless way of managing cloud infrastructure.

terraform-module-template

Introduction

Terraform module for DigitalOcean domain zone and its records.

Usage

module "example_zone" {
  source = "github.com/opsd-io/terraform-module-digitalocean-dns?ref=VERSION"

  domain_name = "your-company-domain.com"
  a_records = {
    www = {
      value = "11.22.33.44"
      ttl   = 60
    }
  }
}

IMPORTANT: Make sure not to pin to master because there may be breaking changes between releases.

Requirements

Name Version
terraform >= 1.5.5
digitalocean >= 2.17.0

Providers

Name Version
digitalocean >= 2.17.0

Modules

No modules.

Resources

Name Type
digitalocean_domain.main resource
digitalocean_record.a resource
digitalocean_record.aaaa resource
digitalocean_record.caa resource
digitalocean_record.cname resource
digitalocean_record.mx resource
digitalocean_record.ns resource
digitalocean_record.srv resource
digitalocean_record.txt resource
digitalocean_records.domain_ns data source

Inputs

Name Description Type Default Required
a_records Domain A records (IPv4 address).
map(object({
name = optional(string, null)
ttl = optional(number, 300)
value = string
}))
{} no
aaaa_records Domain AAAA records (IPv6 address).
map(object({
name = optional(string, null)
ttl = optional(number, 300)
value = string
}))
{} no
caa_records Domain CAA records (Certification Authority Authorization).
map(object({
name = optional(string, null)
ttl = optional(number, 300)
flags = optional(number, 0)
tag = string # valid values are "issue", "issuewild", or "iodef".
value = string
}))
{} no
cname_records Domain CNAME records (Canonical name record).
map(object({
name = optional(string, null)
ttl = optional(number, 600)
value = string
}))
{} no
domain_name The name of the domain. string n/a yes
mx_records Domain MX records (Mail exchange record).
map(object({
name = optional(string, null)
ttl = optional(number, 3600)
priority = number
value = string
}))
{} no
ns_records Domain NS records (Name server record).
map(object({
name = optional(string, null)
ttl = optional(number, 86400)
value = string
}))
{} no
srv_records Domain SRV records (Service locator).
map(object({
name = optional(string, null)
ttl = optional(number, 3600)
priority = optional(number, 1)
weight = optional(number, 10)
port = string
value = string
}))
{} no
txt_records Domain TXT records (Text record).
map(object({
name = optional(string, null)
ttl = optional(number, 300)
value = string
}))
{} no

Outputs

Name Description
a_records Domain A records (IPv4 address).
aaaa_records Domain AAAA records (IPv6 address).
caa_records Domain CAA records (Certification Authority Authorization).
cname_records Domain CNAME records (Canonical name record).
id The name of the domain.
mx_records Domain MX records (Mail exchange record).
name The name of the domain.
name_servers The name servers of the domain zone.
ns_records Domain NS records (Name server record).
srv_records Domain SRV records (Service locator).
ttl The TTL value of the domain.
txt_records Domain TXT records (Text record).
urn The uniform resource name (URN) of the domain.

Examples of usage

Do you want to see how the module works? See all the usage examples.

Related modules

The list of related modules (if present).

Contributing

If you are interested in contributing to the project, see see our guide.

Support

If you have a problem with the module or want to propose a new feature, you can report it via the project's (Github) issue tracker.

If you want to discuss something in person, you can join our community on Slack.

License

Apache License 2.0

About

Terraform module for creating domain zone and its records on the DigitalOcean cloud.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages