diff --git a/domain/main.tf b/domain/main.tf index 103f731..9886f80 100644 --- a/domain/main.tf +++ b/domain/main.tf @@ -1,7 +1,7 @@ locals { - service_name = (var.name == "" ? "${data.cloudfoundry_app.app[0].name}-${var.domain_name}" : var.name) endpoint = (var.host_name != null ? "${var.host_name}.${var.domain_name}" : var.domain_name) target_apps = (var.app_name_or_id != null ? [var.app_name_or_id] : var.app_names_or_ids) + service_name = (var.name == "" ? "${data.cloudfoundry_app.app[local.target_apps[0]].name}-${var.domain_name}" : var.name) } data "cloudfoundry_space" "space" { @@ -35,7 +35,7 @@ resource "cloudfoundry_route" "origin_route" { dynamic "target" { for_each = data.cloudfoundry_app.app content { - app = target.id + app = target.value.id } } }