diff --git a/released/discovery_center/mission_3061/step1/outputs.tf b/released/discovery_center/mission_3061/step1/outputs.tf index 04ba074d..a093a1e8 100644 --- a/released/discovery_center/mission_3061/step1/outputs.tf +++ b/released/discovery_center/mission_3061/step1/outputs.tf @@ -8,17 +8,17 @@ output "subaccount_name" { description = "The name of the subaccount." } -output "cloudfoundry_org_name" { +output "cf_org_name" { value = local.subaccount_cf_org description = "The name of the Cloud Foundry org connected to the subaccount." } -output "cloudfoundry_org_id" { +output "cf_org_id" { value = btp_subaccount_environment_instance.cf_abap.platform_id description = "The ID of the Cloud Foundry org connected to the subaccount." } -output "cloudfoundry_api_url" { +output "cf_api_url" { value = lookup(jsondecode(btp_subaccount_environment_instance.cf_abap.labels), "API Endpoint", "not found") description = "API endpoint of the Cloud Foundry environment." } diff --git a/released/discovery_center/mission_3061/step1/variables.tf b/released/discovery_center/mission_3061/step1/variables.tf index 19c60a16..a936c871 100644 --- a/released/discovery_center/mission_3061/step1/variables.tf +++ b/released/discovery_center/mission_3061/step1/variables.tf @@ -29,6 +29,11 @@ variable "cf_landscape_label" { variable "abap_sid" { type = string description = "The system ID (SID) of the ABAP system." + + validation { + condition = regex("^[A-Z][A-Z0-9]{2}$", var.abap_sid) + error_message = "Please provide a valid system ID (SID). It must consist of exactly three alphanumeric characters. Only uppercase letters are allowed. The first character must be a letter (not a digit). The ID does not have to be technically unique." + } } variable "abap_si_plan" { diff --git a/released/discovery_center/mission_3061/step2/main.tf b/released/discovery_center/mission_3061/step2/main.tf index ad2fabc1..d22fee12 100644 --- a/released/discovery_center/mission_3061/step2/main.tf +++ b/released/discovery_center/mission_3061/step2/main.tf @@ -12,7 +12,7 @@ resource "cloudfoundry_org_role" "org_managers" { for_each = toset("${var.cf_org_managers}") username = each.value type = "organization_manager" - org = var.cloudfoundry_org_id + org = var.cf_org_id origin = var.origin } @@ -21,7 +21,7 @@ resource "cloudfoundry_org_role" "billing_managers" { for_each = toset("${var.cf_org_billing_managers}") username = each.value type = "organization_billing_manager" - org = var.cloudfoundry_org_id + org = var.cf_org_id origin = var.origin } @@ -29,7 +29,7 @@ resource "cloudfoundry_org_role" "org_auditors" { for_each = toset("${var.cf_org_auditors}") username = each.value type = "organization_auditor" - org = var.cloudfoundry_org_id + org = var.cf_org_id origin = var.origin } @@ -39,7 +39,7 @@ resource "cloudfoundry_org_role" "org_auditors" { ### resource "cloudfoundry_space" "abap_space" { name = var.cf_space_name - org = var.cloudfoundry_org_id + org = var.cf_org_id } ### diff --git a/released/discovery_center/mission_3061/step2/provider.tf b/released/discovery_center/mission_3061/step2/provider.tf index e4dbc940..70b91d16 100644 --- a/released/discovery_center/mission_3061/step2/provider.tf +++ b/released/discovery_center/mission_3061/step2/provider.tf @@ -9,5 +9,5 @@ terraform { # This will only work if we know the region in advance provider "cloudfoundry" { - api_url = var.cloudfoundry_api_url + api_url = var.cf_api_url } diff --git a/released/discovery_center/mission_3061/step2/variables.tf b/released/discovery_center/mission_3061/step2/variables.tf index f494c88a..4744918f 100644 --- a/released/discovery_center/mission_3061/step2/variables.tf +++ b/released/discovery_center/mission_3061/step2/variables.tf @@ -1,10 +1,10 @@ -variable "cloudfoundry_api_url" { +variable "cf_api_url" { type = string description = "The API endpoint of the Cloud Foundry environment." } -variable "cloudfoundry_org_id" { +variable "cf_org_id" { type = string description = "The Cloud Foundry landscape (format example eu10-004)." } @@ -60,6 +60,11 @@ variable "cf_space_auditors" { variable "abap_sid" { type = string description = "The system ID (SID) of the ABAP system." + + validation { + condition = regex("^[A-Z][A-Z0-9]{2}$", var.abap_sid) + error_message = "Please provide a valid system ID (SID). It must consist of exactly three alphanumeric characters. Only uppercase letters are allowed. The first character must be a letter (not a digit). The ID does not have to be technically unique." + } } variable "abap_si_plan" {