Skip to content

Commit

Permalink
Upgrade to azurerm provider version 4
Browse files Browse the repository at this point in the history
  • Loading branch information
zioproto committed Oct 31, 2024
1 parent 207ab0d commit 9f99005
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 42 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The following requirements are needed by this module:

- <a name="requirement_azapi"></a> [azapi](#requirement\_azapi) (>= 1.4.0, < 2.0)

- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 3.86.0, <4.0)
- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 3.86.0, <5.0)

- <a name="requirement_local"></a> [local](#requirement\_local) (>=2.4.1, < 3.0)

Expand Down Expand Up @@ -339,9 +339,9 @@ The following Modules are called:

### <a name="module_avm_res_containerregistry_registry"></a> [avm\_res\_containerregistry\_registry](#module\_avm\_res\_containerregistry\_registry)

Source: Azure/avm-res-containerregistry-registry/azurerm
Source: github.com/zioproto/terraform-azurerm-avm-res-containerregistry-registry

Version: 0.3.1
Version: provider-v4

<!-- markdownlint-disable-next-line MD041 -->
## Data Collection
Expand Down
8 changes: 4 additions & 4 deletions examples/default/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.7.0, < 4.0.0"
version = ">= 3.7.0, < 5.0.0"
}
random = {
source = "hashicorp/random"
Expand Down Expand Up @@ -84,7 +84,7 @@ resource "azurerm_private_dns_zone" "this" {
module "avm_res_network_virtualnetwork" {
source = "Azure/avm-res-network-virtualnetwork/azurerm"
version = "0.2.3"
version = "0.5.0"
address_space = ["10.31.0.0/16"]
location = azurerm_resource_group.this.location
Expand All @@ -110,7 +110,7 @@ The following requirements are needed by this module:

- <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) (>= 1.3.0)

- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 3.7.0, < 4.0.0)
- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 3.7.0, < 5.0.0)

- <a name="requirement_random"></a> [random](#requirement\_random) (>= 3.5.0, < 4.0.0)

Expand Down Expand Up @@ -153,7 +153,7 @@ The following Modules are called:

Source: Azure/avm-res-network-virtualnetwork/azurerm

Version: 0.2.3
Version: 0.5.0

### <a name="module_naming"></a> [naming](#module\_naming)

Expand Down
4 changes: 2 additions & 2 deletions examples/default/main.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.7.0, < 4.0.0"
version = ">= 4, <5"
}
random = {
source = "hashicorp/random"
Expand Down Expand Up @@ -78,7 +78,7 @@ resource "azurerm_private_dns_zone" "this" {

module "avm_res_network_virtualnetwork" {
source = "Azure/avm-res-network-virtualnetwork/azurerm"
version = "0.2.3"
version = "0.5.0"

address_space = ["10.31.0.0/16"]
location = azurerm_resource_group.this.location
Expand Down
8 changes: 4 additions & 4 deletions examples/with_availability_zone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.7.0, < 4.0.0"
version = ">= 3.7.0, < 5.0.0"
}
}
}
Expand Down Expand Up @@ -101,7 +101,7 @@ resource "azurerm_private_dns_zone" "this" {
module "avm_res_network_virtualnetwork" {
source = "Azure/avm-res-network-virtualnetwork/azurerm"
version = "0.2.3"
version = "0.5.0"
address_space = ["10.31.0.0/16"]
location = azurerm_resource_group.this.location
Expand All @@ -127,7 +127,7 @@ The following requirements are needed by this module:

- <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) (>= 1.3.0)

- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 3.7.0, < 4.0.0)
- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 3.7.0, < 5.0.0)

## Resources

Expand Down Expand Up @@ -176,7 +176,7 @@ The following Modules are called:

Source: Azure/avm-res-network-virtualnetwork/azurerm

Version: 0.2.3
Version: 0.5.0

### <a name="module_naming"></a> [naming](#module\_naming)

Expand Down
4 changes: 2 additions & 2 deletions examples/with_availability_zone/main.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.7.0, < 4.0.0"
version = ">= 4, <5"
}
}
}
Expand Down Expand Up @@ -95,7 +95,7 @@ resource "azurerm_private_dns_zone" "this" {

module "avm_res_network_virtualnetwork" {
source = "Azure/avm-res-network-virtualnetwork/azurerm"
version = "0.2.3"
version = "0.5.0"

address_space = ["10.31.0.0/16"]
location = azurerm_resource_group.this.location
Expand Down
8 changes: 4 additions & 4 deletions examples/without_availability_zone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.7.0, < 4.0.0"
version = ">= 3.7.0, < 5.0.0"
}
}
}
Expand Down Expand Up @@ -97,7 +97,7 @@ resource "azurerm_private_dns_zone" "this" {
module "avm_res_network_virtualnetwork" {
source = "Azure/avm-res-network-virtualnetwork/azurerm"
version = "0.2.3"
version = "0.5.0"
address_space = ["10.31.0.0/16"]
location = azurerm_resource_group.this.location
Expand All @@ -123,7 +123,7 @@ The following requirements are needed by this module:

- <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) (>= 1.3.0)

- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 3.7.0, < 4.0.0)
- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (>= 3.7.0, < 5.0.0)

