Skip to content

Commit

Permalink
Update terraform providers (#271)
Browse files Browse the repository at this point in the history
* Update Terraform provider

---------

Co-authored-by: daniele <[email protected]>
  • Loading branch information
flavio-bernasconi and daniele authored Apr 4, 2024
1 parent e88e149 commit ae140de
Show file tree
Hide file tree
Showing 19 changed files with 88 additions and 71 deletions.
2 changes: 1 addition & 1 deletion terraform/gitlab/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ terraform {
required_providers {
gitlab = {
source = "gitlabhq/gitlab"
version = "~> 3.18"
version = "~> 16.10.0"
}
}
}
Expand Down
16 changes: 10 additions & 6 deletions terraform/terraform-cloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ terraform {
required_providers {
tfe = {
source = "hashicorp/tfe"
version = "~> 0.37"
version = "~> 0.53"
}
}
}
Expand All @@ -70,12 +70,16 @@ resource "tfe_organization" "main" {

/* Workspaces */

resource "tfe_workspace" "test" {
resource "tfe_workspace" "main" {
for_each = { for i in local.workspaces : i.name => i }

name = each.value.name
description = each.value.description
organization = local.organization.name
name = each.value.name
description = each.value.description
organization = local.organization.name
tag_names = each.value.tags
}

resource "tfe_workspace_settings" "main-settings" {
workspace_id = tfe_workspace.main.id
execution_mode = "local"
tag_names = each.value.tags
}
4 changes: 2 additions & 2 deletions terraform/vault/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ terraform {
required_providers {
vault = {
source = "hashicorp/vault"
version = "~>3.11.0"
version = "~> 4.2.0"
}
}
}
Expand All @@ -16,7 +16,7 @@ provider "vault" {
token = var.vault_token

dynamic "auth_login_oidc" {
for_each = var.vault_token == "" ? ["default"] : []
for_each = toset(var.vault_token == "" ? ["default"] : [])

content {
role = auth_login_oidc.value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.22"
version = "~> 2.36"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ variable "k8s_cluster_node_min_vcpus" {
variable "k8s_cluster_node_max_memory" {
description = "The DigitalOcean Kubernetes nodes candidate maximum memory (in GB)."
type = number
default = 16
default = 256
}

variable "k8s_cluster_node_max_vcpus" {
description = "The DigitalOcean Kubernetes nodes candidate maximum number of vCPUs."
type = number
default = 4
default = 48
}

variable "k8s_cluster_node_size" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.22"
version = "~> 2.36"
}
helm = {
source = "hashicorp/helm"
version = "~> 2.6"
version = "~> 2.12"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.13"
version = "~> 2.27"
}
}
}
Expand Down Expand Up @@ -64,8 +64,9 @@ module "traefik" {

resource "helm_release" "reloader" {
name = "reloader"
chart = "reloader"
repository = "https://stakater.github.io/stakater-charts"
chart = "reloader"
version = "1.0.74"
}

/* Metrics */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
helm = {
source = "hashicorp/helm"
version = "~> 2.6"
version = "~> 2.12"
}
}
}
Expand All @@ -11,11 +11,13 @@ terraform {

resource "helm_release" "metrics_server" {
name = "metrics-server"
namespace = "metrics-server"
repository = "https://kubernetes-sigs.github.io/metrics-server"
chart = "metrics-server"
version = "3.12.0"

namespace = "metrics-server"

create_namespace = true
version = "3.8.2"

values = [file("${path.module}/metrics-server/values.yaml")]
}
Expand All @@ -24,7 +26,9 @@ resource "helm_release" "metrics_server" {

resource "helm_release" "kube_state_metrics" {
name = "kube-state-metrics"
namespace = "kube-system"
repository = "https://charts.bitnami.com/bitnami"
chart = "kube-state-metrics"
version = "3.16.2"

namespace = "kube-system"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@ terraform {
required_providers {
helm = {
source = "hashicorp/helm"
version = "~> 2.6"
version = "~> 2.12"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.13"
version = "~> 2.27"
}
}
}

resource "helm_release" "traefik" {
name = "traefik"
repository = "https://traefik.github.io/charts"
chart = "traefik"
version = var.traefik_helm_chart_version

namespace = "traefik"
create_namespace = true
repository = "https://traefik.github.io/charts"

timeout = 900
version = var.traefik_helm_chart_version

values = [
file("${path.module}/values.yaml"),
Expand All @@ -40,11 +42,12 @@ resource "helm_release" "cert_manager" {
count = var.letsencrypt_certificate_email != "" ? 1 : 0

name = "cert-manager"
repository = "https://charts.jetstack.io"
chart = "cert-manager"
version = "1.14.4"

namespace = "cert-manager"
create_namespace = true
repository = "https://charts.jetstack.io"
version = "1.14.4"

set {
name = "installCRDs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ terraform {
required_providers {
helm = {
source = "hashicorp/helm"
version = "~> 2.6"
version = "~> 2.12"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.13"
version = "~> 2.27"
}
}
}
Expand Down Expand Up @@ -39,8 +39,9 @@ module "traefik" {

resource "helm_release" "reloader" {
name = "reloader"
chart = "reloader"
repository = "https://stakater.github.io/stakater-charts"
chart = "reloader"
version = "1.0.74"
}

/* Metrics */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.22"
version = "~> 2.36"
}
helm = {
source = "hashicorp/helm"
version = "~> 2.6"
version = "~> 2.12"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.13"
version = "~> 2.27"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ variable "grafana_user" {
variable "grafana_version" {
description = "The Grafana version."
type = string
default = "9.4.1"
default = "10.2.0"
}

variable "letsencrypt_certificate_email" {
Expand Down Expand Up @@ -231,14 +231,14 @@ variable "subdomains" {
}

variable "tls_certificate_crt" {
description = "The TLS certificate .crt file content."
description = "The base64-encoded PEM-formatted TLS full certificate."
type = string
sensitive = true
default = ""
}

variable "tls_certificate_key" {
description = "The TLS certificate .key file content."
description = "The base64-encoded PEM-formatted TLS private key."
type = string
sensitive = true
default = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.13"
version = "~> 2.27"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ terraform {
required_providers {
helm = {
source = "hashicorp/helm"
version = "~> 2.6"
version = "~> 2.12"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.13"
version = "~> 2.27"
}
}
}
Expand All @@ -36,10 +36,11 @@ resource "kubernetes_namespace_v1" "log_storage" {

resource "helm_release" "loki" {
name = "loki"
namespace = local.namespace
repository = "https://grafana.github.io/helm-charts"
chart = "loki-stack"
version = "2.9.10"
version = "2.10.2"

namespace = local.namespace

values = [
file("${path.module}/loki/values.yaml"),
Expand Down Expand Up @@ -79,9 +80,11 @@ resource "kubernetes_config_map_v1" "k8s_logs_dashboard" {

resource "helm_release" "grafana" {
name = "grafana"
namespace = local.namespace
repository = "https://grafana.github.io/helm-charts"
chart = "grafana"
version = "7.3.7"

namespace = local.namespace

values = [file("${path.module}/grafana/values.yaml")]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ terraform {
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.13"
version = "~> 2.27"
}
random = {
source = "hashicorp/random"
version = "~> 3.4"
version = "~> 3.6"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ terraform {
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.13"
version = "~> 2.27"
}
random = {
source = "hashicorp/random"
version = "~> 3.4"
version = "~> 3.6"
}
}
}
Expand Down
Loading

0 comments on commit ae140de

Please sign in to comment.