Skip to content

Commit 81874d2

Browse files
authored
DC Mission 3348 - Polished for QAS (#320)
1 parent ee32aad commit 81874d2

File tree

7 files changed

+31
-13
lines changed

7 files changed

+31
-13
lines changed

released/discovery_center/mission_3348/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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_3348/locals.tf

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

released/discovery_center/mission_3348/main.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ locals {
88
subaccount_domain = lower(replace("mission-3348-${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,14 @@ 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+
}
45+
46+
# -
47+
3648

3749
# ------------------------------------------------------------------------------------------------------
3850
# Assignment of users as sub account administrators
@@ -41,6 +53,7 @@ resource "btp_subaccount_role_collection_assignment" "subaccount-admins" {
4153
for_each = toset(var.subaccount_admins)
4254
subaccount_id = data.btp_subaccount.dc_mission.id
4355
role_collection_name = "Subaccount Administrator"
56+
origin = local.origin_key
4457
user_name = each.value
4558
}
4659

@@ -51,6 +64,7 @@ resource "btp_subaccount_role_collection_assignment" "subaccount-service-admins"
5164
for_each = toset(var.subaccount_service_admins)
5265
subaccount_id = data.btp_subaccount.dc_mission.id
5366
role_collection_name = "Subaccount Service Administrator"
67+
origin = local.origin_key
5468
user_name = each.value
5569
}
5670

released/discovery_center/mission_3348/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ output "subaccount_id" {
22
value = data.btp_subaccount.dc_mission.id
33
description = "The ID of the subaccount."
44
}
5+
6+
output "sac_instance_dashboard_url" {
7+
value = btp_subaccount_service_instance.sac.dashboard_url
8+
}

released/discovery_center/mission_3348/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ terraform {
33
required_providers {
44
btp = {
55
source = "sap/btp"
6-
version = "~> 1.5.0"
6+
version = "~> 1.6.0"
77
}
88
}
99
}

released/discovery_center/mission_3348/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 3348"
8-
cf_environment_label = "cf-us10"
9-
cf_space_name = "dev"
5+
globalaccount = "youraccount"
6+
region = "us10"
7+
subaccount_name = "SAP Discovery Center Mission 3348"
8+
custom_idp = "<your-idp>.accounts.ondemand.com"
109

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

released/discovery_center/mission_3348/variables.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,20 @@ 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."
47-
4853
}
4954

5055
variable "subaccount_service_admins" {
5156
type = list(string)
5257
description = "Defines the colleagues who are added to each subaccount as subaccount service administrators."
53-
5458
}
5559

5660
# service plan sap analytics cloud

0 commit comments

Comments
 (0)