Provides a Cloudflare record resource.

Example Usage

# Add a record to the domain
resource "cloudflare_record" "foobar" {
  domain = "${var.cloudflare_domain}"
  name   = "terraform"
  value  = ""
  type   = "A"
  ttl    = 3600

Argument Reference

The following arguments are supported:

  • domain - (Required) The domain to add the record to
  • name - (Required) The name of the record
  • type - (Required) The type of the record
  • value - (Optional) The (string) value of the record. Either this or data must be specified
  • data - (Optional) Map of attributes that constitute the record value. Primarily used for LOC and SRV record types. Either this or value must be specified
  • ttl - (Optional) The TTL of the record (automatic: '1')
  • priority - (Optional) The priority of the record
  • proxied - (Optional) Whether the record gets Cloudflare's origin protection; defaults to false.

Attributes Reference

The following attributes are exported:

  • id - The record ID
  • hostname - The FQDN of the record
  • proxiable - Shows whether this record can be proxied, must be true if setting proxied=true
  • created_on - The RFC3339 timestamp of when the record was created
  • modified_on - The RFC3339 timestamp of when the record was last modified
  • metadata - A key-value map of string metadata cloudflare associates with the record
  • zone_id - The zone id of the record


Records can be imported using a composite ID formed of zone name and record ID, e.g.

$ terraform import cloudflare_record.default example.com/ch8374ftwdghsif43

© 2018 HashiCorpLicensed under the MPL 2.0 License.