Skip to content

Commit adb425e

Browse files
committed
4327: Polished the QAS enabled Mission
1 parent b380b00 commit adb425e

File tree

14 files changed

+745
-427
lines changed

14 files changed

+745
-427
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Discovery Center mission: Develop a Full-Stack CAP Application Following the SAP BTP Developer’s Guide (4327)
2+
3+
## Overview
4+
5+
This sample shows how to setup your SAP BTP account for the Discovery Center Mission - [Develop a Full-Stack CAP Application Following the SAP BTP Developer’s Guide](https://discovery-center.cloud.sap/index.html#/missiondetail/4327/) for your Enterprise BTP Account.
6+
7+
## Content of setup (step1)
8+
9+
The setup comprises the following resources:
10+
11+
- Creation of the SAP BTP subaccount
12+
- Entitlements of services
13+
- Subscriptions to applications
14+
- Role collection assignments to users
15+
- Creation of CF environment and CF org
16+
17+
After this a setup step2 will create a CF space in the before created CF org and users and roles will be assigned on CF org and space level
18+
19+
## Deploying the resources
20+
21+
Make sure that you are familiar with SAP BTP and know both the [Get Started with btp-terraform-samples](https://github.com/SAP-samples/btp-terraform-samples/blob/main/GET_STARTED.md) and the [Get Started with the Terraform Provider for BTP](https://developers.sap.com/tutorials/btp-terraform-get-started.html)
22+
23+
To deploy the resources you must:
24+
25+
### Setup Step1
26+
27+
1. Set your credentials as environment variables
28+
29+
```bash
30+
export BTP_USERNAME ='<Email address of your BTP user>'
31+
export BTP_PASSWORD ='<Password of your BTP user>'
32+
```
33+
34+
2. Go into folder `step1` and change the variables in the `sample.tfvars` file to meet your requirements
35+
36+
> The minimal set of parameters you should specify (besides user_email and password) is global account (i.e. its subdomain) and the used custom_idp and all user assignments
37+
38+
> Keep the setting `create_tfvars_file_for_step2 = true` so that a `terraform.tfvars` file is created which contains your needed variables to execute setup `step2` without specifying them again in sample.tfvars there.
39+
40+
3. In folder `step1` you initialize your workspace:
41+
42+
```bash
43+
terraform init
44+
```
45+
46+
4. You can check what Terraform plans to apply based on your configuration:
47+
48+
```bash
49+
terraform plan -var-file="sample.tfvars"
50+
```
51+
52+
5. Apply your configuration to provision the resources:
53+
54+
```bash
55+
terraform apply -var-file="sample.tfvars"
56+
```
57+
58+
6. Verify e.g., in BTP cockpit that a new subaccount with a SAP HANA Cloud and SAP Build Work Zone subscriptions have been created.
59+
60+
### Setup Step2
61+
62+
7. Navigate into step2_cf directory and initialize your workspace there as well:
63+
64+
```bash
65+
terraform init
66+
```
67+
8. You can check what Terraform plans to apply based on your configuration:
68+
69+
```bash
70+
terraform plan -var-file="terraform.tfvars"
71+
```
72+
73+
9. Apply your configuration to provision the resources:
74+
75+
```bash
76+
terraform apply -var-file="terraform.tfvars"
77+
```
78+
10. Verify e.g., in BTP cockpit that after step2 the specified users in sample.tfvars have been assigned with roles in the created cloundfoundry org and space.
79+
80+
With this you have completed the quick account setup as described in the Discovery Center Mission - [Develop a Full-Stack CAP Application Following the SAP BTP Developer’s Guide](https://discovery-center.cloud.sap/index.html#/missiondetail/4327/).
81+
82+
## In the end
83+
84+
You probably want to remove the assets after trying them out to avoid unnecessary costs. To do so execute the following command:
85+
86+
```bash
87+
terraform destroy -var-file="terraform.tfvars"
88+
```
Lines changed: 18 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,33 @@
1-
# Set Up SAP BTP Account using Terraform – Cloud Foundry
1+
# Discovery Center Mission: Discovery Center mission - Deliver Connected Experiences with a single view of Material Availability
22

3-
The Terraform provider for SAP Business Technology Platform (BTP) enables you to automate the provisioning, management, and configuration of resources on SAP BTP. By leveraging this provider, you can simplify and streamline the deployment and maintenance of SAP BTP services and applications.
3+
## Overview
44

5-
Currently, the SAP BTP provider is available in beta for non productive usage: [SAP BTP Terraform](https://registry.terraform.io/providers/SAP/btp/latest).
5+
This sample shows how to create a landscape for the Discovery Center Mission - [Deliver Connected Experiences with a single view of Material Availability](https://discovery-center.cloud.sap/missiondetail/4356/)
66

7-
The Terraform script documented here automates the setup of an SAP BTP subaccount based on a predefined template. The scripts can be used create SAP BTP subaccount with Cloud Foundry or Kyma runtime. The Terraform script does the below configuration after creating a SAP BTP subaccount:
7+
## Content of setup
88

9-
1. Configures the SAP BTP entitlements required to complete the mission. See [Setup SAP BTP Account using Terraform](https://github.com/SAP-samples/btp-terraform-samples/blob/main/released/discovery_center/mission_4327/step1/README.md#entitlements).
10-
2. Enables the SAP BTP runtime (Cloud Foundry or Kyma).
11-
3. Creates the neccessary subscription to applications: SAP Business Application Studio (BAS), SAP Build Work Zone, standard edition, etc.
12-
4. Assigns users the neccessary roles required to access the applications, such as SAP Business Application Studio.
13-
5. Adds additional users to the subaccount.
14-
### [Entitlements ](https://github.tools.sap/refapps/incidents-mgmt/blob/main/documentation/administrate/Prepare-BTP/Configure-BTP-CF.md)
9+
The setup comprises the following resources:
1510

16-
| Service | Plan | Quota required |
17-
| ------------- | :-----------: | ----: |
18-
| Cloud Foundry Runtime | MEMORY | 1 |
19-
| SAP Build Work Zone, standard edition | Standard | 1 |
20-
| SAP HANA Cloud | hana | 1 |
21-
| SAP HANA Cloud | tools | 1 |
22-
| SAP HANA Schemas & HDI Containers | hdi-shared | 1 |
11+
- Creation of the SAP BTP subaccount
12+
- Entitlements of services
13+
- Subscriptions to applications
14+
- Role collection assignments to users
15+
- Creation of CF environments
16+
- Management of users and roles on org and space level
2317

24-
## Deploy the resources
18+
## Deploying the resources
2519

2620
To deploy the resources you must:
27-
1. Clone repository `git clone https://github.com/SAP-samples/btp-terraform-samples.git`
28-
2. Navigate to `released/discovery_center/mission_4327/setup_subaccount_cf`
29-
3. You will be seeing these files named `main.tf`,`provider.tf`,`samples.tfvars`,`variables.tf`.
30-
4. Create a file named `terraform.tfvars` and copy `samples.tfvars` content to `terraform.tfvars`. Update the variables to meet your requirements (By default free-tier plans are used, if you want to use it for production update in the `terraform.tfvars` accordingly)
31-
Follow these steps to use the script:
32-
5. Set `BTP_USERNAME`,`BTP_PASSWORD`,`CF_USER` and `CF_PASSWORD` as ENV variables.
33-
34-
Windows PowerShell:
35-
```Powershell
36-
$env:BTP_USERNAME="<your email address>"
37-
$env:BTP_PASSWORD="<your password>"
38-
$env:CF_USER="<your email address>"
39-
$env:CF_PASSWORD="<your password>"
40-
```
41-
Linux, macOS:
42-
```mac OS
43-
export BTP_USERNAME="<your email address>"
44-
export BTP_PASSWORD="<your password>"
45-
export CF_USER="<your email address>"
46-
export CF_PASSWORD="<your password>"
47-
```
48-
6. **Install Terraform Plugins**: Open a terminal and navigate to the directory containing your Terraform configuration files. Run the following command to initialize and upgrade Terraform plugins:
4921

50-
```shell
51-
terraform init
52-
```
22+
1. Export environment variables BTP_USERNAME, BTP_PASSWORD, CF_USER, and CF_PASSWORD with your username and password for the custom IdP of your global account.
5323

54-
7. **Review Changes**: Generate an execution plan to review the changes that will be made to your SAP BTP account. Run:
24+
2. Change the variables in the `samples.tfvars` file in the main folder to meet your requirements
5525

56-
```shell
57-
terraform plan
58-
```
26+
> ⚠ 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]`.
5927
60-
8. **Apply Configuration**: Apply the Terraform configuration to create the SAP BTP subaccount and entitlements. Run:
28+
3. Execute the apply.sh script.
6129

62-
```shell
63-
terraform apply
64-
```
30+
4. Verify e.g., in BTP cockpit that a new subaccount with a integration suite, SAP Business Application Studio, CF environment instance and a CF space have been created.
6531

66-
Confirm the changes by typing "yes."
32+
5. Clean up by running the destroy.sh script.
6733

68-
9. **Cleanup**: After your session or project is complete, you can delete the SAP BTP subaccount and associated resources to avoid charges:
69-
70-
```shell
71-
terraform destroy
72-
```
73-
74-
Confirm the resource destruction by typing "yes."
75-
76-
11. **Optional**: You can remove the Terraform state file (`terraform.tfstate`) manually if needed.
77-
78-
Please exercise caution when using this script, especially in production environments, and ensure you understand the resources that will be created or modified.

0 commit comments

Comments
 (0)