more terraform boilerplates

This commit is contained in:
Christian 2022-03-04 17:45:04 +01:00
parent cda48ece9d
commit e4fa5990f4
8 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# Cloudflare Credentials
# ---
# Credential Variables needed for Cloudflare
# Cloudflare Config
variable "cloudflare_email" {
description = "The email address for your Cloudflare account"
type = string
}
variable "cloudflare_api_key" {
description = "The API key for your Cloudflare account"
type = string
}

View File

@ -0,0 +1,12 @@
# Cloudflare DNS
# ---
# Templates to manage DNS Records on Cloudflare
# A Record
resource "cloudflare_record" "your-dns-record-name" {
zone_id = "your-zone-id"
name = "your-public-dns-value"
value = "your-public-ip-address"
type = "A"
proxied = false # set to true, to hide public IP
}

View File

@ -0,0 +1,19 @@
# Cloudflare Provider
# ---
# Initial Provider Configuration for Cloudflare
terraform {
required_version = ">= 0.13.0"
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 3.0"
}
}
}
provider "cloudflare" {
email = var.cloudflare_email
api_key = var.cloudflare_api_key
}

View File

@ -0,0 +1,23 @@
# Kubectl Provider
# ---
# Initial Provider Configuration for Kubectl
terraform {
required_version = ">= 0.13.0"
required_providers {
kubectl = {
source = "gavinbunney/kubectl"
version = "1.13.1"
}
}
}
# Dynamic Configuration from CIVO Kubernetes deployment
# provider "kubectl" {
# host = "${yamldecode(civo_kubernetes_cluster.your-kubernetes-cluster.kubeconfig).clusters.0.cluster.server}"
# client_certificate = "${base64decode(yamldecode(civo_kubernetes_cluster.your-kubernetes-cluster.kubeconfig).users.0.user.client-certificate-data)}"
# client_key = "${base64decode(yamldecode(civo_kubernetes_cluster.your-kubernetes-cluster.kubeconfig).users.0.user.client-key-data)}"
# cluster_ca_certificate = "${base64decode(yamldecode(civo_kubernetes_cluster.your-kubernetes-cluster.kubeconfig).clusters.0.cluster.certificate-authority-data)}"
# load_config_file = false
# }