|
| 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 | +``` |
0 commit comments