feat: add provider config

Added config for CloudFlare provider, as well as remote state on
CloudFlare R2 instead of AWS S3.

Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
Lander Van den Bulcke 2025-01-10 17:03:57 +01:00
parent 7a80aeb4d1
commit 6efd720ace
Signed by: lander
GPG key ID: 0142722B4B0C536F
4 changed files with 53 additions and 2 deletions

5
.gitignore vendored
View file

@ -11,8 +11,8 @@ crash.log
crash.*.log crash.*.log
# Exclude all .tfvars files, which are likely to contain sensitive data, such as # Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version # password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject # control as they are data points which are potentially sensitive and subject
# to change depending on the environment. # to change depending on the environment.
*.tfvars *.tfvars
*.tfvars.json *.tfvars.json
@ -37,3 +37,4 @@ override.tf.json
.terraformrc .terraformrc
terraform.rc terraform.rc
.env

24
.terraform.lock.hcl generated Normal file
View file

@ -0,0 +1,24 @@
# This file is maintained automatically by "tofu init".
# Manual edits may be lost in future updates.
provider "registry.opentofu.org/cloudflare/cloudflare" {
version = "5.0.0-rc1"
constraints = "5.0.0-rc1"
hashes = [
"h1:8m1nyP5iuxZIuv0Qhjnp723GGQVuZ504g7u97u8+j1k=",
"zh:5d44869dba45fd9cdbfa1d688459f7ba073c1565634f9d3f2036bbb4150b4f94",
"zh:6af0df8c55994cdb3463ab93fc0fb6969051bb171146a7ed6c5e57993944941a",
"zh:76e9a830b6d45803e78fc336b41bf63ba9cc79a56ece8954c048c9369f988be9",
"zh:78312c67dfb0971b8ad82ba47ab677f6b231eeab984fc3a51312f72df72794f8",
"zh:8241fc0f8c17b1e113c9698293937da61cfe37cdb1788c423eff11521afb349d",
"zh:8673ecf599a98b30f78b0d205c9306b60d5911c3097209a9a6557a3bdda28a24",
"zh:c3fa906c767bd38ec7cf94d497f493662f1a2554f75081d31808bf1b85c1d327",
"zh:ca832d49043e05e176ebaff309c068912a7522733dc7b4590843756024235c2b",
"zh:d66a4ec8354f903144ad0c88c48beabfa4397317bd3f73adb3f98d6354f585df",
"zh:e3d2437092016f536a17d74ce3163b5db22b9156657c7b3682cebbfcb4cdc0df",
"zh:e7750a7617c3e0acbf762e5704ab9dbdb6d8d2aee51ba779acb335b758e1a39d",
"zh:f0f8abfbbf20b2a40896efe45d1fe6ab5fa355d20dedfcaed6df1ebae9279334",
"zh:f3812cb3673df1aa598170a5558344793ae4f17ee5637e6019fd443d11d5dc1a",
"zh:f809ab383cca0a5f83072981c64208cbd7fa67e986a86ee02dd2c82333221e32",
]
}

24
providers.tf Normal file
View file

@ -0,0 +1,24 @@
terraform {
backend "s3" {
bucket = "tf-state"
key = "tf-cloudflare/terraform.tfstate"
region = "auto"
skip_credentials_validation = true
skip_metadata_api_check = true
skip_region_validation = true
skip_requesting_account_id = true
skip_s3_checksum = true
use_path_style = true
endpoints = {
s3 = "https://daf6ae2391d4d68ecf3c5af2f1540f5c.r2.cloudflarestorage.com"
}
}
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "5.0.0-rc1"
}
}
}
provider "cloudflare" {}

2
variables.tf Normal file
View file

@ -0,0 +1,2 @@