Skip to content

Commit be4c37b

Browse files
committed
DC Mission 3945 - Polished for QAS
1 parent 10cc19c commit be4c37b

File tree

5 files changed

+47
-34
lines changed

5 files changed

+47
-34
lines changed

released/discovery_center/mission_3945/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To deploy the resources you must:
2020
$env:BTP_PASSWORD=<your_password>
2121
```
2222

23-
2. Change the variables in the `samples.tfvars` file to meet your requirements
23+
2. Change the variables in the `sample.tfvars` file to meet your requirements
2424

2525
> ⚠ NOTE: You should pay attention **specifically** to the users defined in the samples.tfvars whether they already exist in your SAP BTP accounts. Otherwise you might get error messages like e.g. `Error: The user could not be found: [email protected]`.
2626

@@ -34,13 +34,13 @@ To deploy the resources you must:
3434
4. You can check what Terraform plans to apply based on your configuration:
3535

3636
```bash
37-
terraform plan -var-file="samples.tfvars"
37+
terraform plan -var-file="sample.tfvars"
3838
```
3939

4040
5. Apply your configuration to provision the resources:
4141

4242
```bash
43-
terraform apply -var-file="samples.tfvars"
43+
terraform apply -var-file="sample.tfvars"
4444
```
4545

4646
## In the end

released/discovery_center/mission_3945/locals.tf

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

released/discovery_center/mission_3945/main.tf

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ locals {
88
subaccount_domain = lower(replace("mission-3945-${local.random_uuid}", "_", "-"))
99
}
1010

11+
locals {
12+
service_name__sap_analytics_cloud = "analytics-planning-osb"
13+
}
14+
1115
# ------------------------------------------------------------------------------------------------------
1216
# Creation of subaccount
1317
# ------------------------------------------------------------------------------------------------------
@@ -33,6 +37,11 @@ resource "btp_subaccount_trust_configuration" "fully_customized" {
3337
identity_provider = var.custom_idp
3438
}
3539

40+
locals {
41+
custom_idp_tenant = var.custom_idp != "" ? element(split(".", var.custom_idp), 0) : ""
42+
origin_key = local.custom_idp_tenant != "" ? "${local.custom_idp_tenant}-platform" : "sap.default"
43+
origin_key_app_users = var.custom_idp != "" ? var.custom_idp_apps_origin_key : "sap.default"
44+
}
3645

3746
# ------------------------------------------------------------------------------------------------------
3847
# Assignment of users as sub account administrators
@@ -41,6 +50,7 @@ resource "btp_subaccount_role_collection_assignment" "subaccount-admins" {
4150
for_each = toset(var.subaccount_admins)
4251
subaccount_id = data.btp_subaccount.dc_mission.id
4352
role_collection_name = "Subaccount Administrator"
53+
origin = local.origin_key
4454
user_name = each.value
4555
}
4656

@@ -51,6 +61,7 @@ resource "btp_subaccount_role_collection_assignment" "subaccount-service-admins"
5161
for_each = toset(var.subaccount_service_admins)
5262
subaccount_id = data.btp_subaccount.dc_mission.id
5363
role_collection_name = "Subaccount Service Administrator"
64+
origin = local.origin_key
5465
user_name = each.value
5566
}
5667

@@ -71,26 +82,26 @@ data "btp_subaccount_service_plan" "sac" {
7182
depends_on = [btp_subaccount_entitlement.sac]
7283
}
7384

74-
# Create service instance
75-
resource "btp_subaccount_service_instance" "sac" {
76-
subaccount_id = data.btp_subaccount.dc_mission.id
77-
serviceplan_id = data.btp_subaccount_service_plan.sac.id
78-
name = "sac_instance"
79-
parameters = jsonencode(
80-
{
81-
"first_name" : "${var.sac_admin_first_name}",
82-
"last_name" : "${var.sac_admin_last_name}",
83-
"email" : "${var.sac_admin_email}",
84-
"confirm_email" : "${var.sac_admin_email}",
85-
"host_name" : "${var.sac_admin_host_name}",
86-
"number_of_business_intelligence_licenses" : var.sac_number_of_business_intelligence_licenses,
87-
"number_of_planning_professional_licenses" : var.sac_number_of_professional_licenses,
88-
"number_of_planning_standard_licenses" : var.sac_number_of_business_standard_licenses
89-
}
90-
)
91-
timeouts = {
92-
create = "90m"
93-
update = "90m"
94-
delete = "90m"
95-
}
96-
}
85+
# # Create service instance
86+
# resource "btp_subaccount_service_instance" "sac" {
87+
# subaccount_id = data.btp_subaccount.dc_mission.id
88+
# serviceplan_id = data.btp_subaccount_service_plan.sac.id
89+
# name = "sac_instance"
90+
# parameters = jsonencode(
91+
# {
92+
# "first_name" : "${var.sac_admin_first_name}",
93+
# "last_name" : "${var.sac_admin_last_name}",
94+
# "email" : "${var.sac_admin_email}",
95+
# "confirm_email" : "${var.sac_admin_email}",
96+
# "host_name" : "${var.sac_admin_host_name}",
97+
# "number_of_business_intelligence_licenses" : var.sac_number_of_business_intelligence_licenses,
98+
# "number_of_planning_professional_licenses" : var.sac_number_of_professional_licenses,
99+
# "number_of_planning_standard_licenses" : var.sac_number_of_business_standard_licenses
100+
# }
101+
# )
102+
# timeouts = {
103+
# create = "90m"
104+
# update = "90m"
105+
# delete = "90m"
106+
# }
107+
# }

released/discovery_center/mission_3945/sample.tfvars

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
# Provider configuration
33
# ------------------------------------------------------------------------------------------------------
44
# Your global account subdomain
5-
globalaccount = "youraccount"
6-
region = "us10"
7-
subaccount_name = "SAP Discovery Center Mission 3945"
8-
cf_environment_label = "cf-us10"
9-
cf_space_name = "dev"
5+
globalaccount = "youraccount"
6+
region = "us10"
7+
subaccount_name = "SAP Discovery Center Mission 3945"
8+
custom_idp = "<your-idp>.accounts.ondemand.com"
109

1110
# ------------------------------------------------------------------------------------------------------
1211
# Project specific configuration (please adapt!)

released/discovery_center/mission_3945/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ variable "custom_idp" {
4141
default = ""
4242
}
4343

44+
variable "custom_idp_apps_origin_key" {
45+
type = string
46+
description = "The custom identity provider for the subaccount."
47+
default = "sap.custom"
48+
}
49+
4450
variable "subaccount_admins" {
4551
type = list(string)
4652
description = "Defines the colleagues who are added to each subaccount as subaccount administrators."

0 commit comments

Comments
 (0)