Skip to content

Naming conventions fix for mission 3680 #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 16, 2024
Merged
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
7 changes: 4 additions & 3 deletions released/discovery_center/mission_3680/step1/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ data "btp_subaccount_environments" "all" {
# Take the landscape label from the first CF environment if no environment label is provided
# (this replaces the previous null_resource)
# ------------------------------------------------------------------------------------------------------
resource "terraform_data" "replacement" {
resource "terraform_data" "cf_landscape_label" {
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
}
# ------------------------------------------------------------------------------------------------------
Expand All @@ -148,7 +148,7 @@ resource "btp_subaccount_environment_instance" "cloudfoundry" {
environment_type = "cloudfoundry"
service_name = "cloudfoundry"
plan_name = "standard"
landscape_label = terraform_data.replacement.output
landscape_label = terraform_data.cf_landscape_label.output
parameters = jsonencode({
instance_name = local.subaccount_cf_org
})
Expand Down Expand Up @@ -204,11 +204,12 @@ resource "local_file" "output_vars_step1" {
cf_org_id = "${jsondecode(btp_subaccount_environment_instance.cloudfoundry.labels)["Org ID"]}"
origin = "${var.origin}"
cf_space_name = "${var.cf_space_name}"
cf_org_admins = ${jsonencode(var.cf_org_admins)}
cf_org_users = ${jsonencode(var.cf_org_users)}
cf_org_admins = ${jsonencode(var.cf_org_admins)}
cf_space_developers = ${jsonencode(var.cf_space_developers)}
cf_space_managers = ${jsonencode(var.cf_space_managers)}
event_mesh_url = "${btp_subaccount_subscription.event_mesh_application.subscription_url}"
hana_tools_url = "${btp_subaccount_subscription.hana_cloud_tools.subscription_url}"
EOT
filename = "../step2/terraform.tfvars"
}
48 changes: 39 additions & 9 deletions released/discovery_center/mission_3680/step1/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ output "cf_api_url" {
description = "The Cloudfoundry API endpoint."
}

output "cf_landscape_label" {
value = terraform_data.replacement.output
description = "The Cloudfoundry landscape label."
}

output "cf_org_id" {
value = jsondecode(btp_subaccount_environment_instance.cloudfoundry.labels)["Org ID"]
description = "The Cloudfoundry org id."
Expand All @@ -23,7 +18,42 @@ output "event_mesh_url" {
description = "Event Mesh URL"
}

# output "hana_tools_url" {
# value = btp_subaccount_subscription.hana_cloud_tools.subscription_url
# description = "HANA Tools URL"
# }
output "hana_tools_url" {
value = btp_subaccount_subscription.hana_cloud_tools.subscription_url
description = "HANA Tools URL"
}

output "cf_org_name" {
value = jsondecode(btp_subaccount_environment_instance.cloudfoundry.labels)["Org Name"]
description = "The Cloudfoundry org name."
}

output "cf_org_admins" {
value = var.cf_org_admins
description = "The Cloudfoundry org admins."
}

output "cf_org_users" {
value = var.cf_org_users
description = "The Cloudfoundry org users."
}

output "cf_space_developers" {
value = var.cf_space_developers
description = "The Cloudfoundry space developers."
}

output "cf_space_managers" {
value = var.cf_space_managers
description = "The Cloudfoundry space managers."
}

output "cf_space_name" {
value = var.cf_space_name
description = "The Cloudfoundry space name."
}

output "origin" {
value = var.origin
description = "The origin of the identity provider."
}
4 changes: 4 additions & 0 deletions released/discovery_center/mission_3680/step1/samples.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ cf_org_admins = ["another.user@test.com"]
cf_org_users = ["another.user@test.com"]
cf_space_managers = ["another.user@test.com", "you@test.com"]
cf_space_developers = ["another.user@test.com", "you@test.com"]

# Event Mesh users
event_mesh_admins = ["another.user@test.com", "you@test.com"]
event_mesh_developers = ["another.user@test.com", "you@test.com"]