Skip to content

Commit 67c016b

Browse files
committed
subaccount setup
1 parent f666996 commit 67c016b

File tree

11 files changed

+89
-139
lines changed

11 files changed

+89
-139
lines changed
-7.74 KB
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Setup of a Subaccount
2+
3+
Basic setup of a subaccount. Every subaccount is created seperately
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module "subaccount_namings" {
2+
source = "../sap-btp-naming-conventions-subaccount"
3+
business_unit = var.business_unit
4+
costcenter = var.costcenter
5+
stage = var.stage
6+
subaccount_contacts = var.subaccount_contacts
7+
}
8+
9+
resource "btp_subaccount" "self" {
10+
parent_id = var.parent_id
11+
name = module.subaccount_namings.subaccount_name
12+
subdomain = module.subaccount_namings.subaccount_subdomain
13+
region = var.subaccount_region
14+
description = module.subaccount_namings.subaccount_description
15+
usage = module.subaccount_namings.subaccount_usage
16+
labels = module.subaccount_namings.subaccount_labels
17+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
output "subaccount_id" {
2+
value = btp_subaccount.self.id
3+
description = "Technical ID of the subaccount"
4+
}
5+
6+
output "subaccount_name" {
7+
value = btp_subaccount.self.name
8+
description = "The name of the subaccount"
9+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
terraform {
2+
required_providers {
3+
btp = {
4+
source = "SAP/btp"
5+
version = "~>1.11.0"
6+
}
7+
}
8+
}
9+
10+
# Configure the BTP Provider
11+
provider "btp" {
12+
globalaccount = var.globalaccount
13+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
variable "globalaccount" {
2+
type = string
3+
description = "The subdomain of the global account on SAP BTP"
4+
}
5+
6+
variable "business_unit" {
7+
type = string
8+
description = "Business unit of the project e.g., HR, IT or Sales"
9+
}
10+
11+
variable "subaccount_region" {
12+
type = string
13+
description = "Region of the subaccount."
14+
}
15+
16+
variable "costcenter" {
17+
type = string
18+
description = "Cost center to be used for subaccounts"
19+
}
20+
21+
variable "company_name" {
22+
type = string
23+
description = <<-EOT
24+
Company name to be used for subaccount subdomains. The parameter is optional
25+
Default value: `null`.
26+
EOT
27+
default = null
28+
}
29+
30+
variable "stage" {
31+
type = string
32+
description = <<-EOT
33+
Stage of the environment to be setup up.
34+
Possible values: `Dev`, `Test`, `Prod`, `Shared`.
35+
EOT
36+
}
37+
38+
variable "subaccount_contacts" {
39+
type = list(string)
40+
description = "Contact persons to be used for subaccount, added as label"
41+
}
42+
43+
variable "parent_id" {
44+
type = string
45+
description = "ID of the parent directory"
46+
default = null
47+
}

sample-setup/modules/base-subaccount-setup/README.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

sample-setup/modules/base-subaccount-setup/main.tf

Lines changed: 0 additions & 18 deletions
This file was deleted.

sample-setup/modules/base-subaccount-setup/outputs.tf

Lines changed: 0 additions & 24 deletions
This file was deleted.

sample-setup/modules/base-subaccount-setup/variables.tf

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)