Skip to content

brainsik/terraform-cloudflare-dns-https

Repository files navigation

terraform-cloudflare-dns-https

Create ServiceMode DNS HTTPS records in Cloudflare.

The Zone ID can be found on the Cloudflare overview page for the domain you want to add records to.

Usage

To create an HTTPS record saying example.com is available via http/2 over TLS:

module "example_com_https" {
  source = "brainsik/dns-https/cloudflare"

  zone_id = "313372600deadcodebea5751993defc0"
  name    = "example.com"

  alpn = "h2"
}

To create an HTTPS record saying example.com is available via http/3 or http/2 over TLS with IPs to use for initially establishing a connection:

module "example_com_https" {
  source = "brainsik/dns-https/cloudflare"

  zone_id = "313372600deadcodebea5751993defc0"
  name    = "example.com"

  alpn     = "h3,h2"
  ipv4hint = "192.0.2.1"
  ipv6hint = "2001:db8::1,2001:db8::2"
}

Requirements

Name Version
terraform >= 1.6
cloudflare ~> 4

Providers

Name Version
cloudflare ~> 4

Modules

No modules.

Resources

Name Type
cloudflare_record.https resource

Inputs

Name Description Type Default Required
alpn A comma separated list of short form ALPN identifiers (e.g., "h2" or "h3,h2") string n/a yes
ipv4hint A comma separated list of IPs string "" no
ipv6hint A comma separated list of IPs string "" no
name The name of the record string n/a yes
priority Resource record priority number 1 no
zone_id The Cloudflare DNS zone ID to add the record to string n/a yes

Outputs

No outputs.