Skip to content

Latest commit

 

History

History
118 lines (92 loc) · 1.77 KB

dns_mx_record_set.md

File metadata and controls

118 lines (92 loc) · 1.77 KB

dns_mx_record_set

back

Index

Terraform

terraform {
  required_providers {
    dns = ">= 3.1.0"
  }
}

top

Example Usage

module "dns_mx_record_set" {
  source = "./modules/dns/r/dns_mx_record_set"

  # name - (optional) is a type of string
  name = null
  # ttl - (optional) is a type of number
  ttl = null
  # zone - (required) is a type of string
  zone = null

  mx = [{
    exchange   = null
    preference = null
  }]
}

top

Variables

variable "name" {
  description = "(optional)"
  type        = string
  default     = null
}

variable "ttl" {
  description = "(optional)"
  type        = number
  default     = null
}

variable "zone" {
  description = "(required)"
  type        = string
}

variable "mx" {
  description = "nested block: NestingSet, min items: 1, max items: 0"
  type = set(object(
    {
      exchange   = string
      preference = number
    }
  ))
}

top

Resource

resource "dns_mx_record_set" "this" {
  # name - (optional) is a type of string
  name = var.name
  # ttl - (optional) is a type of number
  ttl = var.ttl
  # zone - (required) is a type of string
  zone = var.zone

  dynamic "mx" {
    for_each = var.mx
    content {
      # exchange - (required) is a type of string
      exchange = mx.value["exchange"]
      # preference - (required) is a type of number
      preference = mx.value["preference"]
    }
  }

}

top

Outputs

output "id" {
  description = "returns a string"
  value       = dns_mx_record_set.this.id
}

output "this" {
  value = dns_mx_record_set.this
}

top