|
1 | 1 | # Setting up Azure and GCP credentials for Spacelift Intent |
2 | 2 |
|
3 | | -## Azure credencials |
| 3 | +## Azure credentials |
4 | 4 |
|
5 | | -- Get tenant id: |
| 5 | +1. Get your tenant id. |
6 | 6 |
|
7 | | -```jsx |
8 | | - $ az account show --query 'tenantId'` |
9 | | - "<YOUR-TENANT-ID>" |
10 | | -``` |
| 7 | + ```jsx |
| 8 | + $ az account show --query 'tenantId'` |
| 9 | + "<YOUR-TENANT-ID>" |
| 10 | + ``` |
11 | 11 |
|
12 | | -- Get subscription id: |
| 12 | +2. Get your subscription id. |
13 | 13 |
|
14 | | -```jsx |
15 | | - $ az account subscription list --query '[].{name:displayName,id:id}' |
16 | | - [ ... , { "id": "<YOUR-SUBSCRIPTION-ID>", "name": "..." }, ... ] |
17 | | -``` |
| 14 | + ```jsx |
| 15 | + $ az account subscription list --query '[].{name:displayName,id:id}' |
| 16 | + [ ... , { "id": "<YOUR-SUBSCRIPTION-ID>", "name": "..." }, ... ] |
| 17 | + ``` |
18 | 18 |
|
19 | | -- Optionally - create a role (role.json): |
| 19 | +3. Optionally, create a role (role.json). |
20 | 20 |
|
21 | | -```jsx |
22 | | - { |
23 | | - "Name": "example-role”, |
24 | | - "IsCustom": true, |
25 | | - "Description": "example-role", |
26 | | - "Actions": [ |
27 | | - "Microsoft.Resources/subscriptions/<ACTIONS…>" |
28 | | - ], |
29 | | - "NotActions": [], |
30 | | - "DataActions": [], |
31 | | - "NotDataActions": [], |
32 | | - "AssignableScopes": [ |
33 | | - "/subscriptions/<YOUR-SUBSCRIPTION-ID>" |
34 | | - ] |
35 | | - } |
| 21 | + ```jsx |
| 22 | + { |
| 23 | + "Name": "example-role”, |
| 24 | + "IsCustom": true, |
| 25 | + "Description": "example-role", |
| 26 | + "Actions": [ |
| 27 | + "Microsoft.Resources/subscriptions/<ACTIONS…>" |
| 28 | + ], |
| 29 | + "NotActions": [], |
| 30 | + "DataActions": [], |
| 31 | + "NotDataActions": [], |
| 32 | + "AssignableScopes": [ |
| 33 | + "/subscriptions/<YOUR-SUBSCRIPTION-ID>" |
| 34 | + ] |
| 35 | + } |
36 | 36 |
|
37 | | - $ az role definition create --role-definition role.json |
38 | | -``` |
| 37 | + $ az role definition create --role-definition role.json |
| 38 | + ``` |
39 | 39 |
|
40 | | -- Create service principal: |
| 40 | +4. Create a service principal. |
41 | 41 |
|
42 | | -```jsx |
43 | | - $ az ad sp create-for-rbac --name "example-name" --role "example-role" --scopes "/subscriptions/<YOUR-SUBSCRIPTION-ID>" |
44 | | - { |
45 | | - "appId": "<YOUR-CLIENT-ID>", |
46 | | - "displayName": "example-name", |
47 | | - "password": "<YOUR-CLIENT-PASSWORD>", |
48 | | - "tenant": "<YOUR-TENANT-ID>" |
49 | | - } |
50 | | -``` |
| 42 | + ```jsx |
| 43 | + $ az ad sp create-for-rbac --name "example-name" --role "example-role" --scopes "/subscriptions/<YOUR-SUBSCRIPTION-ID>" |
| 44 | + { |
| 45 | + "appId": "<YOUR-CLIENT-ID>", |
| 46 | + "displayName": "example-name", |
| 47 | + "password": "<YOUR-CLIENT-PASSWORD>", |
| 48 | + "tenant": "<YOUR-TENANT-ID>" |
| 49 | + } |
| 50 | + ``` |
51 | 51 |
|
52 | | -- Get client id and client password from above and setup env vars: |
| 52 | +5. Get client id and client password from above and setup env vars. |
53 | 53 |
|
54 | | -```jsx |
55 | | - ARM_CLIENT_ID="<YOUR-CLIENT-ID>" |
56 | | - ARM_CLIENT_SECRET="<YOUR-CLIENT-PASSWORD>" |
57 | | - ARM_TENANT_ID="<YOUR-TENANT-ID>" |
58 | | - ARM_SUBSCRIPTION_ID="<YOUR-SUBSCRIPTION-ID>" |
59 | | -``` |
| 54 | + ```jsx |
| 55 | + ARM_CLIENT_ID="<YOUR-CLIENT-ID>" |
| 56 | + ARM_CLIENT_SECRET="<YOUR-CLIENT-PASSWORD>" |
| 57 | + ARM_TENANT_ID="<YOUR-TENANT-ID>" |
| 58 | + ARM_SUBSCRIPTION_ID="<YOUR-SUBSCRIPTION-ID>" |
| 59 | + ``` |
60 | 60 |
|
61 | | - |
| 61 | + |
62 | 62 |
|
63 | | -## Google credencials |
| 63 | +## Google credentials |
64 | 64 |
|
65 | | -We need to follow [docs](../../getting-started/integrate-cloud/GCP.md) - with slightly change (file path to `spacelift.oidc` and `gcp.json`): |
| 65 | +Configuring Google credentials for Intent follows the same steps as [setting up GCP](../../getting-started/integrate-cloud/GCP.md) for Spacelift, with only a slight change to the file paths for `spacelift.oidc` and `gcp.json`. |
66 | 66 |
|
67 | | - |
| 67 | + |
68 | 68 |
|
69 | | -Setup OIDC file location (intent workspace is in `/app` instead of `/mnt/workspace`): |
| 69 | +1. When setting up the OIDC file location, use `/app/spacelift.oidc` instead of `/mnt/workspace/spacelift.oidc`. |
70 | 70 |
|
71 | | - |
| 71 | +  |
72 | 72 |
|
73 | | -Setup JSON configuration (`/app` as well): |
| 73 | +2. When setting up the JSON configuration, use `/app/spacelift.oidc` as well. |
74 | 74 |
|
75 | | - |
| 75 | +  |
76 | 76 |
|
77 | | -At the end we need: |
| 77 | +3. At the end we need: |
78 | 78 |
|
79 | | -- `GOOGLE_APPLICATION_CREDENCIALS=<pointing-to-JSON-configuration-file>` |
80 | | -- `GOOGLE_PROJECT=<project name>` (optional) |
81 | | -- `gcp.json` - JSON configuration file |
82 | | -- `spacelift.oidc` will be automatically mounted. |
| 79 | + - `GOOGLE_APPLICATION_CREDENTIALS=<pointing-to-JSON-configuration-file>`. |
| 80 | + - `GOOGLE_PROJECT=<project name>` (optional). |
| 81 | + - `gcp.json` (JSON configuration file). |
| 82 | + - `spacelift.oidc` will be automatically mounted. |
83 | 83 |
|
84 | | - |
| 84 | + |
0 commit comments