Skip to content

ralphotowo/terraform-cloudflare-dns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudflare DNS Records

This Terraform module provisions and manages DNS records in Cloudflare zones.

Prerequisites

Before using this Terraform module, ensure you have the following:

  • Cloudflare Account & Zone IDs, see documentation.
  • A Domain name managed with Cloudflare.
  • A Cloudflare API token with zone permissions to manage records, set as value of environment variable CLOUDFLARE_API_TOKEN.

Compatibility

This module is meant for use with Terraform 1.6+.

module "cloudflare_dns" {
  source = "[email protected]:enomy/terraform/terraform-cloudflare-dns.git"
  zone_id = var.cloudflare_zone_id
  dns_records = [
    {
      name = "shops"
      type = "CNAME"
      content = "api.enomy.cloud"
      ttl = 30
    }
  ]
}

How it works

Perform the following commands on the project folder:

  • terraform init to get the plugins
  • terraform plan to see the infrastructure plan
  • terraform apply to apply the infrastructure build
  • terraform destroy to destroy the built infrastructure

File structure

The project has the following folders and files:

  • main.tf > Contains all resources and business logic to create them.
  • variables.tf > Variables needed to provision de module.
  • version.tf > Minimum required terraform version.

References

About

Manage Cloudflare DNS resources using Terraform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages