Skip to content

Commit 823571d

Browse files
committed
The api now already returns the trust policy
1 parent 0c7af72 commit 823571d

File tree

1 file changed

+5
-31
lines changed

1 file changed

+5
-31
lines changed

md-docs/user_guide/integrations/index.md

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,11 @@ Below, you will find a guide that will help you create the credentials and confi
77
![Amazon Web Services](../../imgs/aws.svg){: style="height:50px;width:50px"}
88

99
The ML cube Platform can assume an **IAM Role** on your AWS Account, that can be used to authorize actions on specific resources.
10-
To create this, log into your AWS account and open the AWS console. Here, go to the **IAM** service, navigate to the **Roles** section and create a new role. When asked, select the **Custom trust policy** option and paste the following json:
11-
12-
```json
13-
{
14-
"Version": "2012-10-17",
15-
"Statement": [
16-
{
17-
"Sid": "Statement1",
18-
"Effect": "Allow",
19-
"Principal": {
20-
"AWS": "arn:aws:iam::883313729965:root"
21-
},
22-
"Action": "sts:AssumeRole",
23-
"Condition": {
24-
"StringEquals": {
25-
"sts:ExternalId": "<EXTERNAL_ID>"
26-
}
27-
}
28-
}
29-
]
30-
}
31-
```
32-
33-
`883313729965` is the ID of the AWS Account used by the ML cube Platform. It is important that this value is not changed. We will populate the value of `<EXTERNAL_ID>` in a later step. Give your role a name and save it.
34-
35-
Now, you will need to create the credentials through the ML cube Platform SDK or the web application.
10+
11+
You will need to create the credentials through the ML cube Platform SDK or the web application.
3612

3713
!!! example
38-
The following code will create a set of AWS credentials from the IAM Role we just created.
14+
The following code will create a set of AWS credentials for an IAM Role called `YOUR_ROLE_NAME` (change this as desired).
3915

4016
```py
4117
aws_creds = client.create_aws_integration_credentials(
@@ -45,12 +21,10 @@ Below, you will find a guide that will help you create the credentials and confi
4521
role_arn='arn:aws:iam::{{YOUR_AWS_ACCOUNT_ID}}:role/{{YOUR_ROLE_NAME}}',
4622
)
4723

48-
trust_policy = aws_creds.generate_trust_policy()
49-
print(trust_policy)
24+
print(aws_creds.trust_policy)
5025
```
5126

52-
You can call the `generate_trust_policy` function on the created credentials to obtain the **trust policy**.
53-
Edit your IAM Role and change the **trust policy** to the one you just obtained.
27+
Now, log into your AWS account and open the AWS console. Here, go to the **IAM** service, navigate to the **Roles** section and create a new role. It is important to set the **trust policy** to the one you just obtained.
5428

5529
Right now, your **IAM Role** grants no permissions. Please refer to the next sections that will explain how to set up **IAM Policies** for S3, Event Bridge and so on.
5630

0 commit comments

Comments
 (0)