Terraform module to create/update Cloudflare DNS Records.
provider "cloudflare" {
api_token = var.cloudflare_api_token
}
data "cloudflare_zone" "this" {
name = "example.com"
}
module "records" {
source = "../../"
records = [
{
name = "mail"
proxied = false
ttl = 60
type = "A"
value = "10.10.10.10"
zone_id = data.cloudflare_zone.this.id
},
{
name = "_25._tcp.mail"
proxied = false
ttl = 60
type = "TLSA"
zone_id = data.cloudflare_zone.this.id
data = {
certificate = "T8kKkgeLqC5pi5tVfUN0Nf3vJMzb6NDAB4IBwrOHKunmCSNLHqYgrGnCUAN9SulQ"
matching_type = 1
selector = 1
usage = 3
}
},
]
}
Name | Version |
---|---|
terraform | >= 0.13.1 |
cloudflare | >= 3.16.0 |
Name | Version |
---|---|
cloudflare | >= 3.16.0 |
No modules.
Name | Type |
---|---|
cloudflare_record.this | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
records | List of Maps of the records.name The name of the record. Modifying this attribute will force creation of a new resource. type The type of the record. Available values: [A, AAAA, CAA, CNAME, TXT, SRV, LOC, MX, NS, SPF, CERT, DNSKEY, DS, NAPTR, SMIMEA, SSHFP, TLSA, URI, PTR, HTTPS, SVCB]. Modifying this attribute will force creation of a new resource. zone_id The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource. allow_overwrite Allow creation of this record in Terraform to overwrite an existing record, if any. This does not affect the ability to update the record in Terraform and does not prevent other resources within Terraform or manual changes outside Terraform from overwriting this record. This configuration is not recommended for most environments. Defaults to false. comment Comments or notes about the DNS record. This field has no effect on DNS responses. priority The priority of the record. proxied Whether the record gets Cloudflare's origin protection. tags Custom tags for the DNS record. ttl The TTL of the record. value The value of the record. Conflicts with data. timeouts (Block, Optional) The Timeout settings. data (Block List, Max: 1) Map of attributes that constitute the record value. Conflicts with value. |
list(object({ |
[ |
no |
Name | Description |
---|---|
records | Records output: * created_on (String) The RFC3339 timestamp of when the record was created.* hostname (String) The FQDN of the record.* id (String) The ID of this resource.* metadata (Map of String) A key-value map of string metadata Cloudflare associates with the record.** auto_added (Boolean)** managed_by_apps (Boolean)** managed_by_argo_tunnel (Boolean)** source (String)* modified_on (String) The RFC3339 timestamp of when the record was last modified.* proxiable (Boolean) Shows whether this record can be proxied. |