You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: released/SAP-Inside-Tracks/SITBLR_DEC_2024/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# SITBLR DECEMBER 2024 - HandsOn SAP Terraform Provider for SAP BTP
2
2
3
-
## Goal of this HandsOn 🎯
3
+
## Goal of this Hands-on 🎯
4
4
5
5
In this hands-on exercise you will learn how to use the [Terraform Provider for SAP BTP](https://registry.terraform.io/providers/SAP/btp/latest/docs) to provision and manage resources in SAP BTP. The level of the exercises is beginner. You don't need any prior knowledge about Terraform or the Terraform Provider for SAP BTP. We will guide you through the exercises step by step.
Copy file name to clipboardExpand all lines: released/SAP-Inside-Tracks/SITBLR_DEC_2024/exercises/EXERCISE2/README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,6 +112,13 @@ As we have all variables in place, you should save the changes now.
112
112
> [!NOTE]
113
113
> As you can see you have a lot of possibilities to validate the user input in Terraform in this way ensure that the input is correct and meets your corporate requirements.
114
114
115
+
We have defined the `project_name` which is required for the subaccount creation. We will provide the value for this variable via the `terraform.tfvars` file. Open
116
+
the file `terraform.tfvars` and append the following content to the end of the file:
117
+
118
+
```terraform
119
+
project_name = "<YOUR LAST NAME>"
120
+
```
121
+
115
122
### Step 2: Local values
116
123
117
124
Now we want to leverage the input variables to create a subaccount name that follows a specific naming convention. Here are the conditions:
Copy file name to clipboardExpand all lines: released/SAP-Inside-Tracks/SITBLR_DEC_2024/exercises/EXERCISE3/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ variable "bas_plan" {
36
36
}
37
37
```
38
38
39
-
We define a complex variable type, which is a [list](https://developer.hashicorp.com/terraform/language/expressions/types#lists-tuples) of [objects](https://developer.hashicorp.com/terraform/language/expressions/types#maps-objects). Each object has three attributes: `name`, `plan`, and `amount`. The `name` and `plan` attributes are strings, and the `amount` attribute is a number. We define a default value for the variable, which is an empty list.We will provide values for this parameter via the file `terraform.tfvars` in the next step. Save the changes.
39
+
We define a complex variable type, which is a [list](https://developer.hashicorp.com/terraform/language/expressions/types#lists-tuples) of [objects](https://developer.hashicorp.com/terraform/language/expressions/types#maps-objects). Each object has three attributes: `name`and `plan`. The `name` and `plan` attributes are strings. We define a default value for the variable, which is an empty list.We will provide values for this parameter via the file `terraform.tfvars` in the next step. Save the changes.
Copy file name to clipboardExpand all lines: released/SAP-Inside-Tracks/SITBLR_DEC_2024/exercises/EXERCISE5/README.md
+31-70Lines changed: 31 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,29 +4,6 @@
4
4
5
5
In this exercise you will learn how to use the [Terraform Provider for CloudFoundry](https://registry.terraform.io/providers/cloudfoundry/cloudfoundry/latest/docs) and create a space.
6
6
7
-
### Step 3: Adjust the provider configuration
8
-
9
-
As we are using an additional provider we must make Terraform aware of this in the `provider.tf` file. Open the `provider.tf` file and add the following code to the `required_provider` block:
10
-
11
-
```terraform
12
-
cloudfoundry = {
13
-
source = "cloudfoundry/cloudfoundry"
14
-
version = "1.1.0"
15
-
}
16
-
```
17
-
18
-
To configure the Cloud Foundry provider add the following lines at the end of the file:
> We assume that the Cloud Foundry environment is deployed to the extension landscape 001. If this is not the case the authentication might fail. In a real-world scenario you would probably have a different boundary of content to the module.
29
-
30
7
To fulfill all requirements for the authentication against the Cloud Foundry environment you must export the following environment variables:
31
8
32
9
- Windows:
@@ -43,57 +20,36 @@ To fulfill all requirements for the authentication against the Cloud Foundry env
43
20
export CF_PASSWORD='<your SAP BTP password>'
44
21
```
45
22
46
-
> [!NOTE]
47
-
> Although we do not use the Cloud Foundry part of the module namely the assignment of users to the organization, Terraform will initialize the Cloud Foundry provider and try to authenticate against the Cloud Foundry environment. This is why we need to define the configuration and provide the credentials.
48
23
49
-
### Step 3: Apply the changes
24
+
### Step 1: Adjust the provider configuration
50
25
51
-
As we have a new provider in place, we need to re-initialize the setup to download the required providerand module. Run the following command:
26
+
As we are using an additional provider we must make Terraform aware of this in the `provider.tf` file. Open the `provider.tf` file and add the following code to the `required_provider` block:
52
27
53
-
```bash
54
-
terraform init
28
+
```terraform
29
+
cloudfoundry = {
30
+
source = "cloudfoundry/cloudfoundry"
31
+
version = "1.1.0"
32
+
}
55
33
```
56
34
57
-
The output should look like this:
58
-
59
-
<imgwidth="600px"src="assets/ex7_1.png"alt="executing terraform init with cloud foundry provider">
60
-
61
-
> [!NOTE]
62
-
> There is also a command parameter called `--upgrade` for the `terraform init` command. This parameter will *upgrade* the provider to the latest version. As we are adding new providers, we do not need to use this parameter.
63
-
64
-
You know the drill by now:
65
-
66
-
1. Plan the Terraform configuration to see what will be created:
67
-
68
-
```bash
69
-
terraform plan
70
-
```
71
-
72
-
The output should look like this:
73
-
74
-
<img width="600px" src="assets/ex7_2.png" alt="executing terraform plan with cloud foundry">
75
-
76
-
2. Apply the Terraform configuration to create the environment:
77
-
78
-
```bash
79
-
terraform apply
80
-
```
81
-
82
-
You will be prompted to confirm the creation of the environment. Type `yes` and press `Enter` to continue.
83
-
84
-
The result should look like this:
35
+
To configure the Cloud Foundry provider add the following lines at the end of the file:
85
36
86
-
<img width="600px" src="assets/ex7_3.png" alt="executing terraform apply with cloud foundry provider">
You can also check that everything is in place via the SAP BTP cockpit. You should see the Cloud Foundry environment in the subaccount:
44
+
> [!WARNING]
45
+
> We assume that the Cloud Foundry environment is deployed to the extension landscape 001. If this is not the case the authentication might fail. In a real-world scenario you would probably have a different boundary of content to the module.
89
46
90
-
<img width="600px" src="assets/ex7_4.png" alt="SAP BTP Cockpit with Cloud Foundry environment">
91
47
92
-
## Creation of a Cloud Foundry space
48
+
> [!NOTE]
49
+
> Although we do not use the Cloud Foundry part of the module namely the assignment of users to the organization, Terraform will initialize the Cloud Foundry provider and try to authenticate against the Cloud Foundry environment. This is why we need to define the configuration and provide the credentials.
93
50
94
-
As a last task we also want to add a Cloud Foundry space to the Cloud Foundry environment.
95
51
96
-
### Step 1: Add the variable to the configuration for Space creation
52
+
### Step 2: Add the variable to the configuration for Space creation
97
53
98
54
First we need to add more variable in the `variables.tf` file. Open the `variables.tf` file and add the following code:
99
55
@@ -131,7 +87,7 @@ variable "cf_space_auditors" {
131
87
132
88
This allows us to specify the name of the Cloud Foundry space. We also define a default value (`dev`) for the variable. Save the changes.
133
89
134
-
### Step 2: Cloudfoundry Space Creation and Role Assignments
90
+
### Step 3: Cloudfoundry Space Creation and Role Assignments
135
91
136
92
To trigger the creation of a Cloud Foundry space and space roles, Open the `main.tf` file and add the following code:
0 commit comments