From ed5ec58bfe6aa38e14ac2732a02ed83627ff0dde Mon Sep 17 00:00:00 2001 From: Markus Balsam Date: Wed, 3 Jul 2024 11:51:22 +0200 Subject: [PATCH 1/2] Revert "Mission 3585 qas (#230)" This reverts commit 4cd5e4b20e2ef55e60beb685b038cb61cc020e9a. --- .../mission_3585/{step1 => }/README.md | 29 +++++----- .../mission_3585/{step1 => }/main.tf | 35 +---------- .../mission_3585/{step1 => }/outputs.tf | 12 ++-- .../mission_3585/{step1 => }/provider.tf | 3 - .../mission_3585/{step1 => }/sample.tfvars | 3 - .../mission_3585/step2/README.md | 58 ------------------- .../mission_3585/step2/main.tf | 32 ---------- .../mission_3585/step2/provider.tf | 15 ----- .../mission_3585/step2/sample.tfvars | 8 --- .../mission_3585/step2/variables.tf | 34 ----------- .../mission_3585/{step1 => }/variables.tf | 46 +++++---------- 11 files changed, 33 insertions(+), 242 deletions(-) rename released/discovery_center/mission_3585/{step1 => }/README.md (59%) rename released/discovery_center/mission_3585/{step1 => }/main.tf (86%) rename released/discovery_center/mission_3585/{step1 => }/outputs.tf (85%) rename released/discovery_center/mission_3585/{step1 => }/provider.tf (51%) rename released/discovery_center/mission_3585/{step1 => }/sample.tfvars (92%) delete mode 100644 released/discovery_center/mission_3585/step2/README.md delete mode 100644 released/discovery_center/mission_3585/step2/main.tf delete mode 100644 released/discovery_center/mission_3585/step2/provider.tf delete mode 100644 released/discovery_center/mission_3585/step2/sample.tfvars delete mode 100644 released/discovery_center/mission_3585/step2/variables.tf rename released/discovery_center/mission_3585/{step1 => }/variables.tf (83%) diff --git a/released/discovery_center/mission_3585/step1/README.md b/released/discovery_center/mission_3585/README.md similarity index 59% rename from released/discovery_center/mission_3585/step1/README.md rename to released/discovery_center/mission_3585/README.md index 844811d7..59551b0c 100644 --- a/released/discovery_center/mission_3585/step1/README.md +++ b/released/discovery_center/mission_3585/README.md @@ -1,8 +1,8 @@ -# Discovery Center mission - Get Started on SAP BTP with SAPUI5/Fiori - Create a Hello World App (Step 1) +# Discovery Center mission - Get Started on SAP BTP with SAPUI5/Fiori - Create a Hello World App ## Overview -Step 1 of this sample shows how to set up your SAP BTP account for the Discovery Center Mission - [Get Started on SAP BTP with SAPUI5/Fiori - Create a Hello World App](https://discovery-center.cloud.sap/missiondetail/3585/) +This sample shows how to set up your SAP BTP account for the Discovery Center Mission - [Get Started on SAP BTP with SAPUI5/Fiori - Create a Hello World App](https://discovery-center.cloud.sap/missiondetail/3585/) ## Content of setup @@ -23,20 +23,25 @@ Make sure that you are familiar with SAP BTP and know both the [Get Started with To deploy the resources you must: -1. Set the environment variables BTP_USERNAME and BTP_PASSWORD to pass credentials to the BTP provider to authenticate and interact with your BTP environments. +1. Create a file `secret.auto.tfvars` and maintain the credentials for the BTP provider + ```hcl + user_email = "" + password = "" + ``` + as an alternative you can set these credentials also as environment variables + ```bash - export BTP_USERNAME= - export BTP_PASSWORD= + export user_email ='' + export password ='' ``` -2. Change the variables in the `sample.tfvars` file to meet your requirements +3. Change the variables in the `sample.tfvars` file to meet your requirements - > The minimal set of parameters you should specify (besides user email and password) is global account (i.e. its subdomain) and the used custom_idp and all user assignments + > The minimal set of parameters you should specify (besides user_email and password) is global account (i.e. its subdomain) and the used custom_idp and all user assignments > ⚠ NOTE: You should pay attention **specifically** to the users defined in the samples.tfvars whether they already exist in your SAP BTP accounts. Otherwise, you might get error messages like, e.g., `Error: The user could not be found: jane.doe@test.com`. -3. The outputs of this `step1` will be needed for the `step2` of this use case. In case you want to create a file with the content of the variables, you should set the variable `create_tfvars_file_for_next_step` to `true`. This will create a `terraform.tfvars` file in the `step2` folder. 4. Initialize your workspace: @@ -55,11 +60,3 @@ To deploy the resources you must: ```bash terraform apply -var-file="sample.tfvars" ``` - -## When finished - -You probably want to remove the assets after trying them out to avoid unnecessary costs. To do so execute the following command: - -```bash -terraform destroy -var-file="sample.tfvars" -``` diff --git a/released/discovery_center/mission_3585/step1/main.tf b/released/discovery_center/mission_3585/main.tf similarity index 86% rename from released/discovery_center/mission_3585/step1/main.tf rename to released/discovery_center/mission_3585/main.tf index 3fe5e731..e9ad399e 100644 --- a/released/discovery_center/mission_3585/step1/main.tf +++ b/released/discovery_center/mission_3585/main.tf @@ -27,7 +27,7 @@ data "btp_subaccount_environments" "all" { # (this replaces the previous null_resource) # ------------------------------------------------------------------------------------------------------ resource "terraform_data" "replacement" { - 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 + input = length(var.cf_environment_label) > 0 ? var.cf_environment_label : [for env in data.btp_subaccount_environments.all.values : env if env.service_name == "cloudfoundry" && env.environment_type == "cloudfoundry"][0].landscape_label } # ------------------------------------------------------------------------------------------------------ # Create the Cloud Foundry environment instance @@ -45,18 +45,6 @@ resource "btp_subaccount_environment_instance" "cf" { }) } -############################################################################################### -# Prepare CF -############################################################################################### -# Entitle subaccount for usage of cf runtime - -resource "btp_subaccount_entitlement" "cf_runtime" { - subaccount_id = btp_subaccount.dc_mission.id - service_name = "APPLICATION_RUNTIME" - plan_name = "MEMORY" - amount = 1 -} - # ------------------------------------------------------------------------------------------------------ # SERVICES # ------------------------------------------------------------------------------------------------------ @@ -218,24 +206,3 @@ resource "btp_subaccount_role_collection_assignment" "cicd_developers" { user_name = each.value depends_on = [btp_subaccount_subscription.cicd_app] } - - -# ------------------------------------------------------------------------------------------------------ -# Create tfvars file for step 2 (if variable `create_tfvars_file_for_step2` is set to true) -# ------------------------------------------------------------------------------------------------------ -resource "local_file" "output_vars_step1" { - count = var.create_tfvars_file_for_next_step ? 1 : 0 - content = <<-EOT - cf_api_url = "${jsondecode(btp_subaccount_environment_instance.cf.labels)["API Endpoint"]}" - - cf_org_id = "${jsondecode(btp_subaccount_environment_instance.cf.labels)["Org ID"]}" - - cf_origin = "${var.cf_origin}" - - cf_space_name = "${var.cf_space_name}" - - cf_org_admins = ${jsonencode(var.cf_org_admins)} - - EOT - filename = "../step2/terraform.tfvars" -} diff --git a/released/discovery_center/mission_3585/step1/outputs.tf b/released/discovery_center/mission_3585/outputs.tf similarity index 85% rename from released/discovery_center/mission_3585/step1/outputs.tf rename to released/discovery_center/mission_3585/outputs.tf index db09ecc8..a70a5402 100644 --- a/released/discovery_center/mission_3585/step1/outputs.tf +++ b/released/discovery_center/mission_3585/outputs.tf @@ -3,21 +3,21 @@ output "globalaccount" { description = "The Global Account subdomain." } +output "cli_server_url" { + value = var.cli_server_url + description = "The BTP CLI server URL." +} + output "subaccount_id" { value = btp_subaccount.dc_mission.id description = "The Global Account subdomain id." } -output "cf_api_url" { +output "cf_api_endpoint" { value = jsondecode(btp_subaccount_environment_instance.cf.labels)["API Endpoint"] 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.cf.labels)["Org ID"] description = "The Cloudfoundry org id." diff --git a/released/discovery_center/mission_3585/step1/provider.tf b/released/discovery_center/mission_3585/provider.tf similarity index 51% rename from released/discovery_center/mission_3585/step1/provider.tf rename to released/discovery_center/mission_3585/provider.tf index 27f11abc..7ceab97d 100644 --- a/released/discovery_center/mission_3585/step1/provider.tf +++ b/released/discovery_center/mission_3585/provider.tf @@ -8,9 +8,6 @@ terraform { } provider "btp" { - # Comment out the idp in case you need it to connect to your global account - # ------------------------------------------------------------------------- - # idp = var.custom_idp globalaccount = var.globalaccount cli_server_url = var.cli_server_url } diff --git a/released/discovery_center/mission_3585/step1/sample.tfvars b/released/discovery_center/mission_3585/sample.tfvars similarity index 92% rename from released/discovery_center/mission_3585/step1/sample.tfvars rename to released/discovery_center/mission_3585/sample.tfvars index accda4a8..a643f540 100644 --- a/released/discovery_center/mission_3585/step1/sample.tfvars +++ b/released/discovery_center/mission_3585/sample.tfvars @@ -26,6 +26,3 @@ cicd_developers = ["another.user@test.com", "you@test.com"] bas_admins = ["another.user@test.com", "you@test.com"] bas_developers = ["another.user@test.com", "you@test.com"] - -# Create variables file for step 2 (disabled by default) -create_tfvars_file_for_next_step = true diff --git a/released/discovery_center/mission_3585/step2/README.md b/released/discovery_center/mission_3585/step2/README.md deleted file mode 100644 index cf5a0467..00000000 --- a/released/discovery_center/mission_3585/step2/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# Discovery Center mission - Get Started on SAP BTP with SAPUI5/Fiori - Create a Hello World App (Step 2) - -## Overview - -Step 2 of this sample shows how to Cloud Foundry environment for the Discovery Center Mission - [Get Started on SAP BTP with SAPUI5/Fiori - Create a Hello World App](https://discovery-center.cloud.sap/missiondetail/3585/) - -## Content of setup - -This setup step comprises the following resources: - -- Creation of a Cloud Foundry space -- Cloud Foundry role assignments to users - -## Deploying the resources - -Make sure that you are familiar with SAP BTP and know both the [Get Started with btp-terraform-samples](https://github.com/SAP-samples/btp-terraform-samples/blob/main/GET_STARTED.md) and the [Get Started with the Terraform Provider for BTP](https://developers.sap.com/tutorials/btp-terraform-get-started.html) - -To deploy the resources you must: - -1. Set the environment variables CF_USER and CF_PASSWORD to pass credentials to the Cloud Foundry provider to authenticate and interact with your Cloud Foundry environment instance. - - ```bash - export CF_USER= - export CF_PASSWORD= - ``` - -2. Change the variables in the `sample.tfvars` file to meet your requirements - - > The minimal set of parameters you should specify (besides user_email and password) is Cloud Foundry API URL and all Cloud Foundry user assignments - - > ⚠ NOTE: You should pay attention **specifically** to the users defined in the samples.tfvars whether they already exist in your SAP BTP accounts. Otherwise, you might get error messages like, e.g., `Error: The user could not be found: jane.doe@test.com`. - - -3. Initialize your workspace: - - ```bash - terraform init - ``` - -4. You can check what Terraform plans to apply based on your configuration: - - ```bash - terraform plan -var-file="sample.tfvars" - ``` - -5. Apply your configuration to provision the resources: - - ```bash - terraform apply -var-file="sample.tfvars" - ``` - -## When finished - -You probably want to remove the assets after trying them out to avoid unnecessary costs. To do so execute the following command: - -```bash -terraform destroy -var-file="sample.tfvars" -``` diff --git a/released/discovery_center/mission_3585/step2/main.tf b/released/discovery_center/mission_3585/step2/main.tf deleted file mode 100644 index 843b7207..00000000 --- a/released/discovery_center/mission_3585/step2/main.tf +++ /dev/null @@ -1,32 +0,0 @@ -# ------------------------------------------------------------------------------------------------------ -# Create the Cloud Foundry space -# ------------------------------------------------------------------------------------------------------ -resource "cloudfoundry_space" "space" { - name = var.cf_space_name - org = var.cf_org_id -} - -# ------------------------------------------------------------------------------------------------------ -# USERS AND ROLES -# ------------------------------------------------------------------------------------------------------ -# -# ------------------------------------------------------------------------------------------------------ -# Assign CF Org roles to the admin users -# ------------------------------------------------------------------------------------------------------ -# Define Org User role -resource "cloudfoundry_org_role" "organization_user" { - for_each = toset("${var.cf_org_admins}") - username = each.value - type = "organization_user" - org = var.cf_org_id - origin = var.cf_origin -} -# Define Org Manager role -resource "cloudfoundry_org_role" "organization_manager" { - for_each = toset("${var.cf_org_admins}") - username = each.value - type = "organization_manager" - org = var.cf_org_id - origin = var.cf_origin - depends_on = [cloudfoundry_org_role.organization_user] -} diff --git a/released/discovery_center/mission_3585/step2/provider.tf b/released/discovery_center/mission_3585/step2/provider.tf deleted file mode 100644 index 554e0843..00000000 --- a/released/discovery_center/mission_3585/step2/provider.tf +++ /dev/null @@ -1,15 +0,0 @@ -### -# Define the required providers for this module -### -terraform { - required_providers { - cloudfoundry = { - source = "SAP/cloudfoundry" - version = "0.2.1-beta" - } - } -} - -provider "cloudfoundry" { - api_url = var.cf_api_url -} diff --git a/released/discovery_center/mission_3585/step2/sample.tfvars b/released/discovery_center/mission_3585/step2/sample.tfvars deleted file mode 100644 index e6ae97e4..00000000 --- a/released/discovery_center/mission_3585/step2/sample.tfvars +++ /dev/null @@ -1,8 +0,0 @@ -# ------------------------------------------------------------------------------------------------------ -# Provider configuration (this file will be either created automatically in step 1 or manually in step 2) -# ------------------------------------------------------------------------------------------------------ -cf_origin = "sap.ids" -cf_api_url = "https://api.cf.us10.hana.ondemand.com" -cf_org_id = "your_cf_org_id" -cf_space_name = "dev" -cf_org_admins = ["another.user@test.com"] diff --git a/released/discovery_center/mission_3585/step2/variables.tf b/released/discovery_center/mission_3585/step2/variables.tf deleted file mode 100644 index 7f08b545..00000000 --- a/released/discovery_center/mission_3585/step2/variables.tf +++ /dev/null @@ -1,34 +0,0 @@ -variable "cf_api_url" { - type = string - description = "The API URL of the Cloud Foundry environment instance." -} - -variable "cf_org_admins" { - type = list(string) - description = "List of users to set as Cloudfoundry org administrators." - - # add validation to check if admins contains a list of valid email addresses - validation { - condition = length([for email in var.cf_org_admins : can(regex("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", email))]) == length(var.cf_org_admins) - error_message = "Please enter a valid email address for the CF Org admins." - } -} - -variable "cf_org_id" { - type = string - description = "The Cloud Foundry Org ID to use." -} - -variable "cf_origin" { - type = string - description = "Defines the origin key of the identity provider" - default = "sap.ids" - # The value for the cf_origin can be defined - # but are normally set to "sap.ids", "sap.default" or "sap.custom" -} - -variable "cf_space_name" { - type = string - description = "The Cloud Foundry Space name to use." - default = "dev" -} diff --git a/released/discovery_center/mission_3585/step1/variables.tf b/released/discovery_center/mission_3585/variables.tf similarity index 83% rename from released/discovery_center/mission_3585/step1/variables.tf rename to released/discovery_center/mission_3585/variables.tf index 83a00076..f50c334a 100644 --- a/released/discovery_center/mission_3585/step1/variables.tf +++ b/released/discovery_center/mission_3585/variables.tf @@ -32,6 +32,17 @@ variable "subaccount_admins" { } } +variable "cf_org_admins" { + type = list(string) + description = "List of users to set as Cloudfoundry org administrators." + + # add validation to check if admins contains a list of valid email addresses + validation { + condition = length([for email in var.cf_org_admins : can(regex("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", email))]) == length(var.cf_org_admins) + error_message = "Please enter a valid email address for the CF Org admins." + } +} + variable "launchpad_admins" { type = list(string) description = "Defines the colleagues who are Launchpad Admins." @@ -87,45 +98,14 @@ variable "cicd_admins" { } } -variable "cf_org_admins" { - type = list(string) - description = "List of users to set as Cloudfoundry org administrators." - - # add validation to check if admins contains a list of valid email addresses - validation { - condition = length([for email in var.cf_org_admins : can(regex("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", email))]) == length(var.cf_org_admins) - error_message = "Please enter a valid email address for the CF Org admins." - } -} - -variable "cf_origin" { +variable "cf_environment_label" { type = string - description = "Defines the origin key of the identity provider" - default = "sap.ids" - # The value for the cf_origin can be defined - # but are normally set to "sap.ids", "sap.default" or "sap.custom" -} - -variable "cf_landscape_label" { - type = string - description = "In case there are multiple landscapes available for a subaccount, you can use this label to choose with which one you want to go. If nothing is given, we take by default the first available." + description = "In case there are multiple environments available for a subaccount, you can use this label to choose with which one you want to go. If nothing is given, we take by default the first available." default = "" } -variable "cf_space_name" { - type = string - description = "The Cloud Foundry space name to use" - default = "dev" -} - variable "custom_idp" { type = string description = "The custom identity provider for the subaccount." default = "sap.ids" } - -variable "create_tfvars_file_for_next_step" { - type = bool - description = "Switch to enable the creation of the tfvars file for step 2." - default = false -} From edb021040da0b32c208b4eb9faaf904f38e7bb18 Mon Sep 17 00:00:00 2001 From: Markus Balsam Date: Wed, 3 Jul 2024 15:06:56 +0200 Subject: [PATCH 2/2] removing cf for mission 3585 --- .../discovery_center/mission_3585/README.md | 26 +++++++------ .../discovery_center/mission_3585/main.tf | 38 ++----------------- .../discovery_center/mission_3585/outputs.tf | 38 +++++-------------- .../discovery_center/mission_3585/provider.tf | 3 ++ .../mission_3585/sample.tfvars | 1 - .../mission_3585/variables.tf | 17 --------- .../discovery_center/mission_4024/outputs.tf | 2 +- 7 files changed, 30 insertions(+), 95 deletions(-) diff --git a/released/discovery_center/mission_3585/README.md b/released/discovery_center/mission_3585/README.md index 59551b0c..66120e3d 100644 --- a/released/discovery_center/mission_3585/README.md +++ b/released/discovery_center/mission_3585/README.md @@ -23,33 +23,27 @@ Make sure that you are familiar with SAP BTP and know both the [Get Started with To deploy the resources you must: -1. Create a file `secret.auto.tfvars` and maintain the credentials for the BTP provider +1. Set the environment variables BTP_USERNAME and BTP_PASSWORD to pass credentials to the BTP provider to authenticate and interact with your BTP environments. - ```hcl - user_email = "" - password = "" - ``` - as an alternative you can set these credentials also as environment variables - ```bash - export user_email ='' - export password ='' + export BTP_USERNAME= + export BTP_PASSWORD= ``` -3. Change the variables in the `sample.tfvars` file to meet your requirements +2. Change the variables in the `sample.tfvars` file to meet your requirements > The minimal set of parameters you should specify (besides user_email and password) is global account (i.e. its subdomain) and the used custom_idp and all user assignments > ⚠ NOTE: You should pay attention **specifically** to the users defined in the samples.tfvars whether they already exist in your SAP BTP accounts. Otherwise, you might get error messages like, e.g., `Error: The user could not be found: jane.doe@test.com`. -4. Initialize your workspace: +3. Initialize your workspace: ```bash terraform init ``` -5. You can check what Terraform plans to apply based on your configuration: +4. You can check what Terraform plans to apply based on your configuration: ```bash terraform plan -var-file="sample.tfvars" @@ -60,3 +54,11 @@ To deploy the resources you must: ```bash terraform apply -var-file="sample.tfvars" ``` + +## When finished + +You probably want to remove the assets after trying them out to avoid unnecessary costs. To do so execute the following command: + +```bash +terraform destroy -var-file="sample.tfvars" +``` diff --git a/released/discovery_center/mission_3585/main.tf b/released/discovery_center/mission_3585/main.tf index e9ad399e..dafdd428 100644 --- a/released/discovery_center/mission_3585/main.tf +++ b/released/discovery_center/mission_3585/main.tf @@ -2,49 +2,17 @@ # Subaccount setup for DC mission 3585 # ------------------------------------------------------------------------------------------------------ # Setup subaccount domain (to ensure uniqueness in BTP global account) -resource "random_id" "subaccount_domain_suffix" { - byte_length = 12 -} +resource "random_uuid" "uuid" {} + # ------------------------------------------------------------------------------------------------------ # Creation of subaccount # ------------------------------------------------------------------------------------------------------ resource "btp_subaccount" "dc_mission" { name = var.subaccount_name - subdomain = join("-", ["dc-mission-3585", random_id.subaccount_domain_suffix.hex]) + subdomain = join("-", ["dc-mission-3585", random_uuid.uuid.result]) region = lower(var.region) } -# ------------------------------------------------------------------------------------------------------ -# CLOUDFOUNDRY PREPARATION -# ------------------------------------------------------------------------------------------------------ -# -# Fetch all available environments for the subaccount -data "btp_subaccount_environments" "all" { - subaccount_id = btp_subaccount.dc_mission.id -} -# ------------------------------------------------------------------------------------------------------ -# 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" { - input = length(var.cf_environment_label) > 0 ? var.cf_environment_label : [for env in data.btp_subaccount_environments.all.values : env if env.service_name == "cloudfoundry" && env.environment_type == "cloudfoundry"][0].landscape_label -} -# ------------------------------------------------------------------------------------------------------ -# Create the Cloud Foundry environment instance -# ------------------------------------------------------------------------------------------------------ -resource "btp_subaccount_environment_instance" "cf" { - subaccount_id = btp_subaccount.dc_mission.id - name = "cf-${random_id.subaccount_domain_suffix.hex}" - environment_type = "cloudfoundry" - service_name = "cloudfoundry" - plan_name = "standard" - landscape_label = terraform_data.replacement.output - - parameters = jsonencode({ - instance_name = "cf-${random_id.subaccount_domain_suffix.hex}" - }) -} - # ------------------------------------------------------------------------------------------------------ # SERVICES # ------------------------------------------------------------------------------------------------------ diff --git a/released/discovery_center/mission_3585/outputs.tf b/released/discovery_center/mission_3585/outputs.tf index a70a5402..1d4e2ec8 100644 --- a/released/discovery_center/mission_3585/outputs.tf +++ b/released/discovery_center/mission_3585/outputs.tf @@ -1,39 +1,19 @@ -output "globalaccount" { - value = var.globalaccount - description = "The Global Account subdomain." -} - -output "cli_server_url" { - value = var.cli_server_url - description = "The BTP CLI server URL." -} - output "subaccount_id" { value = btp_subaccount.dc_mission.id description = "The Global Account subdomain id." } -output "cf_api_endpoint" { - value = jsondecode(btp_subaccount_environment_instance.cf.labels)["API Endpoint"] - description = "The Cloudfoundry API endpoint." -} - -output "cf_org_id" { - value = jsondecode(btp_subaccount_environment_instance.cf.labels)["Org ID"] - description = "The Cloudfoundry org id." -} - -output "cf_org_name" { - value = jsondecode(btp_subaccount_environment_instance.cf.labels)["Org Name"] - description = "The Cloudfoundry org name." +output "cicd_app_subscription_url" { + value = btp_subaccount_subscription.cicd_app.subscription_url + description = "Continuous Integration & Delivery subscription URL." } -output "custom_idp" { - value = var.custom_idp - description = "The custom identity provider." +output "sapappstudio_subscription_url" { + value = btp_subaccount_subscription.sapappstudio.subscription_url + description = "SAP Business Application Studio subscription URL." } -output "cf_org_admins" { - value = var.cf_org_admins - description = "List of users to set as Cloudfoundry org administrators." +output "sap_launchpad_subscription_url" { + value = btp_subaccount_subscription.sap_launchpad.subscription_url + description = "SAP Build Work Zone, standard edition subscription URL." } diff --git a/released/discovery_center/mission_3585/provider.tf b/released/discovery_center/mission_3585/provider.tf index 7ceab97d..27f11abc 100644 --- a/released/discovery_center/mission_3585/provider.tf +++ b/released/discovery_center/mission_3585/provider.tf @@ -8,6 +8,9 @@ terraform { } provider "btp" { + # Comment out the idp in case you need it to connect to your global account + # ------------------------------------------------------------------------- + # idp = var.custom_idp globalaccount = var.globalaccount cli_server_url = var.cli_server_url } diff --git a/released/discovery_center/mission_3585/sample.tfvars b/released/discovery_center/mission_3585/sample.tfvars index a643f540..0f197faa 100644 --- a/released/discovery_center/mission_3585/sample.tfvars +++ b/released/discovery_center/mission_3585/sample.tfvars @@ -17,7 +17,6 @@ subaccount_name = "SAP Discovery Center Mission 3585" # USER ROLES # ------------------------------------------------------------------------------------------------------ subaccount_admins = ["another.user@test.com"] -cf_org_admins = ["another.user@test.com"] launchpad_admins = ["another.user@test.com", "you@test.com"] diff --git a/released/discovery_center/mission_3585/variables.tf b/released/discovery_center/mission_3585/variables.tf index f50c334a..fbd8bec0 100644 --- a/released/discovery_center/mission_3585/variables.tf +++ b/released/discovery_center/mission_3585/variables.tf @@ -32,17 +32,6 @@ variable "subaccount_admins" { } } -variable "cf_org_admins" { - type = list(string) - description = "List of users to set as Cloudfoundry org administrators." - - # add validation to check if admins contains a list of valid email addresses - validation { - condition = length([for email in var.cf_org_admins : can(regex("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", email))]) == length(var.cf_org_admins) - error_message = "Please enter a valid email address for the CF Org admins." - } -} - variable "launchpad_admins" { type = list(string) description = "Defines the colleagues who are Launchpad Admins." @@ -98,12 +87,6 @@ variable "cicd_admins" { } } -variable "cf_environment_label" { - type = string - description = "In case there are multiple environments available for a subaccount, you can use this label to choose with which one you want to go. If nothing is given, we take by default the first available." - default = "" -} - variable "custom_idp" { type = string description = "The custom identity provider for the subaccount." diff --git a/released/discovery_center/mission_4024/outputs.tf b/released/discovery_center/mission_4024/outputs.tf index e2d65408..ca33f69e 100644 --- a/released/discovery_center/mission_4024/outputs.tf +++ b/released/discovery_center/mission_4024/outputs.tf @@ -6,4 +6,4 @@ output "subaccount_id" { output "sap_build_apps_subscription_url" { value = btp_subaccount_subscription.sap-build-apps_standard.subscription_url description = "SAP Build Apps subscription URL." -} \ No newline at end of file +}