Skip to content

Commit 3d9c5d3

Browse files
authored
feat: (IAC-639): add aks_cluster_sku_tier variable to aks module
1 parent b6d2c67 commit 3d9c5d3

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

docs/CONFIG-VARS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ Ubuntu 20.04 LTS is the operating system used on the Jump/NFS servers. Ubuntu cr
173173
| aks_identity | Use UserAssignedIdentity or Service Principal as [AKS identity](https://docs.microsoft.com/en-us/azure/aks/concepts-identity) | string | "uai" | A value of `uai` wil create a Managed Identity based on the permissions of the authenticated user or use [`AKS_UAI_NAME`](#use-existing), if set. A value of `sp` will use values from [`CLIENT_ID`/`CLIENT_SECRET`](#azure-authentication), if set. |
174174
| ssh_public_key | File name of public ssh key for jump and nfs VM | string | "~/.ssh/id_rsa.pub" | Required with `create_jump_vm=true` or `storage_type=standard` |
175175
| cluster_api_mode | Public or private IP for the cluster api | string | "public" | Valid Values: "public", "private" |
176+
| aks_cluster_sku_tier | Optimizes api server for cost vs availability | string | "Free" | Valid Values: "Free", "Paid" |
176177

177178
## Node Pools
178179

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ module "aks" {
130130
aks_cluster_rg = local.aks_rg.name
131131
aks_cluster_rg_id = local.aks_rg.id
132132
aks_cluster_dns_prefix = "${var.prefix}-aks"
133+
aks_cluster_sku_tier = var.aks_cluster_sku_tier
133134
aks_cluster_location = var.location
134135
aks_cluster_node_auto_scaling = var.default_nodepool_min_nodes == var.default_nodepool_max_nodes ? false : true
135136
aks_cluster_node_count = var.default_nodepool_min_nodes

modules/azure_aks/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ resource "azurerm_kubernetes_cluster" "aks" {
44
location = var.aks_cluster_location
55
resource_group_name = var.aks_cluster_rg
66
dns_prefix = var.aks_cluster_dns_prefix
7+
sku_tier = var.aks_cluster_sku_tier
78
role_based_access_control_enabled = true
89
http_application_routing_enabled = false
910

modules/azure_aks/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ variable "aks_cluster_location" {
99
default = "eastus"
1010
}
1111

12+
variable aks_cluster_sku_tier {
13+
description = "The SKU Tier that should be used for this Kubernetes Cluster. Possible values are Free and Paid (which includes the Uptime SLA). Defaults to Free"
14+
default = "Free"
15+
16+
validation {
17+
condition = contains(["Free", "Paid"], var.aks_cluster_sku_tier)
18+
error_message = "ERROR: Valid types are \"Free\" and \"Paid\"!"
19+
}
20+
}
21+
1222
variable "aks_private_cluster" {
1323
default = false
1424
}

variables.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ variable "location" {
4141
default = "eastus"
4242
}
4343

44+
variable aks_cluster_sku_tier {
45+
description = "The SKU Tier that should be used for this Kubernetes Cluster. Possible values are Free and Paid (which includes the Uptime SLA). Defaults to Free"
46+
default = "Free"
47+
type = string
48+
49+
validation {
50+
condition = contains(["Free", "Paid"], var.aks_cluster_sku_tier)
51+
error_message = "ERROR: Valid types are \"Free\" and \"Paid\"!"
52+
}
53+
}
54+
4455
variable "ssh_public_key" {
4556
type = string
4657
default = "~/.ssh/id_rsa.pub"

0 commit comments

Comments
 (0)