Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 🤖 remove deprecated template provider #105

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ See [example](example/) dir
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >=2.6.0 |
| <a name="requirement_kubectl"></a> [kubectl](#requirement\_kubectl) | 2.0.4 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >=2.12.1 |
| <a name="requirement_template"></a> [template](#requirement\_template) | >=2.2.0 |

## Providers

Expand All @@ -32,7 +31,6 @@ See [example](example/) dir
| <a name="provider_helm"></a> [helm](#provider\_helm) | >=2.6.0 |
| <a name="provider_kubectl"></a> [kubectl](#provider\_kubectl) | 2.0.4 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >=2.12.1 |
| <a name="provider_template"></a> [template](#provider\_template) | >=2.2.0 |

## Modules

Expand All @@ -50,7 +48,6 @@ No modules.
| [kubernetes_config_map.logrotate_config](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/config_map) | resource |
| [kubernetes_config_map.modsecurity_nginx_config](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/config_map) | resource |
| [kubernetes_namespace.ingress_controllers](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource |
| [template_file.nginx_ingress_default_certificate](https://registry.terraform.io/providers/hashicorp/template/latest/docs/data-sources/file) | data source |

## Inputs

Expand Down
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