Skip to content

Commit

Permalink
fix: inconsistent types in conditional
Browse files Browse the repository at this point in the history
2024/07/29 06:57:53 Error: Inconsistent conditional result types
2024/07/29 06:57:53
2024/07/29 06:57:53   on /home/AzDevOps_azpcontainer/.terraform/modules/stage2/modules/messaging/web_pubsub/private_endpoint.tf line 11, in module "private_endpoint":
2024/07/29 06:57:53   11:   private_dns     = can(each.value.private_dns) ? var.remote_objects.private_dns : {}
2024/07/29 06:57:53     ├────────────────
2024/07/29 06:57:53     │ each.value.private_dns is object with 2 attributes
2024/07/29 06:57:53     │ var.remote_objects.private_dns is object with 5 attributes
2024/07/29 06:57:53
2024/07/29 06:57:53 The true and false result expressions must have consistent types. The 'true'
2024/07/29 06:57:53 value includes object attribute "devops", which is absent in the 'false'

We don't need the condition here, as the private_dns variable will only act as a resource reference and the decision making will be done by the var.settings.private_dns parameter
  • Loading branch information
Simon Schneider committed Jul 29, 2024
1 parent 9706af0 commit f0f5d47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/messaging/web_pubsub/private_endpoint.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module "private_endpoint" {
global_settings = var.global_settings
location = local.location
name = each.value.name
private_dns = can(each.value.private_dns) ? var.remote_objects.private_dns : {}
private_dns = var.remote_objects.private_dns
resource_groups = var.remote_objects.resource_groups
resource_id = azurerm_web_pubsub.wps.id
settings = each.value
Expand Down

0 comments on commit f0f5d47

Please sign in to comment.