Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ resource "azurerm_key_vault" "this" {
enabled_for_disk_encryption = var.enabled_for_disk_encryption
enabled_for_template_deployment = var.enabled_for_template_deployment

access_policy = local.access_policies
enable_rbac_authorization = var.enable_rbac_authorization
access_policy = local.access_policies
rbac_authorization_enabled = var.rbac_authorization_enabled

public_network_access_enabled = var.public_network_access_enabled

Expand Down
12 changes: 6 additions & 6 deletions tests/authorization.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ run "authorization_defaults" {
}

assert {
condition = azurerm_key_vault.this.enable_rbac_authorization == true
condition = azurerm_key_vault.this.rbac_authorization_enabled == true
error_message = "RBAC authorization should be enabled by default"
}
}
Expand Down Expand Up @@ -211,7 +211,7 @@ run "access_policies_defined" {
}
}

run "enable_rbac_authorization_true" {
run "rbac_authorization_enabled_true" {
command = plan

variables {
Expand All @@ -225,12 +225,12 @@ run "enable_rbac_authorization_true" {
}

assert {
condition = azurerm_key_vault.this.enable_rbac_authorization == true
condition = azurerm_key_vault.this.rbac_authorization_enabled == true
error_message = "RBAC authorization should be enabled"
}
}

run "enable_rbac_authorization_false" {
run "rbac_authorization_enabled_false" {
command = plan

variables {
Expand All @@ -240,11 +240,11 @@ run "enable_rbac_authorization_false" {
log_analytics_workspace_id = run.setup_tests.log_analytics_workspace_id
tenant_id = run.setup_tests.tenant_id

enable_rbac_authorization = false
rbac_authorization_enabled = false
}

assert {
condition = azurerm_key_vault.this.enable_rbac_authorization == false
condition = azurerm_key_vault.this.rbac_authorization_enabled == false
error_message = "RBAC authorization should not be enabled"
}
}
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ variable "access_policies" {
default = []
}

variable "enable_rbac_authorization" {
variable "rbac_authorization_enabled" {
description = "Should RBAC authorization be enabled for this Key Vault?"
type = bool
default = true
Expand Down