Skip to content

Commit

Permalink
Add validation block to enforce users to change sku_tier from `Paid…
Browse files Browse the repository at this point in the history
…` to `Standard`. (#346)
  • Loading branch information
lonegunmanb authored Apr 11, 2023
1 parent 352e4c6 commit a0747e2
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/multiple_node_pools/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module "aks" {
prefix = "prefix-${random_id.prefix.hex}"
resource_group_name = local.resource_group.name
os_disk_size_gb = 60
sku_tier = "Paid"
sku_tier = "Standard"
rbac_aad = false
vnet_subnet_id = azurerm_subnet.test.id
node_pools = local.nodes
Expand Down
2 changes: 1 addition & 1 deletion examples/multiple_node_pools/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.40, < 4.0"
version = ">= 3.51, < 4.0"
}
random = {
source = "hashicorp/random"
Expand Down
2 changes: 1 addition & 1 deletion examples/named_cluster/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=3.40.0, < 4.0"
version = ">=3.51.0, < 4.0"
}
curl = {
source = "anschoewe/curl"
Expand Down
2 changes: 1 addition & 1 deletion examples/startup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module "aks" {
rbac_aad = true
rbac_aad_managed = true
role_based_access_control_enabled = true
sku_tier = "Paid"
sku_tier = "Standard"
vnet_subnet_id = azurerm_subnet.test.id

agents_labels = {
Expand Down
2 changes: 1 addition & 1 deletion examples/startup/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.40, < 4.0"
version = ">= 3.51, < 4.0"
}
curl = {
source = "anschoewe/curl"
Expand Down
2 changes: 1 addition & 1 deletion examples/with_acr/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module "aks" {
network_plugin = "azure"
network_policy = "azure"
os_disk_size_gb = 60
sku_tier = "Paid"
sku_tier = "Standard"
rbac_aad = false
vnet_subnet_id = azurerm_subnet.test.id
}
2 changes: 1 addition & 1 deletion examples/with_acr/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.40, < 4.0"
version = ">= 3.51, < 4.0"
}
random = {
source = "hashicorp/random"
Expand Down
2 changes: 1 addition & 1 deletion examples/without_monitor/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.40, < 4.0"
version = ">= 3.51, < 4.0"
}
curl = {
source = "anschoewe/curl"
Expand Down
6 changes: 5 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1042,8 +1042,12 @@ variable "secret_rotation_interval" {

variable "sku_tier" {
type = string
description = "The SKU Tier that should be used for this Kubernetes Cluster. Possible values are `Free` and `Paid`"
description = "The SKU Tier that should be used for this Kubernetes Cluster. Possible values are `Free` and `Standard`"
default = "Free"
validation {
condition = contains(["Free", "Standard"], var.sku_tier)
error_message = "The SKU Tier must be either `Free` or `Standard`. `Paid` is no longer supported since AzureRM provider v3.51.0."
}
}

variable "storage_profile_blob_driver_enabled" {
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.47.0, < 4.0"
version = ">= 3.51.0, < 4.0"
}
tls = {
source = "hashicorp/tls"
Expand Down

0 comments on commit a0747e2

Please sign in to comment.