Skip to content

Commit a0a0759

Browse files
committed
fix: update SIT workshop scripts and docs
1 parent 70c9b6a commit a0a0759

File tree

10 files changed

+18
-151
lines changed

10 files changed

+18
-151
lines changed

released/SAP-Inside-Tracks/SITBLR_DEC_2024/exercises/EXERCISE4/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,7 @@ variable "cf_landscape_label" {
2929
Then add the following code to the `main.tf`
3030

3131
```terraform
32-
resource "btp_subaccount_entitlement" "cf_application_runtime" {
33-
subaccount_id = btp_subaccount.project.id
34-
service_name = "APPLICATION_RUNTIME"
35-
plan_name = "MEMORY"
36-
}
37-
3832
resource "btp_subaccount_environment_instance" "cloudfoundry" {
39-
depends_on = [btp_subaccount_entitlement.cf_application_runtime]
4033
subaccount_id = btp_subaccount.project.id
4134
name = local.project_subaccount_cf_org
4235
landscape_label = var.cf_landscape_label

released/SAP-Inside-Tracks/SITBLR_DEC_2024/exercises/EXERCISE4/SOLUTION_EX4/main.tf

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,10 @@ resource "btp_subaccount" "project" {
2020
}
2121
}
2222

23-
2423
###
25-
# Creation of Cloud Foundry environment via module
24+
# Creation of Cloud Foundry environment
2625
###
27-
resource "btp_subaccount_entitlement" "cf_application_runtime" {
28-
subaccount_id = btp_subaccount.project.id
29-
service_name = "APPLICATION_RUNTIME"
30-
plan_name = "MEMORY"
31-
}
32-
3326
resource "btp_subaccount_environment_instance" "cloudfoundry" {
34-
depends_on = [btp_subaccount_entitlement.cf_application_runtime]
3527
subaccount_id = btp_subaccount.project.id
3628
name = local.project_subaccount_cf_org
3729
landscape_label = var.cf_landscape_label
@@ -47,40 +39,4 @@ resource "btp_subaccount_environment_instance" "cloudfoundry" {
4739
update = "35m"
4840
delete = "30m"
4941
}
50-
}
51-
52-
resource "cloudfoundry_org_role" "my_role" {
53-
for_each = var.cf_org_user
54-
username = each.value
55-
type = "organization_user"
56-
org = btp_subaccount_environment_instance.cloudfoundry.platform_id
57-
}
58-
59-
resource "cloudfoundry_space" "space" {
60-
name = var.cf_space_name
61-
org = btp_subaccount_environment_instance.cloudfoundry.platform_id
62-
}
63-
64-
resource "cloudfoundry_space_role" "cf_space_managers" {
65-
for_each = toset(var.cf_space_managers)
66-
username = each.value
67-
type = "space_manager"
68-
space = cloudfoundry_space.space.id
69-
depends_on = [cloudfoundry_org_role.my_role]
70-
}
71-
72-
resource "cloudfoundry_space_role" "cf_space_developers" {
73-
for_each = toset(var.cf_space_developers)
74-
username = each.value
75-
type = "space_developer"
76-
space = cloudfoundry_space.space.id
77-
depends_on = [cloudfoundry_org_role.my_role]
78-
}
79-
80-
resource "cloudfoundry_space_role" "cf_space_auditors" {
81-
for_each = toset(var.cf_space_auditors)
82-
username = each.value
83-
type = "space_auditor"
84-
space = cloudfoundry_space.space.id
85-
depends_on = [cloudfoundry_org_role.my_role]
86-
}
42+
}

released/SAP-Inside-Tracks/SITBLR_DEC_2024/exercises/EXERCISE4/SOLUTION_EX4/provider.tf

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,11 @@ terraform {
55
source = "sap/btp"
66
version = "~> 1.8.0"
77
}
8-
cloudfoundry = {
9-
source = "cloudfoundry/cloudfoundry"
10-
version = "~> 1.1.0"
11-
}
128
}
13-
149
}
1510

1611
# Please checkout documentation on how best to authenticate against SAP BTP
1712
# via the Terraform provider for SAP BTP
1813
provider "btp" {
1914
globalaccount = var.globalaccount
20-
}
21-
22-
provider "cloudfoundry" {
23-
api_url = "https://api.cf.${var.region}-001.hana.ondemand.com"
24-
}
15+
}

released/SAP-Inside-Tracks/SITBLR_DEC_2024/exercises/EXERCISE4/SOLUTION_EX4/variables.tf

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,6 @@ variable "org_name" {
5252
type = string
5353
description = "Defines to which organisation the project account shall belong to."
5454
default = "B2C"
55-
56-
validation {
57-
condition = contains(concat(
58-
// Cross Development
59-
["B2B", "B2C", "ECOMMERCE"],
60-
// Internal IT
61-
["PLATFORMDEV", "INTIT"],
62-
// Financial Services
63-
["FSIT"],
64-
), var.org_name)
65-
error_message = "Please select a valid org name for the project account."
66-
}
6755
}
6856

6957
variable "bas_plan_name" {
@@ -84,47 +72,8 @@ variable "bas_admins" {
8472
8573
}
8674

87-
###
88-
# Cloud Foundry space setup
89-
###
90-
variable "cf_space_name" {
91-
type = string
92-
description = "The name of the Cloud Foundry space."
93-
default = "dev"
94-
}
95-
9675
variable "cf_landscape_label" {
9776
type = string
9877
description = "The region where the project account shall be created in."
9978
default = "cf-us10-001"
10079
}
101-
102-
variable "cf_org_name" {
103-
type = string
104-
description = "The name for the Cloud Foundry Org."
105-
default = ""
106-
}
107-
108-
variable "cf_org_user" {
109-
type = set(string)
110-
description = "Defines the colleagues who are added to each subaccount as subaccount administrators."
111-
112-
}
113-
114-
variable "cf_space_managers" {
115-
type = list(string)
116-
description = "The list of Cloud Foundry space managers."
117-
default = []
118-
}
119-
120-
variable "cf_space_developers" {
121-
type = list(string)
122-
description = "The list of Cloud Foundry space developers."
123-
default = []
124-
}
125-
126-
variable "cf_space_auditors" {
127-
type = list(string)
128-
description = "The list of Cloud Foundry space auditors."
129-
default = []
130-
}

released/SAP-Inside-Tracks/SITBLR_DEC_2024/exercises/EXERCISE5/README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,6 @@ variable "cf_landscape_label" {
110110
default = "cf-us10-001"
111111
}
112112
113-
variable "cf_org_name" {
114-
type = string
115-
description = "The name for the Cloud Foundry Org."
116-
default = ""
117-
}
118-
119113
variable "cf_org_user" {
120114
type = set(string)
121115
description = "Defines the colleagues who are added to each subaccount as subaccount administrators."
@@ -156,7 +150,7 @@ resource "cloudfoundry_org_role" "my_role" {
156150
}
157151
158152
resource "cloudfoundry_space" "space" {
159-
name = var.name
153+
name = var.cf_space_name
160154
org = btp_subaccount_environment_instance.cloudfoundry.platform_id
161155
}
162156

released/SAP-Inside-Tracks/SITBLR_DEC_2024/exercises/EXERCISE5/SOLUTION_EX5/main.tf

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,7 @@ resource "btp_subaccount_role_collection_assignment" "Business_Application_Studi
4141
depends_on = [btp_subaccount_subscription.bas-subscribe]
4242
}
4343

44-
resource "btp_subaccount_entitlement" "cf_application_runtime" {
45-
subaccount_id = btp_subaccount.project.id
46-
service_name = "APPLICATION_RUNTIME"
47-
plan_name = "MEMORY"
48-
}
49-
5044
resource "btp_subaccount_environment_instance" "cloudfoundry" {
51-
depends_on = [btp_subaccount_entitlement.cf_application_runtime]
5245
subaccount_id = btp_subaccount.project.id
5346
name = local.project_subaccount_cf_org
5447
landscape_label = var.cf_landscape_label
@@ -73,7 +66,7 @@ resource "cloudfoundry_org_role" "my_role" {
7366
}
7467

7568
resource "cloudfoundry_space" "space" {
76-
name = var.name
69+
name = var.cf_space_name
7770
org = btp_subaccount_environment_instance.cloudfoundry.platform_id
7871
}
7972

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
11
globalaccount = "<YOUR GLOBAL ACCOUT SUBDOMAIN>"
2+
3+
region = "us10"
4+
5+
6+
bas_plan_name = "trial"
7+
bas_admins = ["[email protected]"]
8+
bas_developers = ["[email protected]"]
9+
10+
11+
cf_org_user = ["[email protected]"]
12+
cf_space_developers = ["[email protected]"]

released/SAP-Inside-Tracks/SITBLR_DEC_2024/solution/main.tf

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,7 @@ resource "btp_subaccount_role_collection_assignment" "Business_Application_Studi
4848
depends_on = [btp_subaccount_subscription.bas-subscribe]
4949
}
5050

51-
resource "btp_subaccount_entitlement" "cf_application_runtime" {
52-
subaccount_id = btp_subaccount.project.id
53-
service_name = "APPLICATION_RUNTIME"
54-
plan_name = "MEMORY"
55-
}
56-
5751
resource "btp_subaccount_environment_instance" "cloudfoundry" {
58-
depends_on = [btp_subaccount_entitlement.cf_application_runtime]
5952
subaccount_id = btp_subaccount.project.id
6053
name = local.project_subaccount_cf_org
6154
landscape_label = var.cf_landscape_label
@@ -64,7 +57,6 @@ resource "btp_subaccount_environment_instance" "cloudfoundry" {
6457
plan_name = "trial"
6558
parameters = jsonencode({
6659
instance_name = local.project_subaccount_cf_org
67-
memory = 1024
6860
})
6961
timeouts = {
7062
create = "1h"
@@ -81,7 +73,7 @@ resource "cloudfoundry_org_role" "my_role" {
8173
}
8274

8375
resource "cloudfoundry_space" "space" {
84-
name = var.name
76+
name = var.cf_space_name
8577
org = btp_subaccount_environment_instance.cloudfoundry.platform_id
8678
}
8779

released/SAP-Inside-Tracks/SITBLR_DEC_2024/solution/terraform.tfvars-sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ bas_plan_name = "trial"
44
bas_admins = ["[email protected]"]
55
bas_developers = ["[email protected]"]
66

7-
cf_org_user = ["[email protected]"]
7+
cf_org_user = ["[email protected]"]
88
cf_space_developers = ["[email protected]"]

released/SAP-Inside-Tracks/SITBLR_DEC_2024/solution/variables.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,12 @@ variable "cf_landscape_label" {
8484
default = "cf-us10-001"
8585
}
8686

87-
variable "cf_org_name" {
88-
type = string
89-
description = "The name for the Cloud Foundry Org."
90-
default = ""
91-
}
92-
9387
variable "cf_org_user" {
9488
type = set(string)
9589
description = "Defines the colleagues who are added to each subaccount as subaccount administrators."
9690
9791
}
9892

99-
variable "name" {
100-
type = string
101-
description = "The name of the Cloud Foundry space."
102-
default = "dev"
103-
}
104-
10593
variable "cf_space_managers" {
10694
type = list(string)
10795
description = "The list of Cloud Foundry space managers."

0 commit comments

Comments
 (0)