Skip to content

Commit

Permalink
Fix deprecated attributes in new provider versions
Browse files Browse the repository at this point in the history
 * aws_vpc replace vpc with domain attribute
 * azuread_service_principal rename application_id to client_id
 * gke node_config refactor taints to be in block format
  • Loading branch information
pst committed Jan 3, 2024
1 parent c0c8d85 commit e6d9279
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion aws/_modules/eks/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ resource "aws_eip" "nat_gw" {

tags = local.eks_metadata_tags

vpc = true
domain = "vpc"
}

resource "aws_nat_gateway" "current" {
Expand Down
2 changes: 1 addition & 1 deletion azurerm/_modules/aks/service_principal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "azuread_application" "current" {
resource "azuread_service_principal" "current" {
count = var.disable_managed_identities == true ? 1 : 0

application_id = azuread_application.current[0].application_id
client_id = azuread_application.current[0].client_id
}

resource "azuread_service_principal_password" "current" {
Expand Down
10 changes: 9 additions & 1 deletion google/_modules/gke/node_pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ resource "google_container_node_pool" "current" {
}
}

taint = var.taint
dynamic "taint" {
for_each = var.taints == null ? [] : var.taints

content {
key = taint.key
value = taint.value
effect = taint.effect
}
}
}

management {
Expand Down
10 changes: 7 additions & 3 deletions google/_modules/gke/node_pool/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,14 @@ variable "node_workload_metadata_config" {
type = string
}

variable "taint" {
variable "taints" {
type = set(object({
key = string
value = string
effect = string
}))
description = "Taints to configure for the node pool."
type = list(any)
default = []
default = null
}

variable "node_locations" {
Expand Down
2 changes: 1 addition & 1 deletion google/cluster/node-pool/configuration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ locals {
auto_repair = local.cfg["auto_repair"] != null ? local.cfg["auto_repair"] : true
auto_upgrade = local.cfg["auto_upgrade"] != null ? local.cfg["auto_upgrade"] : true

taint = local.cfg["taint"]
taints = local.cfg["taints"]

extra_oauth_scopes = local.cfg["extra_oauth_scopes"] != null ? local.cfg["extra_oauth_scopes"] : []

Expand Down
2 changes: 1 addition & 1 deletion google/cluster/node-pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module "node_pool" {

node_workload_metadata_config = local.node_workload_metadata_config

taint = local.taint
taints = local.taints

service_account_email = local.service_account_email
disable_per_node_pool_service_account = local.service_account_email == null ? false : true
Expand Down
2 changes: 1 addition & 1 deletion google/cluster/node-pool/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ variable "configuration" {
auto_repair = optional(bool)
auto_upgrade = optional(bool)

taint = optional(set(object({
taints = optional(set(object({
key = string
value = string
effect = string
Expand Down

0 comments on commit e6d9279

Please sign in to comment.