-
Notifications
You must be signed in to change notification settings - Fork 23
/
cloudflare.tf
72 lines (62 loc) · 1.58 KB
/
cloudflare.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# vim:ts=2:sts=2:sw=2:et
#
# Author: Hari Sekhon
# Date: 2021-03-04 18:17:02 +0000 (Thu, 04 Mar 2021)
#
# https://github.com/HariSekhon/Terraform
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# ============================================================================ #
# C l o u d f l a r e
# ============================================================================ #
# ============
# XXX: uncomment if not in provider.tf
# provider.tf:
# needs to be in main deployment dir and also in cloudflare/firewall module
#terraform {
# required_providers {
# cloudflare = {
# source = "cloudflare/cloudflare"
# }
# }
# required_version = ">= 0.13"
#}
# in terraform.tfvars
#provider "cloudflare" {
# email = var.cloudflare_email
# api_key = var.cloudflare_api_key
#}
#provider "http" {}
# ============
# =============
# variables.tf:
# XXX: set these in terraform.tfvars
variable "cloudflare_email" {
type = string
}
variable "cloudflare_api_key" {
type = string
}
# ==========
# locals.tf:
locals {
# obtained from the Cloudflare API:
#
# cloudflare_zones.sh
#
# XXX: Edit
cloudflare_zone_id = "..."
}
# =======
# main.tf:
module "firewall" {
source = "./cloudflare/firewall"
cloudflare_email = var.cloudflare_email
cloudflare_api_key = var.cloudflare_api_key
zone_id = local.cloudflare_zone_id
}