Skip to content

Commit 2edb44f

Browse files
authored
Naming conventions fix for mission 3680 (#259)
* add cf vars to output * minor modifications to comply with best practice naming conventions
1 parent c7f92d0 commit 2edb44f

File tree

3 files changed

+47
-12
lines changed

3 files changed

+47
-12
lines changed

released/discovery_center/mission_3680/step1/main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ data "btp_subaccount_environments" "all" {
136136
# Take the landscape label from the first CF environment if no environment label is provided
137137
# (this replaces the previous null_resource)
138138
# ------------------------------------------------------------------------------------------------------
139-
resource "terraform_data" "replacement" {
139+
resource "terraform_data" "cf_landscape_label" {
140140
input = length(var.cf_landscape_label) > 0 ? var.cf_landscape_label : [for env in data.btp_subaccount_environments.all.values : env if env.service_name == "cloudfoundry" && env.environment_type == "cloudfoundry"][0].landscape_label
141141
}
142142
# ------------------------------------------------------------------------------------------------------
@@ -148,7 +148,7 @@ resource "btp_subaccount_environment_instance" "cloudfoundry" {
148148
environment_type = "cloudfoundry"
149149
service_name = "cloudfoundry"
150150
plan_name = "standard"
151-
landscape_label = terraform_data.replacement.output
151+
landscape_label = terraform_data.cf_landscape_label.output
152152
parameters = jsonencode({
153153
instance_name = local.subaccount_cf_org
154154
})
@@ -204,11 +204,12 @@ resource "local_file" "output_vars_step1" {
204204
cf_org_id = "${jsondecode(btp_subaccount_environment_instance.cloudfoundry.labels)["Org ID"]}"
205205
origin = "${var.origin}"
206206
cf_space_name = "${var.cf_space_name}"
207-
cf_org_admins = ${jsonencode(var.cf_org_admins)}
208207
cf_org_users = ${jsonencode(var.cf_org_users)}
208+
cf_org_admins = ${jsonencode(var.cf_org_admins)}
209209
cf_space_developers = ${jsonencode(var.cf_space_developers)}
210210
cf_space_managers = ${jsonencode(var.cf_space_managers)}
211211
event_mesh_url = "${btp_subaccount_subscription.event_mesh_application.subscription_url}"
212+
hana_tools_url = "${btp_subaccount_subscription.hana_cloud_tools.subscription_url}"
212213
EOT
213214
filename = "../step2/terraform.tfvars"
214215
}

released/discovery_center/mission_3680/step1/output.tf

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ output "cf_api_url" {
88
description = "The Cloudfoundry API endpoint."
99
}
1010

11-
output "cf_landscape_label" {
12-
value = terraform_data.replacement.output
13-
description = "The Cloudfoundry landscape label."
14-
}
15-
1611
output "cf_org_id" {
1712
value = jsondecode(btp_subaccount_environment_instance.cloudfoundry.labels)["Org ID"]
1813
description = "The Cloudfoundry org id."
@@ -23,7 +18,42 @@ output "event_mesh_url" {
2318
description = "Event Mesh URL"
2419
}
2520

26-
# output "hana_tools_url" {
27-
# value = btp_subaccount_subscription.hana_cloud_tools.subscription_url
28-
# description = "HANA Tools URL"
29-
# }
21+
output "hana_tools_url" {
22+
value = btp_subaccount_subscription.hana_cloud_tools.subscription_url
23+
description = "HANA Tools URL"
24+
}
25+
26+
output "cf_org_name" {
27+
value = jsondecode(btp_subaccount_environment_instance.cloudfoundry.labels)["Org Name"]
28+
description = "The Cloudfoundry org name."
29+
}
30+
31+
output "cf_org_admins" {
32+
value = var.cf_org_admins
33+
description = "The Cloudfoundry org admins."
34+
}
35+
36+
output "cf_org_users" {
37+
value = var.cf_org_users
38+
description = "The Cloudfoundry org users."
39+
}
40+
41+
output "cf_space_developers" {
42+
value = var.cf_space_developers
43+
description = "The Cloudfoundry space developers."
44+
}
45+
46+
output "cf_space_managers" {
47+
value = var.cf_space_managers
48+
description = "The Cloudfoundry space managers."
49+
}
50+
51+
output "cf_space_name" {
52+
value = var.cf_space_name
53+
description = "The Cloudfoundry space name."
54+
}
55+
56+
output "origin" {
57+
value = var.origin
58+
description = "The origin of the identity provider."
59+
}

released/discovery_center/mission_3680/step1/samples.tfvars

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ cf_org_admins = ["[email protected]"]
2222
cf_org_users = ["[email protected]"]
2323
cf_space_managers = ["[email protected]", "[email protected]"]
2424
cf_space_developers = ["[email protected]", "[email protected]"]
25+
26+
# Event Mesh users
27+
event_mesh_admins = ["[email protected]", "[email protected]"]
28+
event_mesh_developers = ["[email protected]", "[email protected]"]

0 commit comments

Comments
 (0)