From f8346af311db7d9ab6fac5285324931a3b948055 Mon Sep 17 00:00:00 2001 From: asudbring Date: Tue, 28 Jul 2026 17:00:52 +0100 Subject: [PATCH 1/4] feat: Add AKS Automatic cluster quickstart sample --- quickstart/101-aks-automatic/main.tf | 38 +++++++++++++++++++++++ quickstart/101-aks-automatic/outputs.tf | 15 +++++++++ quickstart/101-aks-automatic/providers.tf | 24 ++++++++++++++ quickstart/101-aks-automatic/readme.md | 28 +++++++++++++++++ quickstart/101-aks-automatic/variables.tf | 28 +++++++++++++++++ 5 files changed, 133 insertions(+) create mode 100644 quickstart/101-aks-automatic/main.tf create mode 100644 quickstart/101-aks-automatic/outputs.tf create mode 100644 quickstart/101-aks-automatic/providers.tf create mode 100644 quickstart/101-aks-automatic/readme.md create mode 100644 quickstart/101-aks-automatic/variables.tf diff --git a/quickstart/101-aks-automatic/main.tf b/quickstart/101-aks-automatic/main.tf new file mode 100644 index 000000000..5dcf18f6c --- /dev/null +++ b/quickstart/101-aks-automatic/main.tf @@ -0,0 +1,38 @@ +# Create a random name for the resource group using random_pet +resource "random_pet" "rg_name" { + prefix = var.resource_group_name_prefix +} + +# Create a resource group using the generated random name +resource "azurerm_resource_group" "rg" { + location = var.resource_group_location + name = random_pet.rg_name.id +} + +# Create a random name for the AKS Automatic cluster +resource "random_pet" "cluster_name" { + prefix = var.cluster_name_prefix +} + +# Create the AKS Automatic cluster. +# The AzAPI provider is used because the AzureRM provider's azurerm_kubernetes_cluster +# resource always sets the managed cluster SKU name to "Base" and can't create the +# "Automatic" SKU. +resource "azapi_resource" "aks_automatic" { + type = "Microsoft.ContainerService/managedClusters@2026-02-01" + name = random_pet.cluster_name.id + parent_id = azurerm_resource_group.rg.id + location = azurerm_resource_group.rg.location + + identity { + type = "SystemAssigned" + } + + body = { + sku = { + name = var.cluster_sku_name + } + } + + response_export_values = ["properties.nodeResourceGroup", "properties.fqdn"] +} diff --git a/quickstart/101-aks-automatic/outputs.tf b/quickstart/101-aks-automatic/outputs.tf new file mode 100644 index 000000000..a4a376c88 --- /dev/null +++ b/quickstart/101-aks-automatic/outputs.tf @@ -0,0 +1,15 @@ +output "resource_group_name" { + value = azurerm_resource_group.rg.name +} + +output "cluster_name" { + value = azapi_resource.aks_automatic.name +} + +output "cluster_id" { + value = azapi_resource.aks_automatic.id +} + +output "node_resource_group" { + value = azapi_resource.aks_automatic.output.properties.nodeResourceGroup +} diff --git a/quickstart/101-aks-automatic/providers.tf b/quickstart/101-aks-automatic/providers.tf new file mode 100644 index 000000000..172c6cb0b --- /dev/null +++ b/quickstart/101-aks-automatic/providers.tf @@ -0,0 +1,24 @@ +terraform { + required_version = ">= 1.0" + required_providers { + azapi = { + source = "Azure/azapi" + version = "~>2.0" + } + azurerm = { + source = "hashicorp/azurerm" + version = "~>4.0" + } + random = { + source = "hashicorp/random" + version = "~>3.0" + } + } +} + +provider "azurerm" { + features {} +} + +provider "azapi" { +} diff --git a/quickstart/101-aks-automatic/readme.md b/quickstart/101-aks-automatic/readme.md new file mode 100644 index 000000000..8ca99e046 --- /dev/null +++ b/quickstart/101-aks-automatic/readme.md @@ -0,0 +1,28 @@ +# Azure Kubernetes Service (AKS) Automatic cluster + +This template deploys an AKS Automatic cluster with a system-assigned managed identity into a resource group with a random name beginning with "rg-". + +AKS Automatic is created with the `Automatic` managed cluster SKU. The AzAPI provider is used for the cluster because the AzureRM provider's `azurerm_kubernetes_cluster` resource only supports the `Base` SKU. + +## Terraform resource types + +- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) +- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) +- [azapi_resource](https://registry.terraform.io/providers/Azure/azapi/latest/docs/resources/resource) + +## Variables + +| Name | Description | Default | Validation | +|-|-|-|-| +| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg | | +| `resource_group_location` | Location of the resource group. | eastus | | +| `cluster_name_prefix` | Prefix of the AKS Automatic cluster name that's combined with a random ID so the name is unique in your Azure subscription. | aks-automatic | | +| `cluster_sku_name` | The managed cluster SKU name. Use `Automatic` for an AKS Automatic cluster. | Automatic | Must be `Automatic` or `Base`. | + +## Example + +```console +terraform init -upgrade +terraform plan -out main.tfplan +terraform apply main.tfplan +``` diff --git a/quickstart/101-aks-automatic/variables.tf b/quickstart/101-aks-automatic/variables.tf new file mode 100644 index 000000000..9e4c55767 --- /dev/null +++ b/quickstart/101-aks-automatic/variables.tf @@ -0,0 +1,28 @@ +variable "resource_group_location" { + type = string + default = "eastus" + description = "Location of the resource group." +} + +variable "resource_group_name_prefix" { + type = string + default = "rg" + description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription." +} + +variable "cluster_name_prefix" { + type = string + default = "aks-automatic" + description = "Prefix of the AKS Automatic cluster name that's combined with a random ID so the name is unique in your Azure subscription." +} + +variable "cluster_sku_name" { + type = string + default = "Automatic" + description = "The managed cluster SKU name. Use 'Automatic' for an AKS Automatic cluster." + + validation { + condition = contains(["Automatic", "Base"], var.cluster_sku_name) + error_message = "The cluster_sku_name value must be either 'Automatic' or 'Base'." + } +} From 0b981937006e2c3ada6322d8627a3b3031f45e5f Mon Sep 17 00:00:00 2001 From: asudbring Date: Wed, 29 Jul 2026 18:32:26 +0100 Subject: [PATCH 2/4] feat: add AzureRM AKS Automatic sample alongside AzAPI variant azurerm_kubernetes_automatic_cluster shipped in AzureRM 5.0.0, so 101-aks-automatic now uses the native resource. The AzAPI approach is preserved as 101-aks-automatic-azapi for cases needing direct managed cluster API control. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- quickstart/101-aks-automatic-azapi/main.tf | 38 +++++++++++++++++++ quickstart/101-aks-automatic-azapi/outputs.tf | 15 ++++++++ .../101-aks-automatic-azapi/providers.tf | 24 ++++++++++++ quickstart/101-aks-automatic-azapi/readme.md | 30 +++++++++++++++ .../101-aks-automatic-azapi/variables.tf | 28 ++++++++++++++ quickstart/101-aks-automatic/main.tf | 22 +++-------- quickstart/101-aks-automatic/outputs.tf | 12 ++++-- quickstart/101-aks-automatic/providers.tf | 9 +---- quickstart/101-aks-automatic/readme.md | 19 +++++----- quickstart/101-aks-automatic/variables.tf | 11 ------ 10 files changed, 159 insertions(+), 49 deletions(-) create mode 100644 quickstart/101-aks-automatic-azapi/main.tf create mode 100644 quickstart/101-aks-automatic-azapi/outputs.tf create mode 100644 quickstart/101-aks-automatic-azapi/providers.tf create mode 100644 quickstart/101-aks-automatic-azapi/readme.md create mode 100644 quickstart/101-aks-automatic-azapi/variables.tf diff --git a/quickstart/101-aks-automatic-azapi/main.tf b/quickstart/101-aks-automatic-azapi/main.tf new file mode 100644 index 000000000..5dcf18f6c --- /dev/null +++ b/quickstart/101-aks-automatic-azapi/main.tf @@ -0,0 +1,38 @@ +# Create a random name for the resource group using random_pet +resource "random_pet" "rg_name" { + prefix = var.resource_group_name_prefix +} + +# Create a resource group using the generated random name +resource "azurerm_resource_group" "rg" { + location = var.resource_group_location + name = random_pet.rg_name.id +} + +# Create a random name for the AKS Automatic cluster +resource "random_pet" "cluster_name" { + prefix = var.cluster_name_prefix +} + +# Create the AKS Automatic cluster. +# The AzAPI provider is used because the AzureRM provider's azurerm_kubernetes_cluster +# resource always sets the managed cluster SKU name to "Base" and can't create the +# "Automatic" SKU. +resource "azapi_resource" "aks_automatic" { + type = "Microsoft.ContainerService/managedClusters@2026-02-01" + name = random_pet.cluster_name.id + parent_id = azurerm_resource_group.rg.id + location = azurerm_resource_group.rg.location + + identity { + type = "SystemAssigned" + } + + body = { + sku = { + name = var.cluster_sku_name + } + } + + response_export_values = ["properties.nodeResourceGroup", "properties.fqdn"] +} diff --git a/quickstart/101-aks-automatic-azapi/outputs.tf b/quickstart/101-aks-automatic-azapi/outputs.tf new file mode 100644 index 000000000..a4a376c88 --- /dev/null +++ b/quickstart/101-aks-automatic-azapi/outputs.tf @@ -0,0 +1,15 @@ +output "resource_group_name" { + value = azurerm_resource_group.rg.name +} + +output "cluster_name" { + value = azapi_resource.aks_automatic.name +} + +output "cluster_id" { + value = azapi_resource.aks_automatic.id +} + +output "node_resource_group" { + value = azapi_resource.aks_automatic.output.properties.nodeResourceGroup +} diff --git a/quickstart/101-aks-automatic-azapi/providers.tf b/quickstart/101-aks-automatic-azapi/providers.tf new file mode 100644 index 000000000..172c6cb0b --- /dev/null +++ b/quickstart/101-aks-automatic-azapi/providers.tf @@ -0,0 +1,24 @@ +terraform { + required_version = ">= 1.0" + required_providers { + azapi = { + source = "Azure/azapi" + version = "~>2.0" + } + azurerm = { + source = "hashicorp/azurerm" + version = "~>4.0" + } + random = { + source = "hashicorp/random" + version = "~>3.0" + } + } +} + +provider "azurerm" { + features {} +} + +provider "azapi" { +} diff --git a/quickstart/101-aks-automatic-azapi/readme.md b/quickstart/101-aks-automatic-azapi/readme.md new file mode 100644 index 000000000..950cac3bc --- /dev/null +++ b/quickstart/101-aks-automatic-azapi/readme.md @@ -0,0 +1,30 @@ +# Azure Kubernetes Service (AKS) Automatic cluster (AzAPI provider) + +This template deploys an AKS Automatic cluster with a system-assigned managed identity into a resource group with a random name beginning with "rg-". + +The cluster is declared with the AzAPI provider's [`azapi_resource`](https://registry.terraform.io/providers/Azure/azapi/latest/docs/resources/resource) against the `Microsoft.ContainerService/managedClusters` API. Use this pattern when you need direct control over the managed cluster API payload, or when you need an API version or property that the AzureRM provider doesn't expose yet. + +For the equivalent sample that uses the AzureRM provider's `azurerm_kubernetes_automatic_cluster` resource, see [101-aks-automatic](../101-aks-automatic/). + +## Terraform resource types + +- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) +- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) +- [azapi_resource](https://registry.terraform.io/providers/Azure/azapi/latest/docs/resources/resource) + +## Variables + +| Name | Description | Default | Validation | +|-|-|-|-| +| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg | | +| `resource_group_location` | Location of the resource group. | eastus | | +| `cluster_name_prefix` | Prefix of the AKS Automatic cluster name that's combined with a random ID so the name is unique in your Azure subscription. | aks-automatic | | +| `cluster_sku_name` | The managed cluster SKU name. Use `Automatic` for an AKS Automatic cluster. | Automatic | Must be `Automatic` or `Base`. | + +## Example + +```console +terraform init -upgrade +terraform plan -out main.tfplan +terraform apply main.tfplan +``` diff --git a/quickstart/101-aks-automatic-azapi/variables.tf b/quickstart/101-aks-automatic-azapi/variables.tf new file mode 100644 index 000000000..9e4c55767 --- /dev/null +++ b/quickstart/101-aks-automatic-azapi/variables.tf @@ -0,0 +1,28 @@ +variable "resource_group_location" { + type = string + default = "eastus" + description = "Location of the resource group." +} + +variable "resource_group_name_prefix" { + type = string + default = "rg" + description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription." +} + +variable "cluster_name_prefix" { + type = string + default = "aks-automatic" + description = "Prefix of the AKS Automatic cluster name that's combined with a random ID so the name is unique in your Azure subscription." +} + +variable "cluster_sku_name" { + type = string + default = "Automatic" + description = "The managed cluster SKU name. Use 'Automatic' for an AKS Automatic cluster." + + validation { + condition = contains(["Automatic", "Base"], var.cluster_sku_name) + error_message = "The cluster_sku_name value must be either 'Automatic' or 'Base'." + } +} diff --git a/quickstart/101-aks-automatic/main.tf b/quickstart/101-aks-automatic/main.tf index 5dcf18f6c..cbeb2e7af 100644 --- a/quickstart/101-aks-automatic/main.tf +++ b/quickstart/101-aks-automatic/main.tf @@ -14,25 +14,13 @@ resource "random_pet" "cluster_name" { prefix = var.cluster_name_prefix } -# Create the AKS Automatic cluster. -# The AzAPI provider is used because the AzureRM provider's azurerm_kubernetes_cluster -# resource always sets the managed cluster SKU name to "Base" and can't create the -# "Automatic" SKU. -resource "azapi_resource" "aks_automatic" { - type = "Microsoft.ContainerService/managedClusters@2026-02-01" - name = random_pet.cluster_name.id - parent_id = azurerm_resource_group.rg.id - location = azurerm_resource_group.rg.location +# Create the AKS Automatic cluster +resource "azurerm_kubernetes_automatic_cluster" "aks_automatic" { + name = random_pet.cluster_name.id + location = azurerm_resource_group.rg.location + resource_group_name = azurerm_resource_group.rg.name identity { type = "SystemAssigned" } - - body = { - sku = { - name = var.cluster_sku_name - } - } - - response_export_values = ["properties.nodeResourceGroup", "properties.fqdn"] } diff --git a/quickstart/101-aks-automatic/outputs.tf b/quickstart/101-aks-automatic/outputs.tf index a4a376c88..9bec44003 100644 --- a/quickstart/101-aks-automatic/outputs.tf +++ b/quickstart/101-aks-automatic/outputs.tf @@ -3,13 +3,17 @@ output "resource_group_name" { } output "cluster_name" { - value = azapi_resource.aks_automatic.name + value = azurerm_kubernetes_automatic_cluster.aks_automatic.name } output "cluster_id" { - value = azapi_resource.aks_automatic.id + value = azurerm_kubernetes_automatic_cluster.aks_automatic.id } -output "node_resource_group" { - value = azapi_resource.aks_automatic.output.properties.nodeResourceGroup +output "node_resource_group_id" { + value = azurerm_kubernetes_automatic_cluster.aks_automatic.node_resource_group_id +} + +output "fully_qualified_domain_name" { + value = azurerm_kubernetes_automatic_cluster.aks_automatic.fully_qualified_domain_name } diff --git a/quickstart/101-aks-automatic/providers.tf b/quickstart/101-aks-automatic/providers.tf index 172c6cb0b..9e76a7ea8 100644 --- a/quickstart/101-aks-automatic/providers.tf +++ b/quickstart/101-aks-automatic/providers.tf @@ -1,13 +1,9 @@ terraform { required_version = ">= 1.0" required_providers { - azapi = { - source = "Azure/azapi" - version = "~>2.0" - } azurerm = { source = "hashicorp/azurerm" - version = "~>4.0" + version = "~>5.0" } random = { source = "hashicorp/random" @@ -19,6 +15,3 @@ terraform { provider "azurerm" { features {} } - -provider "azapi" { -} diff --git a/quickstart/101-aks-automatic/readme.md b/quickstart/101-aks-automatic/readme.md index 8ca99e046..fd0028fd9 100644 --- a/quickstart/101-aks-automatic/readme.md +++ b/quickstart/101-aks-automatic/readme.md @@ -1,23 +1,24 @@ -# Azure Kubernetes Service (AKS) Automatic cluster +# Azure Kubernetes Service (AKS) Automatic cluster (AzureRM provider) This template deploys an AKS Automatic cluster with a system-assigned managed identity into a resource group with a random name beginning with "rg-". -AKS Automatic is created with the `Automatic` managed cluster SKU. The AzAPI provider is used for the cluster because the AzureRM provider's `azurerm_kubernetes_cluster` resource only supports the `Base` SKU. +The cluster is created with the AzureRM provider's [`azurerm_kubernetes_automatic_cluster`](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_automatic_cluster) resource, which is the recommended way to declare an AKS Automatic cluster. This resource requires AzureRM provider `5.0` or later. + +For an equivalent sample that declares the same cluster with the AzAPI provider, see [101-aks-automatic-azapi](../101-aks-automatic-azapi/). ## Terraform resource types - [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) - [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) -- [azapi_resource](https://registry.terraform.io/providers/Azure/azapi/latest/docs/resources/resource) +- [azurerm_kubernetes_automatic_cluster](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_automatic_cluster) ## Variables -| Name | Description | Default | Validation | -|-|-|-|-| -| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg | | -| `resource_group_location` | Location of the resource group. | eastus | | -| `cluster_name_prefix` | Prefix of the AKS Automatic cluster name that's combined with a random ID so the name is unique in your Azure subscription. | aks-automatic | | -| `cluster_sku_name` | The managed cluster SKU name. Use `Automatic` for an AKS Automatic cluster. | Automatic | Must be `Automatic` or `Base`. | +| Name | Description | Default | +|-|-|-| +| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg | +| `resource_group_location` | Location of the resource group. | eastus | +| `cluster_name_prefix` | Prefix of the AKS Automatic cluster name that's combined with a random ID so the name is unique in your Azure subscription. | aks-automatic | ## Example diff --git a/quickstart/101-aks-automatic/variables.tf b/quickstart/101-aks-automatic/variables.tf index 9e4c55767..dddf03f68 100644 --- a/quickstart/101-aks-automatic/variables.tf +++ b/quickstart/101-aks-automatic/variables.tf @@ -15,14 +15,3 @@ variable "cluster_name_prefix" { default = "aks-automatic" description = "Prefix of the AKS Automatic cluster name that's combined with a random ID so the name is unique in your Azure subscription." } - -variable "cluster_sku_name" { - type = string - default = "Automatic" - description = "The managed cluster SKU name. Use 'Automatic' for an AKS Automatic cluster." - - validation { - condition = contains(["Automatic", "Base"], var.cluster_sku_name) - error_message = "The cluster_sku_name value must be either 'Automatic' or 'Base'." - } -} From 31a082f4c33aef2f83e391f2a0e9b749ba84e0e4 Mon Sep 17 00:00:00 2001 From: asudbring Date: Wed, 5 Aug 2026 22:41:47 +0100 Subject: [PATCH 3/4] Address review feedback on AKS Automatic samples Hard-code the Automatic SKU in the AzAPI sample, correct the stale rationale comment about the AzureRM provider, and default to the validated westus2 region. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- quickstart/101-aks-automatic-azapi/main.tf | 9 +++++---- quickstart/101-aks-automatic-azapi/readme.md | 16 +++++++++------- quickstart/101-aks-automatic-azapi/variables.tf | 13 +------------ quickstart/101-aks-automatic/readme.md | 5 ++++- quickstart/101-aks-automatic/variables.tf | 2 +- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/quickstart/101-aks-automatic-azapi/main.tf b/quickstart/101-aks-automatic-azapi/main.tf index 5dcf18f6c..f42c0f3ba 100644 --- a/quickstart/101-aks-automatic-azapi/main.tf +++ b/quickstart/101-aks-automatic-azapi/main.tf @@ -15,9 +15,10 @@ resource "random_pet" "cluster_name" { } # Create the AKS Automatic cluster. -# The AzAPI provider is used because the AzureRM provider's azurerm_kubernetes_cluster -# resource always sets the managed cluster SKU name to "Base" and can't create the -# "Automatic" SKU. +# The AzAPI provider is used here to get direct control over the managed cluster +# API payload and API version. Reach for this pattern when you need a property +# or an API version that the AzureRM provider hasn't surfaced yet. For the +# provider-native equivalent, see the 101-aks-automatic sample. resource "azapi_resource" "aks_automatic" { type = "Microsoft.ContainerService/managedClusters@2026-02-01" name = random_pet.cluster_name.id @@ -30,7 +31,7 @@ resource "azapi_resource" "aks_automatic" { body = { sku = { - name = var.cluster_sku_name + name = "Automatic" } } diff --git a/quickstart/101-aks-automatic-azapi/readme.md b/quickstart/101-aks-automatic-azapi/readme.md index 950cac3bc..083634d84 100644 --- a/quickstart/101-aks-automatic-azapi/readme.md +++ b/quickstart/101-aks-automatic-azapi/readme.md @@ -2,7 +2,7 @@ This template deploys an AKS Automatic cluster with a system-assigned managed identity into a resource group with a random name beginning with "rg-". -The cluster is declared with the AzAPI provider's [`azapi_resource`](https://registry.terraform.io/providers/Azure/azapi/latest/docs/resources/resource) against the `Microsoft.ContainerService/managedClusters` API. Use this pattern when you need direct control over the managed cluster API payload, or when you need an API version or property that the AzureRM provider doesn't expose yet. +The cluster is declared with the AzAPI provider's [`azapi_resource`](https://registry.terraform.io/providers/Azure/azapi/latest/docs/resources/resource) against the `Microsoft.ContainerService/managedClusters` API. Use this pattern when you need direct control over the managed cluster API payload, or when you need an API version or property that the AzureRM provider doesn't expose yet. The cluster SKU is hard-coded to `Automatic`. For the equivalent sample that uses the AzureRM provider's `azurerm_kubernetes_automatic_cluster` resource, see [101-aks-automatic](../101-aks-automatic/). @@ -14,12 +14,14 @@ For the equivalent sample that uses the AzureRM provider's `azurerm_kubernetes_a ## Variables -| Name | Description | Default | Validation | -|-|-|-|-| -| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg | | -| `resource_group_location` | Location of the resource group. | eastus | | -| `cluster_name_prefix` | Prefix of the AKS Automatic cluster name that's combined with a random ID so the name is unique in your Azure subscription. | aks-automatic | | -| `cluster_sku_name` | The managed cluster SKU name. Use `Automatic` for an AKS Automatic cluster. | Automatic | Must be `Automatic` or `Base`. | +| Name | Description | Default | +|-|-|-| +| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg | +| `resource_group_location` | Location of the resource group. | westus2 | +| `cluster_name_prefix` | Prefix of the AKS Automatic cluster name that's combined with a random ID so the name is unique in your Azure subscription. | aks-automatic | + +> [!NOTE] +> The default location is `westus2` because that's the region this sample was validated in. At the time of testing, `eastus` returned `AKSCapacityHeavyUsage` for API Server VNet Integration. Set `resource_group_location` to deploy elsewhere. ## Example diff --git a/quickstart/101-aks-automatic-azapi/variables.tf b/quickstart/101-aks-automatic-azapi/variables.tf index 9e4c55767..9bbb8f888 100644 --- a/quickstart/101-aks-automatic-azapi/variables.tf +++ b/quickstart/101-aks-automatic-azapi/variables.tf @@ -1,6 +1,6 @@ variable "resource_group_location" { type = string - default = "eastus" + default = "westus2" description = "Location of the resource group." } @@ -15,14 +15,3 @@ variable "cluster_name_prefix" { default = "aks-automatic" description = "Prefix of the AKS Automatic cluster name that's combined with a random ID so the name is unique in your Azure subscription." } - -variable "cluster_sku_name" { - type = string - default = "Automatic" - description = "The managed cluster SKU name. Use 'Automatic' for an AKS Automatic cluster." - - validation { - condition = contains(["Automatic", "Base"], var.cluster_sku_name) - error_message = "The cluster_sku_name value must be either 'Automatic' or 'Base'." - } -} diff --git a/quickstart/101-aks-automatic/readme.md b/quickstart/101-aks-automatic/readme.md index fd0028fd9..6327d306e 100644 --- a/quickstart/101-aks-automatic/readme.md +++ b/quickstart/101-aks-automatic/readme.md @@ -17,9 +17,12 @@ For an equivalent sample that declares the same cluster with the AzAPI provider, | Name | Description | Default | |-|-|-| | `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg | -| `resource_group_location` | Location of the resource group. | eastus | +| `resource_group_location` | Location of the resource group. | westus2 | | `cluster_name_prefix` | Prefix of the AKS Automatic cluster name that's combined with a random ID so the name is unique in your Azure subscription. | aks-automatic | +> [!NOTE] +> The default location is `westus2` because that's the region this sample was validated in. At the time of testing, `eastus` returned `AKSCapacityHeavyUsage` for API Server VNet Integration. Set `resource_group_location` to deploy elsewhere. + ## Example ```console diff --git a/quickstart/101-aks-automatic/variables.tf b/quickstart/101-aks-automatic/variables.tf index dddf03f68..9bbb8f888 100644 --- a/quickstart/101-aks-automatic/variables.tf +++ b/quickstart/101-aks-automatic/variables.tf @@ -1,6 +1,6 @@ variable "resource_group_location" { type = string - default = "eastus" + default = "westus2" description = "Location of the resource group." } From 0b2b2bb7fe55d687a8b232fc9ac42420072b9be7 Mon Sep 17 00:00:00 2001 From: asudbring Date: Thu, 6 Aug 2026 16:18:07 +0100 Subject: [PATCH 4/4] Pin azurerm consistently, correct provider version, drop region notes Set the azurerm pin to ~>5.0 in the AzAPI sample to match the provider-native one, correct the minimum provider version to v4.81, and remove the tested-region notes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- quickstart/101-aks-automatic-azapi/providers.tf | 2 +- quickstart/101-aks-automatic-azapi/readme.md | 4 +--- quickstart/101-aks-automatic/readme.md | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/quickstart/101-aks-automatic-azapi/providers.tf b/quickstart/101-aks-automatic-azapi/providers.tf index 172c6cb0b..2c375b07c 100644 --- a/quickstart/101-aks-automatic-azapi/providers.tf +++ b/quickstart/101-aks-automatic-azapi/providers.tf @@ -7,7 +7,7 @@ terraform { } azurerm = { source = "hashicorp/azurerm" - version = "~>4.0" + version = "~>5.0" } random = { source = "hashicorp/random" diff --git a/quickstart/101-aks-automatic-azapi/readme.md b/quickstart/101-aks-automatic-azapi/readme.md index 083634d84..0597630ca 100644 --- a/quickstart/101-aks-automatic-azapi/readme.md +++ b/quickstart/101-aks-automatic-azapi/readme.md @@ -20,9 +20,6 @@ For the equivalent sample that uses the AzureRM provider's `azurerm_kubernetes_a | `resource_group_location` | Location of the resource group. | westus2 | | `cluster_name_prefix` | Prefix of the AKS Automatic cluster name that's combined with a random ID so the name is unique in your Azure subscription. | aks-automatic | -> [!NOTE] -> The default location is `westus2` because that's the region this sample was validated in. At the time of testing, `eastus` returned `AKSCapacityHeavyUsage` for API Server VNet Integration. Set `resource_group_location` to deploy elsewhere. - ## Example ```console @@ -30,3 +27,4 @@ terraform init -upgrade terraform plan -out main.tfplan terraform apply main.tfplan ``` + diff --git a/quickstart/101-aks-automatic/readme.md b/quickstart/101-aks-automatic/readme.md index 6327d306e..2639fe99d 100644 --- a/quickstart/101-aks-automatic/readme.md +++ b/quickstart/101-aks-automatic/readme.md @@ -2,7 +2,7 @@ This template deploys an AKS Automatic cluster with a system-assigned managed identity into a resource group with a random name beginning with "rg-". -The cluster is created with the AzureRM provider's [`azurerm_kubernetes_automatic_cluster`](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_automatic_cluster) resource, which is the recommended way to declare an AKS Automatic cluster. This resource requires AzureRM provider `5.0` or later. +The cluster is created with the AzureRM provider's [`azurerm_kubernetes_automatic_cluster`](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_automatic_cluster) resource, which is the recommended way to declare an AKS Automatic cluster. This resource requires AzureRM provider `v4.81` or later. For an equivalent sample that declares the same cluster with the AzAPI provider, see [101-aks-automatic-azapi](../101-aks-automatic-azapi/). @@ -20,9 +20,6 @@ For an equivalent sample that declares the same cluster with the AzAPI provider, | `resource_group_location` | Location of the resource group. | westus2 | | `cluster_name_prefix` | Prefix of the AKS Automatic cluster name that's combined with a random ID so the name is unique in your Azure subscription. | aks-automatic | -> [!NOTE] -> The default location is `westus2` because that's the region this sample was validated in. At the time of testing, `eastus` returned `AKSCapacityHeavyUsage` for API Server VNet Integration. Set `resource_group_location` to deploy elsewhere. - ## Example ```console @@ -30,3 +27,4 @@ terraform init -upgrade terraform plan -out main.tfplan terraform apply main.tfplan ``` +