1
1
Running this sample with the managed YDB instance in Yandex Cloud
2
2
---
3
3
4
- (0) Install the yc command line tool
4
+ (0) Install the required Python dependencies
5
+
6
+ python3 -m pip install iso8601
7
+ python3 -m pip install 'ydb[ yc] '
8
+
9
+ (1) Install the yc command line tool
5
10
6
11
https://cloud.yandex.ru/docs/cli/operations/install-cli
7
12
8
- (1 ) Create the service account using the YC Web Console, and assign it the ydb.editor role.
13
+ (2 ) Create the service account using the YC Web Console, and assign it the ydb.editor role.
9
14
10
15
Alternatively use the following shell snippet:
11
16
@@ -21,7 +26,7 @@ export SA_ID=`yc iam service-account get --name $SA_NAME | sed -n 's/^id: \(.*\)
21
26
yc resource-manager folder add-access-binding $YC_FOLDER --role ydb.editor --subject serviceAccount:$SA_ID
22
27
```
23
28
24
- (2 ) Generate the service account key to be used for authentication.
29
+ (3 ) Generate the service account key to be used for authentication.
25
30
26
31
Note: unfortunately, right now YC Web Console does not offer a way to generate the SA key
27
32
with its Web interface.
@@ -30,7 +35,7 @@ with its Web interface.
30
35
yc iam key create --service-account-name $SA_NAME --output $HOME /key-ydb-sa-0.json
31
36
```
32
37
33
- (3 ) Obtain the endpoint and database path from the Web Console.
38
+ (4 ) Obtain the endpoint and database path from the Web Console.
34
39
35
40
Alternatively, use the following command to grab the required data in the shell:
36
41
@@ -40,7 +45,7 @@ yc ydb db get --name ydb1
40
45
41
46
` ydb1 ` value in the command above is the logical name of the YDB managed database.
42
47
43
- (4 ) Run the sample:
48
+ (5 ) Run the sample:
44
49
45
50
``` bash
46
51
# Set the path to the service account key file
0 commit comments