Skip to content

Commit b328b80

Browse files
committed
Azure Active Directory RBAC enable/disable with new variable rbac_aad
1 parent 6b3a878 commit b328b80

6 files changed

Lines changed: 13 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ No modules.
342342
| <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 |
343343
| <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 |
344344
| <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 |
345+
| <a name="input_rbac_aad"></a> [rbac\_aad](#input\_rbac\_aad) | (Optional) Is Azure Active Directory ingration enabled? | `bool` | `true` | no |
345346
| <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 |
346347
| <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 |
347348
| <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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ module "aks" {
7878
network_policy = "azure"
7979
os_disk_size_gb = 60
8080
private_cluster_enabled = true
81+
rbac_aad = true
8182
rbac_aad_managed = true
8283
role_based_access_control_enabled = true
8384
sku_tier = "Paid"

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
@@ -98,7 +98,7 @@ resource "azurerm_kubernetes_cluster" "main" {
9898
}
9999
}
100100
dynamic "azure_active_directory_role_based_access_control" {
101-
for_each = var.role_based_access_control_enabled && var.rbac_aad_managed ? ["rbac"] : []
101+
for_each = var.rbac_aad && var.rbac_aad_managed ? ["rbac"] : []
102102

103103
content {
104104
admin_group_object_ids = var.rbac_aad_admin_group_object_ids
@@ -108,7 +108,7 @@ resource "azurerm_kubernetes_cluster" "main" {
108108
}
109109
}
110110
dynamic "azure_active_directory_role_based_access_control" {
111-
for_each = var.role_based_access_control_enabled && !var.rbac_aad_managed ? ["rbac"] : []
111+
for_each = var.rbac_aad && !var.rbac_aad_managed ? ["rbac"] : []
112112

113113
content {
114114
client_app_id = var.rbac_aad_client_app_id

variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,13 @@ variable "public_ssh_key" {
472472
default = ""
473473
}
474474

475+
variable "rbac_aad" {
476+
type = bool
477+
description = "(Optional) Is Azure Active Directory ingration enabled?"
478+
default = true
479+
nullable = false
480+
}
481+
475482
variable "rbac_aad_admin_group_object_ids" {
476483
type = list(string)
477484
description = "Object ID of groups with admin access."

0 commit comments

Comments
 (0)