{"id":311691,"date":"2020-10-19T15:00:52","date_gmt":"2020-10-19T15:00:52","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=311691"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=311691","title":{"rendered":"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 Yandex Database \u043a serverless \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0443 \u043d\u0430 Yandex Functions"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/524082\/\">\n<h2>\u0412\u0432\u043e\u0434\u043d\u0430\u044f<\/h2>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c <a href=\"https:\/\/habr.com\/ru\/post\/522126\/\" rel=\"noopener noreferrer nofollow\">\u0432\u043e\u0442 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/a>. \u0412 \u043d\u0435\u0439 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 yandex cloud functions \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430. \u0410 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u0442.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/cloud.yandex.ru\/docs\/ydb\/\" rel=\"noopener noreferrer nofollow\">Yandex Cloud Database<\/a>.<\/p>\n<h2>\u0417\u0430\u0434\u0430\u0447\u0438<\/h2>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0431\u0430\u0437\u0443 \u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c\u0430;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0451 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<\/ol>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0421\u0430\u043c\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/console.cloud.yandex.ru\/\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043d\u0441\u043e\u043b\u044c Yandex Cloud<\/a> \u043f\u043e\u0434 \u0441\u0432\u043e\u0438\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u043c. \u0417\u0430\u0442\u0435\u043c \u0432 \u043c\u0435\u043d\u044e \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Yandex Database.<\/p>\n<details class=\"spoiler\">\n<summary>\u0413\u0434\u0435 \u043d\u0430\u0439\u0442\u0438 \u043a\u043d\u043e\u043f\u043a\u0443<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5bd\/cb3\/247\/5bdcb32476d419d264e918f76848bc6f.jpg\" width=\"397\" height=\"712\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041a\u043b\u0438\u043a\u0430\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 <img loading=\"lazy\" decoding=\"async\" inline=\"true\" class=\"image image-inline\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6df\/424\/cf6\/6df424cf618078a75c3106297edbbac1.jpg\" width=\"241\" height=\"60\">. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0434\u0430\u0442\u044c \u0438\u043c\u044f \u0431\u0430\u0437\u044b \u0438 \u0442\u0438\u043f. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0438\u043f\u0430 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c Serverless, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0443 \u043d\u0430\u0441 \u043a\u0440\u0430\u0439\u043d\u0435 \u043c\u0430\u043b\u043e \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0441\u043e\u0431\u043e \u043c\u043d\u043e\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c. \u041c\u043e\u043b\u043e\u0434\u0446\u044b! \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0414\u043b\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447:<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432 \u043a \u0431\u0430\u0437\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f python (boto3);<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 (\u044d\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u042f\u043d\u0434\u0435\u043a\u0441 \u041e\u0431\u043b\u0430\u043a\u0430) \u0447\u0438\u0442\u0430\u0435\u043c <a href=\"https:\/\/cloud.yandex.ru\/docs\/iam\/quickstart-sa\" rel=\"noopener noreferrer nofollow\">\u0412\u041d\u0418\u041c\u0410\u0422\u0415\u041b\u042c\u041d\u041e<\/a> \u0432\u0432\u043e\u0434\u043d\u0443\u044e, \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0441\u0432\u043e\u044e \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u043b\u0430\u043a\u043e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0430 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u043d\u0435\u043c \u043c\u044b \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 &#171;\u0421\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0435 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u044b&#187;.<\/p>\n<details class=\"spoiler\">\n<summary>\u0413\u0434\u0435 \u043d\u0430\u0439\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0435 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u044b<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/794\/eee\/cfd\/794eeecfd917fe14aa94840b76c2e0ca.jpg\" width=\"1310\" height=\"451\"><figcaption><\/figcaption><\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a1d\/61f\/c62\/a1d61fc62ced8b9386e85f1d80d9f309.jpg\" width=\"307\" height=\"227\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0441 \u0420\u041e\u041b\u042c\u042e editor.  \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u043c \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441 \u043d\u0430\u0448\u0435\u0439 \u0431\u0430\u0437\u043e\u0439.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0432 \u0438\u0442\u043e\u0433\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ab8\/25c\/a96\/ab825ca96778611161b5e5481d6ef80d.jpg\" width=\"957\" height=\"306\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u044e\u0447&#187;  \u0438 \u0432 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c &#171;\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043b\u044e\u0447&#187;. \u041e\u0431\u0430 \u043a\u043b\u044e\u0447\u0438\u043a\u0430 \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c. \u0414\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u043d\u0430\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e DocAPI \u043a Yandex Cloud Database.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043d\u043e\u043f\u043a\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439<\/summary>\n<div class=\"spoiler__content\">\n<\/div>\n<\/details>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/h2>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a Yandex Database), \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 &#8212; &#171;\u0421\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f&#187;. \u0421\u0442\u0430\u0432\u0438\u043c 3.7 preview (\u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439).<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/05e\/e5a\/814\/05ee5a814d2a69e966c2d359a19af1f6.jpg\" width=\"521\" height=\"577\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b &#8216;requirements.txt&#8217;, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u043e\u043d\u0438 \u0441\u0442\u0430\u043d\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0412\u043d\u0443\u0442\u0440\u044c \u043f\u0438\u0448\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 boto3, \u044d\u0442\u043e SDK \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 AWS, \u043d\u043e \u043e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a Yandex Database \u043a\u0430\u043a DynamoDB. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c 2 \u0444\u0430\u0439\u043b\u0430 &#8212; \u0431\u043e\u0442 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f29\/8ed\/083\/f298ed08339ca8882bd4c833bf922685.jpg\" width=\"787\" height=\"638\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0443\u043c\u0435\u0435\u043c \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438!<\/p>\n<h2>\u041f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u0434\u0435<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0435. \u042f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c\/\u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 1 \u0440\u0430\u0437 \u0438 \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u044c \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438. \u041d\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<details class=\"spoiler\">\n<summary>\u041e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">import json import logging import os  import boto3 from botocore.exceptions import ClientError  def read_user(user_id, dynamodb=None):     if not dynamodb:         dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )     table = dynamodb.Table('Users')     try:         response = table.get_item(Key={'user_id': str(user_id)})     except ClientError as e:         print(e.response['Error']['Message'])     else:         return response  def create_user(user_id, first_name, dynamodb=None):     if not dynamodb:         dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )      table = dynamodb.Table('Users')     response = table.put_item(         Item={         'user_id': str(user_id),         'first_name': str(first_name)         }     )     return response  def handler(event, context):     dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )     body = json.loads(event['body'])     user_query = read_user(body['message']['chat']['id'], dynamodb)     if 'Item' not in user_query:         create_user(body['message']['chat']['id'], body['message']['from']['first_name'], dynamodb)         return {             'statusCode': 200,             'headers': {                 'Content-Type': 'application\/json'             },             'body': json.dumps({                 'method': 'sendMessage',                 'chat_id': body['message']['chat']['id'],                 'text':  '\u041f\u0440\u0438\u0432\u0435\u0442! \u042f \u0442\u0435\u0431\u044f \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043b :)'             }),             'isBase64Encoded': False         }     user = user_query['Item']     return {         'statusCode': 200,         'headers': {             'Content-Type': 'application\/json'         },         'body': json.dumps({             'method': 'sendMessage',             'chat_id': body['message']['chat']['id'],             'text':  f'\u041f\u0440\u0438\u0432\u0435\u0442, {user[\"first_name\"]}!'         }),         'isBase64Encoded': False     }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c 3 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u041e\u0431\u0430 KEY \u0443 \u043d\u0430\u0441 \u0431\u0435\u0440\u0443\u0442\u044c\u0441\u044f \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435, \u0430 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (Document API).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee3\/b72\/3fa\/ee3b723fad210bdc92469a12f7958470.jpg\" width=\"842\" height=\"263\"><figcaption><\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0413\u0434\u0435 \u043b\u0435\u0436\u0438\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/125\/5b0\/1f0\/1255b01f04223932bb885b89dc798662.jpg\" width=\"1103\" height=\"612\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0421\u0430\u043c \u0440\u0435\u0441\u0443\u0440\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"python\">dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u043a\u043e\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0438\u0437 boto3 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0438 \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0422\u0443\u0442 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 endpoint_url &#8212; \u0430\u0434\u0440\u0435\u0441 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0438 \u0434\u0432\u0430 \u043a\u043b\u044e\u0447\u0430 &#8212; \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430.<\/p>\n<p>\u0423\u0440\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435!<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0435<\/h2>\n<p>\u041d\u0430\u0448\u0435\u0439 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0442\u0435\u043d\u0438\u0435\/\u0437\u0430\u043f\u0438\u0441\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u043e \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439, \u0435\u0451 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e 1 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">import os  import boto3   def create_user_table():     dynamodb = boto3.resource(         'dynamodb',         endpoint_url=USER_STORAGE_URL,         region_name = 'us-east-1',         aws_access_key_id = AWS_ACCESS_KEY_ID,         aws_secret_access_key = AWS_SECRET_ACCESS_KEY         )     table = dynamodb.create_table(         TableName = 'Users',         KeySchema=[             {                 'AttributeName': 'user_id',                 'KeyType': 'HASH' # Partition key             }         ],         AttributeDefinitions=[             {'AttributeName': 'user_id', 'AttributeType': 'S'}         ]     )     return table  create_user_table()<\/code><\/pre>\n<p>\u042f \u0435\u0451 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 1 \u0440\u0430\u0437 \u0438 \u0431\u043e\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u0430. \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u044d\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0435\u0451, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f. \u041d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u0430\u044f \u0442\u0435\u043c\u0430.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f dynamodb.create_table. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b(TableName), \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b (KeySchema) \u0438 \u0442\u0438\u043f \u044d\u0442\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 (AttributeDefinitions). \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u0434. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439.<\/p>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f<\/h2>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0430\u0439\u043b\u0430 main.py \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430:<\/p>\n<pre><code class=\"python\">def read_user(user_id, dynamodb=None):     if not dynamodb:         dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )     table = dynamodb.Table('Users')     try:         response = table.get_item(Key={'user_id': str(user_id)})     except ClientError as e:         print(e.response['Error']['Message'])     else:         return response<\/code><\/pre>\n<p>\u041e\u043d\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 user_id (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e id \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0447\u0430\u0442\u0430 \u0441 \u0431\u043e\u0442\u043e\u043c) \u0438 \u0440\u0435\u0441\u0443\u0440\u0441 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e).<\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 user_id \u0438 first_name \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u044e\u0437\u0435\u0440\u043e\u0432, \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0435 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u0440\u043e\u0433\u043e:<\/p>\n<pre><code class=\"python\">def create_user(user_id, first_name, dynamodb=None):     if not dynamodb:         dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )      table = dynamodb.Table('Users')     response = table.put_item(         Item={         'user_id': str(user_id),         'first_name': str(first_name)         }     )     return response<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code>def handler(event, context):     dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )     body = json.loads(event['body'])     user_query = read_user(body['message']['chat']['id'], dynamodb)     if 'Item' not in user_query:         create_user(body['message']['chat']['id'], body['message']['from']['first_name'], dynamodb)         return {             'statusCode': 200,             'headers': {                 'Content-Type': 'application\/json'             },             'body': json.dumps({                 'method': 'sendMessage',                 'chat_id': body['message']['chat']['id'],                 'text':  '\u041f\u0440\u0438\u0432\u0435\u0442! \u042f \u0442\u0435\u0431\u044f \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043b :)'             }),             'isBase64Encoded': False         }     user = user_query['Item']     return {         'statusCode': 200,         'headers': {             'Content-Type': 'application\/json'         },         'body': json.dumps({             'method': 'sendMessage',             'chat_id': body['message']['chat']['id'],             'text':  f'\u041f\u0440\u0438\u0432\u0435\u0442, {user[\"first_name\"]}!'         }),         'isBase64Encoded': False     }<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 10 \u0438 12 \u0441\u0442\u0440\u043e\u043a\u0443. \u0412 10 \u0441\u0442\u0440\u043e\u043a\u0435 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0437\u0430\u0442\u0435\u043c \u0432 11 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0435\u0433\u043e. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0432 12 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/76b\/d18\/afe\/76bd18afed73a04cd54ed29364829bb7.jpg\" width=\"462\" height=\"315\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451, \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u0432\u0430\u043c \u043d\u0435 \u043d\u0430\u0441\u043a\u0443\u0447\u0438\u043b\u043e. \u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0448\u0443 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0439 \u043e\u0442\u0437\u044b\u0432\u044b \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u043f\u043b\u0430\u043d\u0430\u043c.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u043a\u0430\u043d\u0430\u043b\u0430\u043c <a href=\"https:\/\/t.me\/yandexcloud_chat\" rel=\"noopener noreferrer nofollow\">\u042f\u043d\u0434\u0435\u043a\u0441 \u041e\u0431\u043b\u0430\u043a\u0430<\/a> \u0438 <a href=\"https:\/\/t.me\/YandexCloudFunctions\" rel=\"noopener noreferrer nofollow\">Yandex Cloud Functions<\/a>, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0438\u0445 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0447\u0435\u043d\u044c \u0442\u043e\u043b\u043a\u043e\u0432\u043e \u0432\u0441\u0435 \u0440\u0430\u0437\u044a\u044f\u0441\u043d\u044f\u0435\u0442.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u044f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043c\u0435\u043d\u044e \u0438 \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0437\u0430\u043a\u0430\u0437\u044b.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/524082\/\"> https:\/\/habr.com\/ru\/post\/524082\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/524082\/\">\n<h2>\u0412\u0432\u043e\u0434\u043d\u0430\u044f<\/h2>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c <a href=\"https:\/\/habr.com\/ru\/post\/522126\/\" rel=\"noopener noreferrer nofollow\">\u0432\u043e\u0442 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/a>. \u0412 \u043d\u0435\u0439 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 yandex cloud functions \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430. \u0410 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u0442.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/cloud.yandex.ru\/docs\/ydb\/\" rel=\"noopener noreferrer nofollow\">Yandex Cloud Database<\/a>.<\/p>\n<h2>\u0417\u0430\u0434\u0430\u0447\u0438<\/h2>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0431\u0430\u0437\u0443 \u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c\u0430;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0451 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<\/ol>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0421\u0430\u043c\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/console.cloud.yandex.ru\/\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043d\u0441\u043e\u043b\u044c Yandex Cloud<\/a> \u043f\u043e\u0434 \u0441\u0432\u043e\u0438\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u043c. \u0417\u0430\u0442\u0435\u043c \u0432 \u043c\u0435\u043d\u044e \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Yandex Database.<\/p>\n<details class=\"spoiler\">\n<summary>\u0413\u0434\u0435 \u043d\u0430\u0439\u0442\u0438 \u043a\u043d\u043e\u043f\u043a\u0443<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"bordered\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041a\u043b\u0438\u043a\u0430\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 . \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0434\u0430\u0442\u044c \u0438\u043c\u044f \u0431\u0430\u0437\u044b \u0438 \u0442\u0438\u043f. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0438\u043f\u0430 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c Serverless, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0443 \u043d\u0430\u0441 \u043a\u0440\u0430\u0439\u043d\u0435 \u043c\u0430\u043b\u043e \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0441\u043e\u0431\u043e \u043c\u043d\u043e\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c. \u041c\u043e\u043b\u043e\u0434\u0446\u044b! \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0414\u043b\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447:<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432 \u043a \u0431\u0430\u0437\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f python (boto3);<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 (\u044d\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u042f\u043d\u0434\u0435\u043a\u0441 \u041e\u0431\u043b\u0430\u043a\u0430) \u0447\u0438\u0442\u0430\u0435\u043c <a href=\"https:\/\/cloud.yandex.ru\/docs\/iam\/quickstart-sa\" rel=\"noopener noreferrer nofollow\">\u0412\u041d\u0418\u041c\u0410\u0422\u0415\u041b\u042c\u041d\u041e<\/a> \u0432\u0432\u043e\u0434\u043d\u0443\u044e, \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0441\u0432\u043e\u044e \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u043b\u0430\u043a\u043e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0430 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u043d\u0435\u043c \u043c\u044b \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 &#171;\u0421\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0435 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u044b&#187;.<\/p>\n<details class=\"spoiler\">\n<summary>\u0413\u0434\u0435 \u043d\u0430\u0439\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0435 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u044b<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0441 \u0420\u041e\u041b\u042c\u042e editor.  \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u043c \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441 \u043d\u0430\u0448\u0435\u0439 \u0431\u0430\u0437\u043e\u0439.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0432 \u0438\u0442\u043e\u0433\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u044e\u0447&#187;  \u0438 \u0432 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c &#171;\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043b\u044e\u0447&#187;. \u041e\u0431\u0430 \u043a\u043b\u044e\u0447\u0438\u043a\u0430 \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c. \u0414\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u043d\u0430\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e DocAPI \u043a Yandex Cloud Database.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043d\u043e\u043f\u043a\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439<\/summary>\n<div class=\"spoiler__content\">\n<\/div>\n<\/details>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/h2>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a Yandex Database), \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 &#8212; &#171;\u0421\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f&#187;. \u0421\u0442\u0430\u0432\u0438\u043c 3.7 preview (\u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439).<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b &#8216;requirements.txt&#8217;, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u043e\u043d\u0438 \u0441\u0442\u0430\u043d\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0412\u043d\u0443\u0442\u0440\u044c \u043f\u0438\u0448\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 boto3, \u044d\u0442\u043e SDK \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 AWS, \u043d\u043e \u043e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a Yandex Database \u043a\u0430\u043a DynamoDB. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c 2 \u0444\u0430\u0439\u043b\u0430 &#8212; \u0431\u043e\u0442 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0443\u043c\u0435\u0435\u043c \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438!<\/p>\n<h2>\u041f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u0434\u0435<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0435. \u042f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c\/\u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 1 \u0440\u0430\u0437 \u0438 \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u044c \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438. \u041d\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<details class=\"spoiler\">\n<summary>\u041e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">import json import logging import os  import boto3 from botocore.exceptions import ClientError  def read_user(user_id, dynamodb=None):     if not dynamodb:         dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )     table = dynamodb.Table('Users')     try:         response = table.get_item(Key={'user_id': str(user_id)})     except ClientError as e:         print(e.response['Error']['Message'])     else:         return response  def create_user(user_id, first_name, dynamodb=None):     if not dynamodb:         dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )      table = dynamodb.Table('Users')     response = table.put_item(         Item={         'user_id': str(user_id),         'first_name': str(first_name)         }     )     return response  def handler(event, context):     dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )     body = json.loads(event['body'])     user_query = read_user(body['message']['chat']['id'], dynamodb)     if 'Item' not in user_query:         create_user(body['message']['chat']['id'], body['message']['from']['first_name'], dynamodb)         return {             'statusCode': 200,             'headers': {                 'Content-Type': 'application\/json'             },             'body': json.dumps({                 'method': 'sendMessage',                 'chat_id': body['message']['chat']['id'],                 'text':  '\u041f\u0440\u0438\u0432\u0435\u0442! \u042f \u0442\u0435\u0431\u044f \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043b :)'             }),             'isBase64Encoded': False         }     user = user_query['Item']     return {         'statusCode': 200,         'headers': {             'Content-Type': 'application\/json'         },         'body': json.dumps({             'method': 'sendMessage',             'chat_id': body['message']['chat']['id'],             'text':  f'\u041f\u0440\u0438\u0432\u0435\u0442, {user[\"first_name\"]}!'         }),         'isBase64Encoded': False     }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c 3 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u041e\u0431\u0430 KEY \u0443 \u043d\u0430\u0441 \u0431\u0435\u0440\u0443\u0442\u044c\u0441\u044f \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435, \u0430 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (Document API).<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0413\u0434\u0435 \u043b\u0435\u0436\u0438\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0421\u0430\u043c \u0440\u0435\u0441\u0443\u0440\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"python\">dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u043a\u043e\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0438\u0437 boto3 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0438 \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0422\u0443\u0442 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 endpoint_url &#8212; \u0430\u0434\u0440\u0435\u0441 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0438 \u0434\u0432\u0430 \u043a\u043b\u044e\u0447\u0430 &#8212; \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430.<\/p>\n<p>\u0423\u0440\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435!<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0435<\/h2>\n<p>\u041d\u0430\u0448\u0435\u0439 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0442\u0435\u043d\u0438\u0435\/\u0437\u0430\u043f\u0438\u0441\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u043e \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439, \u0435\u0451 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e 1 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">import os  import boto3   def create_user_table():     dynamodb = boto3.resource(         'dynamodb',         endpoint_url=USER_STORAGE_URL,         region_name = 'us-east-1',         aws_access_key_id = AWS_ACCESS_KEY_ID,         aws_secret_access_key = AWS_SECRET_ACCESS_KEY         )     table = dynamodb.create_table(         TableName = 'Users',         KeySchema=[             {                 'AttributeName': 'user_id',                 'KeyType': 'HASH' # Partition key             }         ],         AttributeDefinitions=[             {'AttributeName': 'user_id', 'AttributeType': 'S'}         ]     )     return table  create_user_table()<\/code><\/pre>\n<p>\u042f \u0435\u0451 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 1 \u0440\u0430\u0437 \u0438 \u0431\u043e\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u0430. \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u044d\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0435\u0451, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f. \u041d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u0430\u044f \u0442\u0435\u043c\u0430.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f dynamodb.create_table. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b(TableName), \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b (KeySchema) \u0438 \u0442\u0438\u043f \u044d\u0442\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 (AttributeDefinitions). \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u0434. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439.<\/p>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f<\/h2>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0430\u0439\u043b\u0430 main.py \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430:<\/p>\n<pre><code class=\"python\">def read_user(user_id, dynamodb=None):     if not dynamodb:         dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )     table = dynamodb.Table('Users')     try:         response = table.get_item(Key={'user_id': str(user_id)})     except ClientError as e:         print(e.response['Error']['Message'])     else:         return response<\/code><\/pre>\n<p>\u041e\u043d\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 user_id (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e id \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0447\u0430\u0442\u0430 \u0441 \u0431\u043e\u0442\u043e\u043c) \u0438 \u0440\u0435\u0441\u0443\u0440\u0441 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e).<\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 user_id \u0438 first_name \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u044e\u0437\u0435\u0440\u043e\u0432, \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0435 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u0440\u043e\u0433\u043e:<\/p>\n<pre><code class=\"python\">def create_user(user_id, first_name, dynamodb=None):     if not dynamodb:         dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )      table = dynamodb.Table('Users')     response = table.put_item(         Item={         'user_id': str(user_id),         'first_name': str(first_name)         }     )     return response<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code>def handler(event, context):     dynamodb = boto3.resource(                 'dynamodb',                 endpoint_url=os.environ.get('USER_STORAGE_URL'),                 region_name = 'us-east-1',                 aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID'),                 aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')                 )     body = json.loads(event['body'])     user_query <\/code><\/pre>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-311691","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=311691"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311691\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=311691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=311691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=311691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}