2025-09-06 19:03:55 +01:00
|
|
|
terraform {
|
|
|
|
|
required_providers {
|
|
|
|
|
google = {
|
|
|
|
|
source = "hashicorp/google"
|
|
|
|
|
version = "~> 4.0"
|
|
|
|
|
}
|
2025-10-04 12:24:03 +01:00
|
|
|
# cloudflare = {
|
|
|
|
|
# source = "cloudflare/cloudflare"
|
|
|
|
|
# version = "~> 5"
|
|
|
|
|
# }
|
2025-09-06 19:03:55 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Provider
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
|
|
|
|
|
// Connect to the GCP project
|
|
|
|
|
provider "google" {
|
|
|
|
|
# Configuration options
|
|
|
|
|
project = var.project_name # Use variable from tfvars
|
|
|
|
|
region = "us-central1" # Replace with your desired region
|
|
|
|
|
}
|
2025-10-04 12:24:03 +01:00
|
|
|
|
2025-09-06 19:03:55 +01:00
|
|
|
# provider "google" {
|
|
|
|
|
# credentials = file("<my-gcp-creds>.json")
|
|
|
|
|
# project = var.project_name
|
|
|
|
|
# region = var.region
|
|
|
|
|
# zone = var.zone
|
|
|
|
|
# }
|
2025-10-04 12:24:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# provider "cloudflare" {
|
|
|
|
|
# api_token = var.cloudflare_api_token
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
# variable "cloudflare_api_token" {
|
|
|
|
|
# description = "Cloudflare API token"
|
|
|
|
|
# sensitive = true
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
# variable "cloudflare_account_id" {
|
|
|
|
|
# description = "Cloudflare Account ID"
|
|
|
|
|
# sensitive = true
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
# variable "cloudflare_zone_id" {
|
|
|
|
|
# description = "Cloudflare Zone ID"
|
|
|
|
|
# sensitive = true
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
# variable "cloudflare_domain" {
|
|
|
|
|
# description = "Cloudflare Domain"
|
|
|
|
|
# sensitive = true
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
# resource "cloudflare_dns_record" "frgdr" {
|
|
|
|
|
# zone_id = var.cloudflare_zone_id
|
|
|
|
|
# name = "frgdr"
|
|
|
|
|
# content = google_compute_instance.k3s.network_interface[0].access_config[0].nat_ip
|
|
|
|
|
# type = "A"
|
|
|
|
|
# ttl = 300
|
|
|
|
|
# proxied = false
|
|
|
|
|
# comment = "Application domain record"
|
|
|
|
|
# }
|