Skip to content

Commit 2e211ce

Browse files
committed
Introduce variable rbac_aad
1 parent 20193a1 commit 2e211ce

6 files changed

Lines changed: 15 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ No modules.
333333
| <a name="input_private_cluster_public_fqdn_enabled"></a> [private\_cluster\_public\_fqdn\_enabled](#input\_private\_cluster\_public\_fqdn\_enabled) | (Optional) Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. | `bool` | `false` | no |
334334
| <a name="input_private_dns_zone_id"></a> [private\_dns\_zone\_id](#input\_private\_dns\_zone\_id) | (Optional) Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise cluster will have issues after provisioning. Changing this forces a new resource to be created. | `string` | `null` | no |
335335
| <a name="input_public_ssh_key"></a> [public\_ssh\_key](#input\_public\_ssh\_key) | A custom ssh key to control access to the AKS cluster. Changing this forces a new resource to be created. | `string` | `""` | no |
336+
| <a name="input_rbac_aad"></a> [rbac\_aad](#input\_rbac\_aad) | (Optional) Is Azure Active Directory ingration enabled? | `bool` | `false` | no |
336337
| <a name="input_rbac_aad_admin_group_object_ids"></a> [rbac\_aad\_admin\_group\_object\_ids](#input\_rbac\_aad\_admin\_group\_object\_ids) | Object ID of groups with admin access. | `list(string)` | `null` | no |
337338
| <a name="input_rbac_aad_azure_rbac_enabled"></a> [rbac\_aad\_azure\_rbac\_enabled](#input\_rbac\_aad\_azure\_rbac\_enabled) | (Optional) Is Role Based Access Control based on Azure AD enabled? | `bool` | `null` | no |
338339
| <a name="input_rbac_aad_client_app_id"></a> [rbac\_aad\_client\_app\_id](#input\_rbac\_aad\_client\_app\_id) | The Client ID of an Azure Active Directory Application. | `string` | `null` | no |

examples/named_cluster/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ module "aks_cluster_name" {
7474
}
7575
net_profile_pod_cidr = "10.1.0.0/16"
7676
private_cluster_enabled = true
77+
rbac_aad = true
7778
rbac_aad_managed = true
7879
role_based_access_control_enabled = true
7980
}

examples/startup/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ module "aks" {
7676
network_policy = "azure"
7777
os_disk_size_gb = 60
7878
private_cluster_enabled = true
79+
rbac_aad = true
7980
rbac_aad_managed = true
8081
role_based_access_control_enabled = true
8182
sku_tier = "Paid"
@@ -87,4 +88,4 @@ module "aks" {
8788
agents_tags = {
8889
"Agent" : "agentTag"
8990
}
90-
}
91+
}

examples/without_monitor/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ module "aks_without_monitor" {
4343
log_analytics_workspace_enabled = false
4444
net_profile_pod_cidr = "10.1.0.0/16"
4545
private_cluster_enabled = true
46+
rbac_aad = true
4647
rbac_aad_managed = true
4748
role_based_access_control_enabled = true
4849
}

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ resource "azurerm_kubernetes_cluster" "main" {
9595
}
9696
}
9797
dynamic "azure_active_directory_role_based_access_control" {
98-
for_each = var.role_based_access_control_enabled && local.rbac_aad_azure_rbac_enabled && var.rbac_aad_managed ? ["rbac"] : []
98+
for_each = var.rbac_aad && var.rbac_aad_managed ? ["rbac"] : []
9999

100100
content {
101101
admin_group_object_ids = var.rbac_aad_admin_group_object_ids
@@ -105,7 +105,7 @@ resource "azurerm_kubernetes_cluster" "main" {
105105
}
106106
}
107107
dynamic "azure_active_directory_role_based_access_control" {
108-
for_each = var.role_based_access_control_enabled && local.rbac_aad_azure_rbac_enabled && !var.rbac_aad_managed ? ["rbac"] : []
108+
for_each = var.rbac_aad && !var.rbac_aad_managed ? ["rbac"] : []
109109

110110
content {
111111
client_app_id = var.rbac_aad_client_app_id

variables.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,13 @@ variable "public_ssh_key" {
409409
default = ""
410410
}
411411

412+
variable "rbac_aad" {
413+
type = bool
414+
description = "(Optional) Is Azure Active Directory ingration enabled?"
415+
default = false
416+
nullable = false
417+
}
418+
412419
variable "rbac_aad_admin_group_object_ids" {
413420
type = list(string)
414421
description = "Object ID of groups with admin access."
@@ -501,4 +508,4 @@ variable "workload_identity_enabled" {
501508
description = "Enable or Disable Workload Identity. Defaults to false."
502509
type = bool
503510
default = false
504-
}
511+
}

0 commit comments

Comments
 (0)