Skip to content

feat: refinement of setup #203

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 1 commit into from
Jun 25, 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
8 changes: 4 additions & 4 deletions released/usecases/subaccount_setup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

###
Expand Down
8 changes: 4 additions & 4 deletions released/usecases/subaccount_setup/outputs.tf
Original file line number Diff line number Diff line change
@@ -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."
}
3 changes: 1 addition & 2 deletions released/usecases/subaccount_setup/provider.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

terraform {
required_providers {
btp = {
Expand All @@ -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 = "<YOUR GLOBALACCOUNT SUBDOMAIN>"
globalaccount = var.globalaccount
}

provider "cloudfoundry" {
Expand Down
49 changes: 28 additions & 21 deletions released/usecases/subaccount_setup/variables.tf
Original file line number Diff line number Diff line change
@@ -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."
Expand All @@ -11,6 +22,7 @@ variable "subaccount_name" {
error_message = "Provide a valid project account name."
}
}

###
# CloudFoundry Org Setup
variable "cf_org_name" {
Expand All @@ -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"
}