Difference between revisions of "Terraform Cloudflare provider"

From wikieduonline
Jump to navigation Jump to search
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs
 
https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs
  
== Examples ==
+
Resources:
Official:
+
* <code>[[cloudflare_record]]: [[proxied]]</code>
<pre>
+
* <code>[[cloudflare_page_rule]]</code>
# Configure the Cloudflare provider using the required_providers stanza
+
* <code>[[cloudflare_account]]</code>
# required with Terraform 0.13 and beyond. You may optionally use version
+
* <code>[[cloudflare_load_balancer]]</code>
# directive to prevent breaking changes occurring unannounced.
 
terraform {
 
  required_providers {
 
    cloudflare = {
 
      source  = "cloudflare/cloudflare"
 
      version = "~> 4.0"
 
    }
 
  }
 
}
 
  
provider "cloudflare" {
+
Data sources:
  api_token = var.cloudflare_api_token
+
* <code>[[cloudflare_ip_ranges]]</code>
}
+
* <code>[[cloudflare_zones]]</code>
 
 
# Create a record
 
resource "cloudflare_record" "www" {
 
  # ...
 
}
 
 
 
# Create a page rule
 
resource "cloudflare_page_rule" "www" {
 
  # ...
 
}
 
</pre>
 
  
 +
== Official Example ==
  
 +
# Configure the Cloudflare provider using the required_providers stanza
 +
# required with Terraform 0.13 and beyond. You may optionally use version
 +
# directive to prevent breaking changes occurring unannounced.
 +
terraform {
 +
  [[required_providers]] {
 +
    cloudflare = {
 +
      source  = "cloudflare/cloudflare"
 +
      version = "~> 4.0"
 +
    }
 +
  }
 +
}
 +
 +
provider "cloudflare" {
 +
  api_token = [[var.]][[cloudflare_api_token]]
 +
}
 +
 
 +
# Create a record
 +
resource "[[cloudflare_record]]" "www" {
 +
  # ...
 +
}
 +
 
 +
# Create a page rule
 +
resource "[[cloudflare_page_rule]]" "www" {
 +
  # ...
 +
}
  
 
== See also ==
 
== See also ==
* {{tf providers}}
+
* {{tf init}}
 +
* {{tf CF}}
 
* {{Cloudflare}}
 
* {{Cloudflare}}
  
 
[[Category:Cloudflare]]
 
[[Category:Cloudflare]]

Latest revision as of 19:18, 16 July 2024

Advertising: