Skip to content

Commit

Permalink
chore: 🤖 remove deprecated template provider
Browse files Browse the repository at this point in the history
use templatefile function instead
  • Loading branch information
sj-williams committed Nov 5, 2024
1 parent 0067542 commit 0e4fa99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
18 changes: 4 additions & 14 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,16 @@ resource "helm_release" "nginx_ingress" {
}
}


# Default Lets-Encrypt cert
data "template_file" "nginx_ingress_default_certificate" {
template = file(
"${path.module}/templates/default-certificate.yaml.tpl",
)

vars = {
resource "kubectl_manifest" "nginx_ingress_default_certificate" {
count = var.controller_name == "default" ? 1 : 0
yaml_body = templatefile("${path.module}/templates/default-certificate.yaml.tpl", {
apps_cluster_name = "*.apps.${var.cluster_domain_name}"
cluster_name = "*.${var.cluster_domain_name}"
namespace = "ingress-controllers"
alt_name = var.is_live_cluster ? format("- '*.%s'", var.live_domain) : ""
apps_alt_name = var.is_live_cluster ? format("- '*.apps.%s'", var.live_domain) : ""
live1_dns = var.live1_cert_dns_name
}
}

resource "kubectl_manifest" "nginx_ingress_default_certificate" {
count = var.controller_name == "default" ? 1 : 0
yaml_body = data.template_file.nginx_ingress_default_certificate.rendered
})

depends_on = [
kubernetes_namespace.ingress_controllers
Expand Down
4 changes: 0 additions & 4 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ terraform {
source = "hashicorp/kubernetes"
version = ">=2.12.1"
}
template = {
source = "hashicorp/template"
version = ">=2.2.0"
}
kubectl = {
source = "alekc/kubectl"
version = "2.0.4"
Expand Down

0 comments on commit 0e4fa99

Please sign in to comment.