# Step-by-step deployment guide

### 1. Which data is imported from SAP Cloud Foundry?

The following entity types are imported:

* `Users`: all users registered in Cloud Foundry
* `Organizations`: Cloud Foundry organizations (orgs)
* `Spaces`: spaces within each organization
* `Organization Roles`: role assignments scoped to an organization (e.g. organization\_manager, organization\_user)
* `Space Roles`: role assignments scoped to a space (e.g. space\_developer, space\_auditor)

The diagram below shows the relationships between these entity types:

```mermaid
graph TD

User[User]
Org[Organization]
Space[Space]
OrgRole[Organization Role]
SpaceRole[Space Role]

User --> OrgRole
User --> SpaceRole
OrgRole --> Org
SpaceRole --> Space
```

#### User attributes

| Attribute           | Description                                   |
| ------------------- | --------------------------------------------- |
| `Guid`              | Cloud Foundry user GUID                       |
| `Username`          | Username                                      |
| `Presentation Name` | Display name                                  |
| `Origin`            | Identity provider origin (e.g. ldap, sap.ids) |
| `Zone`              | Cloud Foundry region (e.g. EU10)              |

#### Organization attributes

| Attribute   | Description                           |
| ----------- | ------------------------------------- |
| `Guid`      | Cloud Foundry organization GUID       |
| `Name`      | Organization name                     |
| `Suspended` | Whether the organization is suspended |
| `Zone`      | Cloud Foundry region                  |

#### Space attributes

| Attribute           | Description                     |
| ------------------- | ------------------------------- |
| `Guid`              | Cloud Foundry space GUID        |
| `Name`              | Space name                      |
| `Organization Guid` | GUID of the parent organization |
| `Zone`              | Cloud Foundry region            |

#### Organization Role attributes

| Attribute   | Description                                                                                                          |
| ----------- | -------------------------------------------------------------------------------------------------------------------- |
| `Role Type` | Role type (e.g. `organization_manager`, `organization_user`, `organization_auditor`, `organization_billing_manager`) |

#### Space Role attributes

| Attribute   | Description                                                                             |
| ----------- | --------------------------------------------------------------------------------------- |
| `Role Type` | Role type (e.g. `space_developer`, `space_manager`, `space_auditor`, `space_supporter`) |

The connector supports **multiple Cloud Foundry regions** in a single import. Each region is represented as a separate `zone` value on the entities. Each Cloud Foundry Organization has a 1:1 relationship with a SAP BTP Subaccount.

### 2. Preparing credentials from SAP BTP Cloud Foundry

The connector authenticates against each Cloud Foundry region using a `username`, a `password` and a `client id`. These credentials are configure per region/zone.

This is the configuration value you need to create in order to import data into Elimtiy. It's a JSON array consisting of regional Cloud Foundry authentication credentials:

```json
[
  {
    "cf_region": "EU10",
    "cf_username": "technical-user@example.com",
    "cf_password": "your-password",
    "cf_clientId": "cloud_foundry",
    "cf_tokenUrl": "https://login.cf.eu10.hana.ondemand.com/oauth/token",
    "cf_apiUrl": "https://api.cf.eu10.hana.ondemand.com"
  },
  {
    "cf_region": "US10",
    "cf_username": "technical-user@example.com",
    "cf_password": "your-password",
    "cf_clientId": "cloud_foundry",
    "cf_tokenUrl": "https://login.cf.us10.hana.ondemand.com/oauth/token",
    "cf_apiUrl": "https://api.cf.us10.hana.ondemand.com"
  }
]
```

### 3. Configure the source in Elimity Insights

1. Go to **Sources** in the left navigation bar and click **Add Source**.
2. Search for **Custom** and click **Set Up**.
3. Click **Set Up** again and give the source a name (e.g. `SAP Cloud Foundry`).
4. Select **Upload export file**, click **Continue** and upload the data model file: `sap-cf-data-model.json`.

{% file src="/files/LNohpnKl5x7oCbCt4tUH" %}

5. Open the **Config** tab and click **Edit**.
6. Set **Enable automatic imports via custom gateway** to `true` and fill in the Gateway URL: `https://sap-cf-gateway-1027270379075.europe-west1.run.app`.
7. Click **Add configuration value** and add the entry below.

| Key           | Type          | Where to find it                           |
| ------------- | ------------- | ------------------------------------------ |
| `credentials` | `Secret File` | The JSON value from step 2 in a .json file |

Click **Save and run** to launch your first import. Monitor progress in the **Logs** tab; the **Imports** tab shows the summary for each run.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.elimity.com/sap-cloud-foundry/step-by-step-deployment-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
