11provider "azurerm" {
2- features {}
2+ features {
3+ resource_group {
4+ prevent_deletion_if_contains_resources = false
5+ }
6+ }
37}
48
59resource "random_id" "prefix" {
@@ -31,28 +35,30 @@ resource "azurerm_user_assigned_identity" "test" {
3135}
3236
3337module "aks" {
34- source = " ../.."
35- prefix = " prefix-${ random_id . prefix . hex } "
36- resource_group_name = azurerm_resource_group. main . name
37- client_id = var. client_id
38- client_secret = var. client_secret
39- network_plugin = " azure"
40- vnet_subnet_id = azurerm_subnet. test . id
41- os_disk_size_gb = 60
42- enable_http_application_routing = true
43- enable_azure_policy = true
44- enable_host_encryption = true
45- enable_log_analytics_workspace = true
46- sku_tier = " Paid"
47- private_cluster_enabled = true
48- enable_auto_scaling = true
49- agents_min_count = 1
50- agents_max_count = 2
51- agents_count = null
52- agents_max_pods = 100
53- agents_pool_name = " testnodepool"
54- agents_availability_zones = [" 1" , " 2" ]
55- agents_type = " VirtualMachineScaleSets"
38+ source = " ../.."
39+ prefix = " prefix-${ random_id . prefix . hex } "
40+ resource_group_name = azurerm_resource_group. main . name
41+ client_id = var. client_id
42+ client_secret = var. client_secret
43+ network_plugin = " azure"
44+ vnet_subnet_id = azurerm_subnet. test . id
45+ os_disk_size_gb = 60
46+ enable_http_application_routing = true
47+ enable_azure_policy = true
48+ enable_host_encryption = true
49+ enable_role_based_access_control = true
50+ rbac_aad_managed = true
51+ enable_log_analytics_workspace = true
52+ sku_tier = " Paid"
53+ private_cluster_enabled = true
54+ enable_auto_scaling = true
55+ agents_min_count = 1
56+ agents_max_count = 2
57+ agents_count = null
58+ agents_max_pods = 100
59+ agents_pool_name = " testnodepool"
60+ agents_availability_zones = [" 1" , " 2" ]
61+ agents_type = " VirtualMachineScaleSets"
5662
5763 agents_labels = {
5864 " node1" : " label1"
@@ -75,20 +81,24 @@ module "aks" {
7581}
7682
7783module "aks_without_monitor" {
78- source = " ../.."
79- prefix = " prefix2-${ random_id . prefix . hex } "
80- resource_group_name = azurerm_resource_group. main . name
84+ source = " ../.."
85+ prefix = " prefix2-${ random_id . prefix . hex } "
86+ resource_group_name = azurerm_resource_group. main . name
87+ enable_role_based_access_control = true
88+ rbac_aad_managed = true
8189 # checkov:skip=CKV_AZURE_4:The logging is turn off for demo purpose. DO NOT DO THIS IN PRODUCTION ENVIRONMENT!
82- enable_log_analytics_workspace = false
83- net_profile_pod_cidr = " 10.1.0.0/16"
84- depends_on = [azurerm_resource_group . main ]
90+ enable_log_analytics_workspace = false
91+ net_profile_pod_cidr = " 10.1.0.0/16"
92+ depends_on = [azurerm_resource_group . main ]
8593}
8694
8795module "aks_cluster_name" {
8896 source = " ../.."
8997 cluster_name = " test-cluster"
9098 prefix = " prefix"
9199 resource_group_name = azurerm_resource_group. main . name
100+ enable_role_based_access_control = true
101+ rbac_aad_managed = true
92102 enable_log_analytics_workspace = true
93103 # Not necessary, just for demo purpose.
94104 admin_username = " azureuser"
0 commit comments