Skip to content

Commit 7232caf

Browse files
committed
subaccount
1 parent 67c016b commit 7232caf

File tree

3 files changed

+80
-1
lines changed

3 files changed

+80
-1
lines changed

sample-setup/basic-setup/subaccount-setup/.terraform.lock.hcl

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sample-setup/basic-setup/subaccount-setup/main.tf

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
1+
locals {
2+
valid_region_combination = {
3+
eu10 = "EMEA"
4+
eu11 = "EMEA"
5+
eu20 = "EMEA"
6+
eu30 = "EMEA"
7+
us10 = "AMER"
8+
us11 = "AMER"
9+
us20 = "AMER"
10+
us21 = "AMER"
11+
us30 = "AMER"
12+
ap10 = "APAC"
13+
ap11 = "APAC"
14+
ap12 = "APAC"
15+
ap20 = "APAC"
16+
ap12 = "APAC"
17+
ap30 = "APAC"
18+
}
19+
}
20+
21+
122
module "subaccount_namings" {
2-
source = "../sap-btp-naming-conventions-subaccount"
23+
source = "../../modules/sap-btp-naming-conventions-subaccount"
324
business_unit = var.business_unit
425
costcenter = var.costcenter
526
stage = var.stage

sample-setup/basic-setup/subaccount-setup/variables.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,23 @@ variable "business_unit" {
88
description = "Business unit of the project e.g., HR, IT or Sales"
99
}
1010

11+
variable "region" {
12+
type = string
13+
default = null
14+
description = <<-EOT
15+
The geographical region for a directory. The parameter is optional
16+
If you set it the possible values are: `EMEA`, `APAC`, `AMER`.
17+
Default value: `null`.
18+
EOT
19+
}
20+
1121
variable "subaccount_region" {
1222
type = string
1323
description = "Region of the subaccount."
24+
validation {
25+
condition = lookup(local.valid_region_combination, var.subaccount_region, "INVALID") == var.region
26+
error_message = "Please provide a fitting subaccount region for the region"
27+
}
1428
}
1529

1630
variable "costcenter" {

0 commit comments

Comments
 (0)