Skip to content

octopus20/terraform-cloudflare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository created to manage CloudFlare DNS resources via Terraform.

Modules:

The repo consistes of one module to create DNS Zone and add DNS records to Cloudflare.

Adding new DNS Zone:

As we are using a free Cloudflare plan .. we only need the zone name to add a new zone. To add new zone copy below lines to dns_records.tf file.

locals {

  zones = {
    "example_sa" = {
      name    = "example.sa"
      plan    = "free"
      records = []
    }
  }
}

Adding new DNS Records:

To add new DNS record , copy below lines to dns_records.tf file under records = [] for the desired zone.

  • name: The name of the record.
  • value: The (string) value of the record.
  • type: The type of the record.
  • ttl: The TTL of the record (automatic: '1')
  • proxied: To show a Cloudflare IP if you look up the record.
locals {

  zones = {
    "example_sa" = {
      name    = "example.sa"
      plan    = "free"
      records = [
         {
           name    = "*"
           value   = "92.68.68.0"
           type    = "A"
           ttl     = 1
           proxied = false
         },

         {
           name    = "test"
           value   = "92.68.68.1"
           type    = "A"
           ttl     = 1
           proxied = false
         }
      ] 
    }
  }
}

About

Manage Cloudflare DNS records via terraform.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages