Skip to content

Commit

Permalink
Merge pull request #33 from Azure/f-32
Browse files Browse the repository at this point in the history
Add `precondition` for `var.container_app_environment_internal_load_balancer_enabled`
  • Loading branch information
jiaweitao001 authored Dec 20, 2023
2 parents 1220df8 + c42b0f8 commit 9ac8f17
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ resource "azurerm_container_app_environment" "container_env" {
internal_load_balancer_enabled = var.container_app_environment_internal_load_balancer_enabled
log_analytics_workspace_id = try(azurerm_log_analytics_workspace.laws[0].id, var.log_analytics_workspace.id)
tags = var.container_app_environment_tags

lifecycle {
precondition {
condition = var.container_app_environment_internal_load_balancer_enabled == null || var.container_app_environment_infrastructure_subnet_id != null
error_message = "`var.container_app_environment_internal_load_balancer_enabled` can only be set when `var.container_app_environment_infrastructure_subnet_id` is specified."
}
}
}

resource "azurerm_container_app_environment_dapr_component" "dapr" {
Expand Down

0 comments on commit 9ac8f17

Please sign in to comment.