## Resources

Expand Down Expand Up @@ -172,7 +172,7 @@ The following Modules are called:

Source: Azure/avm-res-network-virtualnetwork/azurerm

Version: 0.2.3
Version: 0.5.0

### <a name="module_naming"></a> [naming](#module\_naming)

Expand Down
4 changes: 2 additions & 2 deletions examples/without_availability_zone/main.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.7.0, < 4.0.0"
version = ">= 4, <5"
}
}
}
Expand Down Expand Up @@ -91,7 +91,7 @@ resource "azurerm_private_dns_zone" "this" {

module "avm_res_network_virtualnetwork" {
source = "Azure/avm-res-network-virtualnetwork/azurerm"
version = "0.2.3"
version = "0.5.0"

address_space = ["10.31.0.0/16"]
location = azurerm_resource_group.this.location
Expand Down
41 changes: 21 additions & 20 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module "avm_res_containerregistry_registry" {
for_each = toset(var.acr == null ? [] : ["acr"])
source = "Azure/avm-res-containerregistry-registry/azurerm"
version = "0.3.1"
for_each = toset(var.acr == null ? [] : ["acr"])
# point to https://github.com/zioproto/terraform-azurerm-avm-res-containerregistry-registry/tree/provider-v4
source = "github.com/zioproto/terraform-azurerm-avm-res-containerregistry-registry?ref=provider-v4"
#source = "Azure/avm-res-containerregistry-registry/azurerm"
#version = "0.3.1"
name = var.acr.name
location = var.location
resource_group_name = var.resource_group_name
Expand Down Expand Up @@ -52,12 +54,12 @@ resource "azurerm_kubernetes_cluster" "this" {
location = var.location
name = "aks-${var.name}"
resource_group_name = var.resource_group_name
automatic_channel_upgrade = "patch"
automatic_upgrade_channel = "patch"
azure_policy_enabled = true
dns_prefix = var.name
kubernetes_version = var.kubernetes_version
local_account_disabled = true
node_os_channel_upgrade = "NodeImage"
node_os_upgrade_channel = "NodeImage"
oidc_issuer_enabled = true
private_cluster_enabled = true
role_based_access_control_enabled = true
Expand All @@ -66,19 +68,19 @@ resource "azurerm_kubernetes_cluster" "this" {
workload_identity_enabled = true

default_node_pool {
name = "agentpool"
vm_size = "Standard_D4d_v5"
enable_auto_scaling = true
enable_host_encryption = true
max_count = 9
max_pods = 110
min_count = 3
node_labels = var.node_labels
orchestrator_version = var.orchestrator_version
os_sku = var.os_sku
tags = merge(var.tags, var.agents_tags)
vnet_subnet_id = var.network.node_subnet_id
zones = try([for zone in local.regions_by_name_or_display_name[var.location].zones : zone], null)
name = "agentpool"
vm_size = "Standard_D4d_v5"
auto_scaling_enabled = true
host_encryption_enabled = true
max_count = 9
max_pods = 110
min_count = 3
node_labels = var.node_labels
orchestrator_version = var.orchestrator_version
os_sku = var.os_sku
tags = merge(var.tags, var.agents_tags)
vnet_subnet_id = var.network.node_subnet_id
zones = try([for zone in local.regions_by_name_or_display_name[var.location].zones : zone], null)

upgrade_settings {
max_surge = "10%"
Expand All @@ -90,7 +92,6 @@ resource "azurerm_kubernetes_cluster" "this" {
azure_active_directory_role_based_access_control {
admin_group_object_ids = var.rbac_aad_admin_group_object_ids
azure_rbac_enabled = var.rbac_aad_azure_rbac_enabled
managed = true
tenant_id = var.rbac_aad_tenant_id
}
## Resources that only support UserAssigned
Expand Down Expand Up @@ -254,7 +255,7 @@ resource "azurerm_kubernetes_cluster_node_pool" "this" {
kubernetes_cluster_id = azurerm_kubernetes_cluster.this.id
name = each.value.name
vm_size = each.value.vm_size
enable_auto_scaling = true
auto_scaling_enabled = true
max_count = each.value.max_count
min_count = each.value.min_count
node_labels = each.value.labels
Expand Down
2 changes: 1 addition & 1 deletion terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
}
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.86.0, <4.0"
version = ">= 4, <5"
}
local = {
source = "hashicorp/local"
Expand Down

0 comments on commit 9f99005

Please sign in to comment.