diff --git a/released/usecases/subaccount_setup/main.tf b/released/usecases/subaccount_setup/main.tf index b4406a48..1c3a4270 100644 --- a/released/usecases/subaccount_setup/main.tf +++ b/released/usecases/subaccount_setup/main.tf @@ -25,10 +25,10 @@ module "cloudfoundry_environment" { subaccount_id = btp_subaccount.project.id instance_name = local.project_subaccount_cf_org cf_org_name = local.project_subaccount_cf_org - cf_org_user = [] - cf_org_managers = [] - cf_org_billing_managers = [] - cf_org_auditors = [] + cf_org_user = var.cf_org_user + cf_org_managers = var.cf_org_managers + cf_org_billing_managers = var.cf_org_billing_managers + cf_org_auditors = var.cf_org_auditors } ### diff --git a/released/usecases/subaccount_setup/outputs.tf b/released/usecases/subaccount_setup/outputs.tf index f8ff8dec..1cb132d5 100644 --- a/released/usecases/subaccount_setup/outputs.tf +++ b/released/usecases/subaccount_setup/outputs.tf @@ -1,19 +1,19 @@ output "subaccount_id" { value = btp_subaccount.project.id - description = "The ID of the project subaccount." + description = "The ID of the subaccount." } output "subaccount_name" { value = btp_subaccount.project.name - description = "The name of the project subaccount." + description = "The name of the subaccount." } output "cloudfoundry_org_name" { value = local.project_subaccount_cf_org - description = "The name of the cloudfoundry org connected to the project account." + description = "The name of the Cloud Foundry org connected to the project account." } output "cloudfoundry_org_id" { value = module.cloudfoundry_environment.cf_org_id - description = "The ID of the cloudfoundry org connected to the project account." + description = "The ID of the Cloud Foundry org connected to the project account." } \ No newline at end of file diff --git a/released/usecases/subaccount_setup/provider.tf b/released/usecases/subaccount_setup/provider.tf index 8e84519c..9730e169 100644 --- a/released/usecases/subaccount_setup/provider.tf +++ b/released/usecases/subaccount_setup/provider.tf @@ -1,4 +1,3 @@ - terraform { required_providers { btp = { @@ -16,7 +15,7 @@ terraform { # Please checkout documentation on how best to authenticate against SAP BTP # via the Terraform provider for SAP BTP provider "btp" { - globalaccount = "" + globalaccount = var.globalaccount } provider "cloudfoundry" { diff --git a/released/usecases/subaccount_setup/variables.tf b/released/usecases/subaccount_setup/variables.tf index 5aec6c41..2df324e4 100644 --- a/released/usecases/subaccount_setup/variables.tf +++ b/released/usecases/subaccount_setup/variables.tf @@ -1,6 +1,17 @@ ### -# Customer account setup +# BTP ACCOUNT ### +variable "globalaccount" { + type = string + description = "The global account subdomain." +} + +variable "region" { + type = string + description = "The region where the project account shall be created in." + default = "us10" +} + variable "subaccount_name" { type = string description = "The subaccount name." @@ -11,6 +22,7 @@ variable "subaccount_name" { error_message = "Provide a valid project account name." } } + ### # CloudFoundry Org Setup variable "cf_org_name" { @@ -31,42 +43,37 @@ variable "cf_org_name" { } } +variable "stage" { + type = string + description = "The stage/tier the account will be used for." + default = "DEV" + + validation { + condition = contains(["DEV", "TST", "PRD"], var.stage) + error_message = "Select a valid stage for the project account." + } +} + variable "cf_org_user" { type = set(string) description = "Defines the colleagues who are added to the Cloud Foundry organization as users." + default = [] } variable "cf_org_managers" { type = set(string) description = "Defines the colleagues who are added to the Cloud Foundry organization as org managers." + default = [] } variable "cf_org_billing_managers" { type = set(string) description = "Defines the colleagues who are added to the Cloud Foundry organization as org billing managers." + default = [] } variable "cf_org_auditors" { type = set(string) description = "Defines the colleagues who are added to the Cloud Foundry organization as org auditors." + default = [] } - -variable "stage" { - type = string - description = "The stage/tier the account will be used for." - default = "DEV" - - validation { - condition = contains(["DEV", "TST", "PRD"], var.stage) - error_message = "Select a valid stage for the project account." - } -} - -### -# BTP ACCOUNT -### -variable "region" { - type = string - description = "The region where the project account shall be created in." - default = "us10" -} \ No newline at end of file