- main.tf: remove kubeconfig_path local (no longer used with direct auth) - providers.tf: wrap file() with try() to handle plan-time on non-pod systems try() allows terraform plan to work locally; at runtime in pod, files exist and are used.
51 lines
1.3 KiB
Terraform
51 lines
1.3 KiB
Terraform
terraform {
|
|
required_version = ">= 1.5"
|
|
required_providers {
|
|
kubernetes = {
|
|
source = "hashicorp/kubernetes"
|
|
version = "~> 2.27"
|
|
}
|
|
helm = {
|
|
source = "hashicorp/helm"
|
|
version = "~> 2.14"
|
|
}
|
|
vault = {
|
|
source = "hashicorp/vault"
|
|
version = "~> 4.0"
|
|
}
|
|
null = {
|
|
source = "hashicorp/null"
|
|
version = "~> 3.2"
|
|
}
|
|
authentik = {
|
|
source = "goauthentik/authentik"
|
|
version = "2024.12.1"
|
|
}
|
|
aws = {
|
|
source = "hashicorp/aws"
|
|
version = "~> 5.0"
|
|
}
|
|
}
|
|
}
|
|
|
|
provider "kubernetes" {
|
|
host = "https://kubernetes.default"
|
|
token = try(file("/var/run/secrets/kubernetes.io/serviceaccount/token"), "")
|
|
cluster_ca_certificate = try(file("/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"), "")
|
|
insecure = false
|
|
}
|
|
|
|
provider "helm" {
|
|
kubernetes {
|
|
host = "https://kubernetes.default"
|
|
token = try(file("/var/run/secrets/kubernetes.io/serviceaccount/token"), "")
|
|
cluster_ca_certificate = try(file("/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"), "")
|
|
insecure = false
|
|
}
|
|
}
|
|
|
|
provider "vault" {
|
|
address = "https://vault.riotpiao.homelab.com"
|
|
skip_tls_verify = true
|
|
}
|