1
1
# ------------------------------------------------------------------------------------------------------
2
- # Setup of names in accordance to naming convention
2
+ # Subaccount setup for DC mission 3260
3
3
# ------------------------------------------------------------------------------------------------------
4
+ # Setup subaccount domain (to ensure uniqueness in BTP global account)
4
5
resource "random_uuid" "uuid" {}
5
6
6
7
locals {
@@ -15,13 +16,13 @@ resource "btp_subaccount" "dc_mission" {
15
16
count = var. subaccount_id == " " ? 1 : 0
16
17
name = var. subaccount_name
17
18
subdomain = local. subaccount_domain
18
- region = lower (var. region )
19
- usage = " USED_FOR_PRODUCTION"
19
+ region = var. region
20
20
}
21
21
22
22
data "btp_subaccount" "dc_mission" {
23
23
id = var. subaccount_id != " " ? var. subaccount_id : btp_subaccount. dc_mission [0 ]. id
24
24
}
25
+
25
26
# ------------------------------------------------------------------------------------------------------
26
27
# Assign custom IDP to sub account (if custom_idp is set)
27
28
# ------------------------------------------------------------------------------------------------------
@@ -33,49 +34,54 @@ resource "btp_subaccount_trust_configuration" "fully_customized" {
33
34
}
34
35
35
36
# ------------------------------------------------------------------------------------------------------
36
- # Assignment of users as sub account administrators
37
+ # APP SUBSCRIPTIONS
37
38
# ------------------------------------------------------------------------------------------------------
38
- resource "btp_subaccount_role_collection_assignment" "subaccount-admins" {
39
- for_each = toset (var. subaccount_admins )
40
- subaccount_id = data. btp_subaccount . dc_mission . id
41
- role_collection_name = " Subaccount Administrator"
42
- user_name = each. value
43
- }
44
-
45
- # ------------------------------------------------------------------------------------------------------
46
- # Assignment of users as sub account service administrators
47
- # ------------------------------------------------------------------------------------------------------
48
- resource "btp_subaccount_role_collection_assignment" "subaccount-service-admins" {
49
- for_each = toset (var. subaccount_service_admins )
50
- subaccount_id = data. btp_subaccount . dc_mission . id
51
- role_collection_name = " Subaccount Service Administrator"
52
- user_name = each. value
39
+ #
40
+ locals {
41
+ service_name__sap_process_automation = " process-automation"
53
42
}
54
-
55
43
# ------------------------------------------------------------------------------------------------------
56
- # Add Entitlement & Create Subscription - SAP Build Process Automation service
44
+ # Setup process-automation ( SAP Build Process Automation)
57
45
# ------------------------------------------------------------------------------------------------------
58
-
59
- # Add Entitlement
46
+ # Entitle
60
47
resource "btp_subaccount_entitlement" "build_process_automation" {
61
48
subaccount_id = data. btp_subaccount . dc_mission . id
62
49
service_name = local. service_name__sap_process_automation
63
50
plan_name = var. service_plan__sap_process_automation
64
51
}
65
-
66
- # Create app subscription to SAP Build Process Automation
52
+ # Subscribe
67
53
resource "btp_subaccount_subscription" "build_process_automation" {
68
54
subaccount_id = data. btp_subaccount . dc_mission . id
69
55
app_name = local. service_name__sap_process_automation
70
56
plan_name = var. service_plan__sap_process_automation
71
57
depends_on = [btp_subaccount_entitlement . build_process_automation ]
72
58
}
59
+ # ------------------------------------------------------------------------------------------------------
60
+ # USERS AND ROLES
61
+ # ------------------------------------------------------------------------------------------------------
62
+ # ------------------------------------------------------------------------------------------------------
63
+ # Assign role collection "Subaccount Administrator"
64
+ # ------------------------------------------------------------------------------------------------------
65
+ resource "btp_subaccount_role_collection_assignment" "subaccount_admins" {
66
+ for_each = toset (var. subaccount_admins )
67
+ subaccount_id = data. btp_subaccount . dc_mission . id
68
+ role_collection_name = " Subaccount Administrator"
69
+ user_name = each. value
70
+ }
73
71
74
72
# ------------------------------------------------------------------------------------------------------
75
- # Assign Roles - SAP Build Process Automation service
73
+ # Assign role collection "Subaccount Service Administrator"
76
74
# ------------------------------------------------------------------------------------------------------
75
+ resource "btp_subaccount_role_collection_assignment" "subaccount_service_admins" {
76
+ for_each = toset (var. subaccount_service_admins )
77
+ subaccount_id = data. btp_subaccount . dc_mission . id
78
+ role_collection_name = " Subaccount Service Administrator"
79
+ user_name = each. value
80
+ }
77
81
78
- # Assign users to Role Collection: ProcessAutomationAdmin
82
+ # ------------------------------------------------------------------------------------------------------
83
+ # Assign role collection "ProcessAutomationAdmin"
84
+ # ------------------------------------------------------------------------------------------------------
79
85
resource "btp_subaccount_role_collection_assignment" "bpa_admins" {
80
86
depends_on = [btp_subaccount_subscription . build_process_automation ]
81
87
for_each = toset (var. process_automation_admins )
@@ -84,18 +90,24 @@ resource "btp_subaccount_role_collection_assignment" "bpa_admins" {
84
90
user_name = each. value
85
91
}
86
92
87
- resource "btp_subaccount_role_collection_assignment" "sbpa_participants" {
93
+ # ------------------------------------------------------------------------------------------------------
94
+ # Assign role collection "ProcessAutomationDeveloper"
95
+ # ------------------------------------------------------------------------------------------------------
96
+ resource "btp_subaccount_role_collection_assignment" "sbpa_developers" {
88
97
depends_on = [btp_subaccount_subscription . build_process_automation ]
89
- for_each = toset (var. process_automation_participants )
98
+ for_each = toset (var. process_automation_developers )
90
99
subaccount_id = data. btp_subaccount . dc_mission . id
91
- role_collection_name = " ProcessAutomationParticipant "
100
+ role_collection_name = " ProcessAutomationDeveloper "
92
101
user_name = each. value
93
102
}
94
103
95
- resource "btp_subaccount_role_collection_assignment" "sbpa_developers" {
104
+ # ------------------------------------------------------------------------------------------------------
105
+ # Assign role collection "ProcessAutomationParticipant"
106
+ # ------------------------------------------------------------------------------------------------------
107
+ resource "btp_subaccount_role_collection_assignment" "sbpa_participants" {
96
108
depends_on = [btp_subaccount_subscription . build_process_automation ]
97
- for_each = toset (var. process_automation_developers )
109
+ for_each = toset (var. process_automation_participants )
98
110
subaccount_id = data. btp_subaccount . dc_mission . id
99
- role_collection_name = " ProcessAutomationDeveloper "
111
+ role_collection_name = " ProcessAutomationParticipant "
100
112
user_name = each. value
101
113
}
0 commit comments