{"id":388760,"date":"2024-06-29T08:09:15","date_gmt":"2024-06-29T08:09:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=388760"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=388760","title":{"rendered":"<span>\u041d\u0430\u0432\u044b\u043a \u0410\u043b\u0438\u0441\u044b\u00a0\u043d\u0430 serverless \u0432\u00a0Yandex.Cloud<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c96\/94c\/265\/c9694c26539112265642908672355357.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c96\/94c\/265\/c9694c26539112265642908672355357.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0440\u0443\u0434\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0435, \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0451 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043d\u0430\u0432\u044b\u043a\u0430 \u0410\u043b\u0438\u0441\u044b, \u0430 \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043d\u0430 serverless-\u0441\u0442\u0435\u043a\u0435 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0438 \u043d\u043e\u0432\u0438\u0447\u043a\u0443 \u0431\u044b\u043b\u043e \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u043e, \u0438 \u0437\u0430\u044f\u0434\u043b\u043e\u043c\u0443 \u0434\u0435\u0432\u0435\u043b\u043e\u043f\u0435\u0440\u0443 \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u043a\u0443\u0447\u0430\u0442\u044c. \u041d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043e\u0441\u0438\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043d\u0430\u0432\u044b\u043a \u043d\u0430 Go. \u0418 \u0431\u0443\u0434\u0435\u0442 \u0443 \u043c\u0435\u043d\u044f \u0441\u0435\u043c\u0435\u0439\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b.\u00a0<\/p>\n<h2>\u041a\u0430\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0435\u043b\u0430\u0435\u043c<\/h2>\n<p>\u041c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043d\u0430\u0432\u044b\u043a \u0434\u043b\u044f \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430 \u00ab\u0421\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b\u00bb. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0410\u043b\u0438\u0441\u044b \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u0434\u0435\u043b \u0447\u0435\u0440\u0435\u0437 \u0441\u0430\u0439\u0442 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u0412\u043e\u0442 \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f.\u00a0<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61078e4f920526a288c7e19a\" data-style=\"\" id=\"61078e4f920526a288c7e19a\" width=\"\"><\/div>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u044d\u0442\u0430\u043f\u043d\u043e \u043f\u0440\u043e\u0439\u0434\u0451\u043c \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0432\u044b\u043a\u0430 \u2014 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0440\u0435\u0434\u044b \u0434\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0435\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/p>\n<h2>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h2>\n<p>\u041a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 serverless-\u0441\u0442\u0435\u043a\u0435 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0410\u043b\u0438\u0441\u0443 \u2014 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u042f\u043d\u0434\u0435\u043a\u0441.\u0414\u0438\u0430\u043b\u043e\u0433\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043a\u0430\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Cloud Functions, \u043a\u0443\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434.\u00a0\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f06\/706\/f68\/f06706f68830ea44218dc0a440010936.png\" width=\"977\" height=\"479\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f06\/706\/f68\/f06706f68830ea44218dc0a440010936.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421 \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u042d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f serverless \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u2014 pay-as-you-go. \u041d\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u2014 \u043d\u0435\u0442 \u0434\u0435\u043d\u0435\u0436\u043d\u044b\u0445 \u0442\u0440\u0430\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043b\u0430\u0442\u0430 \u0432\u0437\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0437\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432. \u0412 \u044d\u0442\u043e\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 serverless \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u0422\u0430\u043a\u0436\u0435 \u0432 serverless-\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 load-balancer \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u2014 \u0438\u0445 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Yandex.Cloud.\u00a0\u00a0<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u00a0\u0440\u0430\u0431\u043e\u0447\u0443\u044e\u00a0\u0441\u0440\u0435\u0434\u0443<\/h2>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c serverless-\u0441\u0442\u0435\u043a Yandex.Cloud \u2014 \u0432\u0441\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u0434\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 Yandex Database, \u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 API Gateway. \u0422\u0430\u043a \u043c\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u043c \u0441\u0435\u0431\u044f \u043e\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043c \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u044b.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 Yandex.Cloud:\u00a0\u00a0<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/cloud.yandex.ru\/services\/functions\" rel=\"noopener noreferrer nofollow\">Yandex Cloud Functions<\/a> \u2014 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u0432\u0438\u0434\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/cloud.yandex.ru\/services\/ydb\" rel=\"noopener noreferrer nofollow\">Yandex Database<\/a> \u2014 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0430\u044f NewSQL \u0421\u0423\u0411\u0414 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439      \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/cloud.yandex.ru\/services\/api-gateway\" rel=\"noopener noreferrer nofollow\">Yandex Cloud API Gateway<\/a> \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f API-\u0448\u043b\u044e\u0437\u043e\u0432. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e OpenAPI 3.0 \u0438 \u043d\u0430\u0431\u043e\u0440 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/cloud.yandex.ru\/docs\/storage\/\" rel=\"noopener noreferrer nofollow\">Yandex Object Storage<\/a> \u2014 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/cloud.yandex.ru\/docs\/kms\/\" rel=\"noopener noreferrer nofollow\">Yandex KMS<\/a> \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438 \u0438 \u0434\u0435\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/cloud.yandex.ru\/docs\/cli\/\" rel=\"noopener noreferrer nofollow\">CLI Yandex<\/a> \u2014 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 Yandex;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/yandex.ru\/dev\/passport\/\" rel=\"noopener noreferrer nofollow\">API Yandex ID<\/a>\u00a0+\u00a0<a href=\"https:\/\/yandex.ru\/dev\/oauth\/\" rel=\"noopener noreferrer nofollow\">OAuth 2.0<\/a> \u2014 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.\u00a0<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0438 \u043f\u0430\u043a\u0435\u0442\u044b:\u00a0\u00a0<\/p>\n<ul>\n<li>\n<p><a href=\"http:\/\/github.com\/gorilla\/sessions\" rel=\"noopener noreferrer nofollow\"><u>Gorilla<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/goswagger.io\/install.html\" rel=\"noopener noreferrer nofollow\"><u>go-swagger<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.npmjs.com\/package\/api-spec-converter\" rel=\"noopener noreferrer nofollow\"><u>api-spec-converter<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/stedolan.github.io\/jq\/\" rel=\"noopener noreferrer nofollow\"><u>jq<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/terraform.io\/\" rel=\"noopener noreferrer nofollow\"><u>Terraform<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/aws.amazon.com\/ru\/cli\/\" rel=\"noopener noreferrer nofollow\"><u>AWS command line tool<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p>Node.js\u00a0<\/p>\n<\/li>\n<li>\n<p>Go\u00a0<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443\u00a0<a href=\"http:\/\/github.com\/contiamo\/restful-react\" rel=\"noopener noreferrer nofollow\">restful-react\u00a0<\/a>\u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u043c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u043c Node\/JS\/Go \u0438 \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u043d\u0435\u0439 \u0437\u0430\u0440\u0430\u043d\u0435\u0435.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 serverless-\u0441\u0442\u0435\u043a\u043e\u043c Yandex.Cloud, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 Yandex.Cloud \u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438.\u00a0\u00a0<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/h2>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u0421\u0435\u0440\u0432\u0438\u0441 Cloud Functions \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0435\u0451 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u041f\u0440\u0438\u0447\u0451\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u2014 \u043c\u043e\u0434\u0443\u043b\u0438\u00a0<strong>mod\u00a0<\/strong>\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u00a0<strong>dep<\/strong>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/cloud.yandex.ru\/docs\/functions\/lang\/golang\/dependencies\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\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 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/tree\/master\/serverless\/alice-shareable-todolist\/app\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a>\u00a0\u0444\u0430\u0439\u043b go.mod \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0412 \u043d\u0451\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u044d\u043a\u0435\u043d\u0434\u0430. \u041d\u0430\u0448 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043d\u0443\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434:\u00a0\u00a0<\/p>\n<pre><code class=\"go\">require ( github.com\/go-openapi\/errors v0.20.0 github.com\/go-openapi\/loads v0.20.2 github.com\/go-openapi\/runtime v0.19.26 github.com\/go-openapi\/spec v0.20.3 github.com\/go-openapi\/strfmt v0.20.0 github.com\/go-openapi\/swag v0.19.14 github.com\/go-openapi\/validate v0.20.2 github.com\/golang\/protobuf v1.4.3 \/\/ indirect github.com\/google\/go-cmp v0.5.4 \/\/ indirect github.com\/gorilla\/securecookie v1.1.1 github.com\/gorilla\/sessions v1.2.1 github.com\/jessevdk\/go-flags v1.4.0 github.com\/stretchr\/testify v1.7.0 github.com\/texttheater\/golang-levenshtein v1.0.1 github.com\/yandex-cloud\/go-genproto v0.0.0-20210211094722-b4ab90f1132d github.com\/yandex-cloud\/go-sdk v0.0.0-20210211095836-1e646debd48a github.com\/yandex-cloud\/ydb-go-sdk v0.0.0-20210203152813-253585cf1c0d go.uber.org\/zap v1.16.0 golang.org\/x\/net v0.0.0-20210119194325-5f4716e94777 google.golang.org\/grpc v1.35.0 \/\/ indirect )<\/code><\/pre>\n<h2>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e: \u043d\u0430\u043f\u0438\u0448\u0435\u043c\u00a0<strong>hello world<\/strong>, \u043d\u043e \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u0435\u043b\u0430\u044e\u0442 \u0431\u0435\u0437 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a:\u00a0<\/p>\n<pre><code class=\"go\">func Handler(_ context.Context, req map[string]string) (string, error) {  return fmt.Sprintf(\"Hello, %s!\", req[\"name\"])  } <\/code><\/pre>\n<p>\u041d\u043e \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043e\u043d\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u00ab\u0432\u044b\u0442\u0435\u0441\u043d\u0435\u043d\u0430\u00bb. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0441 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043a\u0435\u0448\u0435\u0439 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u00ab\u0442\u044f\u0436\u0451\u043b\u044b\u0445\u00bb \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0411\u0414. \u041d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0430\u043c \u0432\u0430\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043f\u043e\u0442\u0435\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c, \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u00a0<a href=\"https:\/\/github.com\/avhaliullin\/code-fragments\/blob\/main\/dummy-handler.go\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u041a\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 Cloud Functions \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u2014 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u0434\u0440\u0443\u0433 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0440\u0430\u0441\u0442\u0451\u0442 \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c cold start. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043d\u0443\u043b\u044f.<\/p>\n<p>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0434\u043b\u044f Go \u044d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u043e\u0445\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044f\u0437\u044b\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 AOT-, \u0430 \u043d\u0435 JIT-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u0438 \u0432 \u043e\u0431\u0449\u0435\u043c \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0435.<\/p>\n<p>\u041d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c \u2014 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0447\u0442\u043e \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0430\u0440\u0443 \u00ab\u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0445\u00bb \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439:\u00a0<\/p>\n<ol>\n<li>\n<p>\u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u2014 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c KMS, \u043e\u043d, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e, \u043d\u043e \u044d\u0442\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0445\u043e\u0434 \u043f\u043e \u0441\u0435\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u043e Yandex Database (\u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435). \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u043d\u043e \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u2014 \u0438 \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043a\u0440\u0430\u0441\u0442\u044c \u0434\u0440\u0430\u0433\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043c\u044b \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443\u00a0<strong>app<\/strong> \u0438 \u0437\u0430\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u044d\u0442\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439\u00a0<strong>singleton<\/strong>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 cold start, \u0430 \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e, \u043a\u0430\u043a \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0412\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app\/web_handler.go\" rel=\"noopener noreferrer nofollow\">\u0432\u043e\u0442 \u0442\u0430\u043a.<\/a>\u00a0<\/p>\n<h2>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 Terraform<\/h2>\n<p>\u041f\u0440\u043e\u0441\u0442\u044b\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u041d\u043e \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0435\u043b\u0438\u043a, \u0438 \u043a\u043e\u0434\u0430 \u0432 \u043d\u0451\u043c \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f Terraform. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c Terraform-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0434\u0435\u043f\u043b\u043e\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app.tf\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435.<\/a><\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430 \u0434\u0435\u043f\u043b\u043e\u0439 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. Terraform \u0434\u0435\u043f\u043b\u043e\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0438 \u043c\u044b \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0432\u044b\u0437\u0432\u0430\u0432 \u0435\u0451 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<a href=\"https:\/\/cloud.yandex.ru\/docs\/functions\/concepts\/function-invoke\" rel=\"noopener noreferrer nofollow\">yc serverless function invoke<\/a>. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f OAuth token \u2014 \u044d\u0442\u043e \u0442\u043e\u043a\u0435\u043d, \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0439 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u043f\u0440\u0438 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 OAuth token, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u00a0<a href=\"https:\/\/cloud.yandex.ru\/docs\/iam\/concepts\/authorization\/oauth-token\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0421\u0440\u043e\u043a \u0436\u0438\u0437\u043d\u0438 OAuth-\u0442\u043e\u043a\u0435\u043d\u0430 \u2014 \u043e\u0434\u0438\u043d \u0433\u043e\u0434. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 OAuth-\u0442\u043e\u043a\u0435\u043d \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043d\u0430 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 Terraform-\u0440\u0435\u0446\u0435\u043f\u0442 \u0434\u043b\u044f\u00a0<a href=\"https:\/\/github.com\/avhaliullin\/code-fragments\/blob\/main\/dummy-app.tf\" rel=\"noopener noreferrer nofollow\">hello world \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430<\/a>:\u00a0<\/p>\n<pre><code>## \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c:  terraform init --var yc-token=&lt;OAuth-\u0442\u043e\u043a\u0435\u043d \u043e\u0431\u043b\u0430\u043a\u0430>  --var folder-id=&lt;id folder \u0432 Yandex.Cloud>  ## \u0414\u0435\u043f\u043b\u043e\u0438\u043c:  terraform apply --var yc-token=&lt;OAuth-\u0442\u043e\u043a\u0435\u043d \u043e\u0431\u043b\u0430\u043a\u0430>  --var folder-id=&lt;id folder \u0432 Yandex.Cloud> <\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0434\u0435\u043f\u043b\u043e\u0439 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f, Terraform \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0442\u0432\u0435\u0442:\u00a0<\/p>\n<pre><code class=\"bash\">Apply complete! Resources: 1 added, 0 changed, 0 destroyed.\u00a0 Outputs:\u00a0 function-id = \"d4e3rf325cn81ckd5484\"\u00a0<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 function-id, \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u0435\u0451 \u0440\u0430\u0431\u043e\u0442\u044b:\u00a0\u00a0<\/p>\n<pre><code class=\"bash\">yc serverless function invoke d4e3rf325cn81ckd5484\u00a0<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0432 OAuth-\u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Yandex.Cloud \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u042f\u043d\u0434\u0435\u043a\u0441.OAuth.\u00a0<\/p>\n<pre><code class=\"bash\">terraform apply -var-file .\/variables.json -var yc-token=&lt;OAuth token><\/code><\/pre>\n<h2>\u0413\u043e\u0442\u043e\u0432\u0438\u043c\u00a0\u0431\u0430\u0437\u0443\u00a0\u0434\u0430\u043d\u043d\u044b\u0445\u00a0<\/h2>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0443\u044e NewSQL \u0421\u0423\u0411\u0414 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u2014 Yandex Database (YDB). \u042d\u0442\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u042f\u043d\u0434\u0435\u043a\u0441\u0430. YDB \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u0438 ACID-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043b\u0435\u0433\u043a\u0430 \u0432 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>\u041d\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u043e\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u0436\u0438\u043c \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0414\u043e \u043e\u043a\u0442\u044f\u0431\u0440\u044f 2021 \u0433\u043e\u0434\u0430 \u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0442\u0430\u0440\u0438\u0444\u0435 \u043c\u0438\u043b\u043b\u0438\u043e\u043d \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432 \u043c\u0435\u0441\u044f\u0446 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e Yandex Database \u043c\u043e\u0436\u043d\u043e\u00a0<a href=\"https:\/\/habr.com\/ru\/post\/562746\/\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0443 \u043c\u043e\u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0438<\/a>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0430\u0432\u044b\u043a\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0440\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b:\u00a0\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/aab\/bc1\/e20\/aabbc1e20fcf39373ee0228c814d4d0d.png\" width=\"1726\" height=\"780\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aab\/bc1\/e20\/aabbc1e20fcf39373ee0228c814d4d0d.png\"\/><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>User \u2014 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u0435\u043b;<\/p>\n<\/li>\n<li>\n<p>TODOList_ACL \u2014 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u0432\u044f\u0437\u0438. \u041e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430 \u043d\u0430\u043c, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>TODOList \u2014 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u0435\u043b.\u00a0<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"sql\">CREATE TABLE `user`  (      id string,      name utf8,      yandex_avatar_id string,      PRIMARY KEY (id)  );   CREATE TABLE `todolist_acl`  (      user_id string,      mode string,      list_id string,      alias utf8,      accepted bool,      inviter string,      PRIMARY KEY (list_id, user_id),      INDEX UserToListACL GLOBAL ON (user_id)  );   CREATE TABLE `todolist`  (      id string,      owner_user_id string,      items Json,      PRIMARY KEY (id)  );   COMMIT; <\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/439\/9fe\/d11\/4399fed11783121561dcf2fb0f0e3f3e.png\" width=\"977\" height=\"550\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/439\/9fe\/d11\/4399fed11783121561dcf2fb0f0e3f3e.png\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u041f\u0438\u0448\u0435\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445\u00a0<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0417\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u044d\u0442\u043e\u0439\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/tree\/master\/serverless\/alice-shareable-todolist\/app\/db\" rel=\"noopener noreferrer nofollow\">\u043f\u0430\u043f\u043a\u0438<\/a>\u00a0\u0444\u0430\u0439\u043b\u044b \u0441 \u043a\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0438\u0445 \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435\u00a0<a href=\"https:\/\/console.cloud.yandex.ru\/folders\/b1gv2p8natinciivipeu\/ydb\" rel=\"noopener noreferrer nofollow\">\u0444\u0430\u0439\u043b\u044b<\/a>\u00a0\u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0434. \u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u00a0<a href=\"https:\/\/github.com\/avhaliullin\/code-fragments\/blob\/main\/config.go\" rel=\"noopener noreferrer nofollow\"><strong>config<\/strong><\/a><strong>\u00a0<\/strong>\u0434\u043b\u044f \u0432\u0445\u043e\u0434\u0430 \u0432 \u0411\u0414 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0432\u0435\u0441\u044c \u043f\u0430\u043a\u0435\u0442 db. \u041f\u0435\u0440\u0435\u0434\u0435\u043b\u044b\u0432\u0430\u0435\u043c\u00a0<a href=\"https:\/\/github.com\/avhaliullin\/code-fragments\/blob\/main\/handler.go\" rel=\"noopener noreferrer nofollow\">\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a>\u00a0\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u00a0<a href=\"https:\/\/github.com\/avhaliullin\/code-fragments\/blob\/main\/app.tf\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u0446\u0435\u043f\u0442<\/a>\u00a0\u0434\u0435\u043f\u043b\u043e\u044f.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:\u00a0\u00a0<\/p>\n<pre><code class=\"bash\">yc serverless function invoke d4e3rf325cn81ckd5484 -d '{\"user\": \"test-user\"}' <\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app\/db\/repo.go\" rel=\"noopener noreferrer nofollow\">Repository<\/a> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u0435\u043b\u0430\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439.\u00a0<\/p>\n<pre><code class=\"go\">type Repository interface { GetTODOList(ctx context.Context, id model.TODOListID) (*model.TODOList, error) SaveTODOList(ctx context.Context, list *model.TODOList) error DeleteTODOList(ctx context.Context, id model.TODOListID) error SaveACLEntry(ctx context.Context, entry *model.ACLEntry) error ListACLByUser(ctx context.Context, id model.UserID) ([]*model.ACLEntry, error) ListACLByList(ctx context.Context, id model.TODOListID) ([]*model.ACLEntry, error)  SaveUser(ctx context.Context, user *model.User) error GetUser(ctx context.Context, id model.UserID) (*model.User, error)  GetACL(ctx context.Context, userID model.UserID, listID model.TODOListID) (*model.ACLEntry, error) DeleteACL(ctx context.Context, userID model.UserID, listID model.TODOListID) error }<\/code><\/pre>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u2014 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app\/todolist\/service.go\" rel=\"noopener noreferrer nofollow\">Service<\/a>. \u0412 \u043d\u0451\u043c \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0441\u0440\u0430\u0437\u0443. \u042d\u0442\u043e \u0443\u0436\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0410\u043b\u0438\u0441\u0443.\u00a0\u00a0<\/p>\n<pre><code class=\"go\">type Service interface { Create(ctx context.Context, req *ListCreateRequest) (model.TODOListID, errors.Err) Get(ctx context.Context, req *ListGetRequest) (*model.TODOList, *model.ACLEntry, errors.Err) AddItem(ctx context.Context, req *ItemAddRequest) errors.Err RemoveItem(ctx context.Context, req *ItemRemoveRequest) errors.Err  GetUserLists(ctx context.Context, req *GetUserListsRequest) ([]*model.ACLEntry, errors.Err) GetListUsers(ctx context.Context, req *GetListACLRequest) ([]*model.ACLEntry, errors.Err)  InviteUser(ctx context.Context, req *InviteRequest) errors.Err AcceptAndRenameList(ctx context.Context, req *AcceptAndRenameListRequest) errors.Err RemoveList(ctx context.Context, req *RemoveListRequest) errors.Err RevokeInvitation(ctx context.Context, req *InvitationRevokeRequest) errors.Err }<\/code><\/pre>\n<h2>\u041f\u0438\u0448\u0435\u043c \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043f\u0438\u0441\u043a\u0430<\/h2>\n<p>\u041f\u043e\u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e\u043c\u0443 \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/ad6baa688d8e065a21d53b3fc15482dffe806999\/serverless\/alice-shareable-todolist\/app\/db\/todo_list.go\" rel=\"noopener noreferrer nofollow\">\u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043f\u0438\u0441\u043a\u0430<\/a>.\u00a0\u00a0<\/p>\n<pre><code class=\"go\">func (r *repository) SaveTODOList(ctx context.Context, list *model.TODOList) error { const query = ` DECLARE $id AS string; DECLARE $owner_user_id AS string; DECLARE $items AS json; UPSERT INTO todolist(id, owner_user_id, items) VALUES ($id, $owner_user_id, $items); ` itemsJson, err := json.Marshal(list.Items) if err != nil { return fmt.Errorf(\"serializing list items: %w\", err) } return r.execute(ctx, func(ctx context.Context, s *table.Session, txc *table.TransactionControl) (*table.Transaction, error) { tx, _, err := s.Execute(ctx, txc, query, table.NewQueryParameters( table.ValueParam(\"$id\", ydb.StringValue([]byte(list.ID))), table.ValueParam(\"$owner_user_id\", ydb.StringValue([]byte(list.Owner))), table.ValueParam(\"$items\", ydb.JSONValue(string(itemsJson))), )) return tx, err }) }<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app\/todolist\/impl.go#L14\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043f\u0438\u0441\u043a\u0430<\/a>, \u0442\u043e\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app\/alice\/text\/text_match.go\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430<\/a>. \u042d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u043c\u0443 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044e \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u043c\u043d\u043e\u0433\u0438\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0412 \u0447\u0451\u043c \u043e\u043d\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e?<\/p>\n<p>\u041c\u044b \u043f\u0438\u0448\u0435\u043c \u043d\u0430\u0432\u044b\u043a \u0434\u043b\u044f \u0410\u043b\u0438\u0441\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0433\u043e\u043b\u043e\u0441\u043e\u043c. \u0422\u043e, \u0447\u0442\u043e \u043e\u043d \u043d\u0430\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u0435\u0442, \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u043a\u0441\u0442, \u0438 \u0441\u0442\u043e\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u043e\u0439 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0431\u044b\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442. \u041f\u043e\u0438\u0441\u043a \u043f\u043e \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u043c\u0443 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044e \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u043c \u0432 \u0411\u0414 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<p>\u0412 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u0438 \u0434\u0432\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043d\u0430\u0434 \u043d\u0435\u0439: \u0410\u043b\u0438\u0441\u044b \u0441 \u043d\u0435\u0442\u043e\u0447\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u0432\u0435\u0431 \u2014 \u0431\u0435\u0437 \u044d\u0442\u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439. \u041f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u043d\u0435\u0442\u043e\u0447\u043d\u044b\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435, \u0430 \u043d\u0435 \u0432 \u043a\u043e\u0434\u0435 \u0434\u043b\u044f \u0410\u043b\u0438\u0441\u044b? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u0430\u0432\u044b\u043a, \u0438 \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441 \u043f\u043e\u0445\u043e\u0436\u0438\u043c\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438, \u0442\u043e \u0435\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e \u0438\u0445 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0410\u043b\u0438\u0441\u0443. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u043c\u044b \u0432\u0432\u043e\u0434\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0432 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u0436\u0435 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u043e.<\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0443\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d, \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u0442\u0430\u043a\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0418 \u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u043d\u0435 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e\u043c:\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app\/todolist\/util.go#L36\" rel=\"noopener noreferrer nofollow\">\u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043a\u0430\u0445 \u043b\u0443\u0447\u0448\u0438\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f<\/a>.\u00a0\u00a0<\/p>\n<h2>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u044b<\/h2>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438, \u0442\u043e \u0434\u043b\u044f \u043d\u0438\u0445 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/tree\/master\/serverless\/alice-shareable-todolist\/app\/web\/auth\" rel=\"noopener noreferrer nofollow\">\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/a>. \u0427\u0442\u043e\u0431\u044b \u0441\u043f\u0438\u0441\u043a\u0438 \u0434\u0435\u043b \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c\u0438, \u043a\u0440\u043e\u043c\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044c \u0441\u0430\u043c \u0433\u043e\u0442\u043e\u0432 \u0438\u043c\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u042f\u043d\u0434\u0435\u043a\u0441\u0430. \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044d\u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0430\u0432\u044b\u043a \u0434\u043b\u044f \u0410\u043b\u0438\u0441\u044b. \u0421\u0445\u0435\u043c\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a: \u043d\u043e\u0432\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u042f\u043d\u0434\u0435\u043a\u0441\u0435, \u0430 \u043c\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0435\u0433\u043e \u043b\u043e\u0433\u0438\u043d \u043a\u0430\u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0441\u0430\u0439\u0442\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Yandex OAuth 2.0 API \u0438\u00a0<a href=\"https:\/\/www.google.com\/url?q=https:\/\/yandex.ru\/dev\/passport\/&amp;sa=D&amp;source=editors&amp;ust=1622450180387000&amp;usg=AOvVaw3fENlOTiCYmtKhww7M2akW\" rel=\"noopener noreferrer nofollow\">API \u042f\u043d\u0434\u0435\u043a\u0441 ID<\/a>.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4cb\/455\/a43\/4cb455a434df1d2faa2b89f45a280958.png\" width=\"977\" height=\"545\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4cb\/455\/a43\/4cb455a434df1d2faa2b89f45a280958.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c HTTP-\u0441\u0435\u0441\u0441\u0438\u0439. \u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u043c\u044b \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0435\u043c\u0443 \u0441\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u0443\u044e \u043a\u0443\u043a\u0443 \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u043d\u0435\u0451 \u0435\u0433\u043e \u042f\u043d\u0434\u0435\u043a\u0441-\u043b\u043e\u0433\u0438\u043d. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e \u044d\u0442\u043e\u0439 \u043a\u0443\u043a\u0435, \u043c\u0438\u043d\u0443\u044f API \u042f\u043d\u0434\u0435\u043a\u0441\u0430. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0443\u043a\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 Gorilla Sessions.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u2014 secret \u0438\u0437 Yandex OAuth \u0438 \u043a\u043b\u044e\u0447 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 HTTP-\u0441\u0435\u0441\u0441\u0438\u044f\u043c\u0438. \u0414\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f\u00a0<a href=\"https:\/\/cloud.yandex.ru\/services\/kms\" rel=\"noopener noreferrer nofollow\">\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c Yandex KMS<\/a>. \u041a\u043b\u044e\u0447\u0438 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 KMS \u043d\u0435\u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c\u044b\u0435 \u2014 \u043a\u043b\u044e\u0447 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0443\u0442\u0435\u0447\u044c, \u0438 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442 \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0432 Yandex.Cloud.\u00a0<\/p>\n<ol>\n<li>\n<p>\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u043c\u0443 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0443 \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app.tf#L61\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0438 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app.tf#L40\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u0448\u0438\u0444\u0440\u0443\u0435\u043c<\/a>\u00a0\u043d\u0430\u0448\u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u043a\u043b\u044e\u0447\u043e\u043c KMS.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app.tf#L8\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u043f\u0438\u0448\u0435\u043c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u044b\u00a0<\/a>\u0432 environment-\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app\/secure\/config.go\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u0443\u0435\u043c \u0441\u0435\u043a\u0440\u0435\u0442\u044b<\/a>\u00a0\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Yandex Cloud SDK.\u00a0<\/p>\n<\/li>\n<\/ol>\n<h2>\u0417\u0430\u0432\u043e\u0434\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 OAuth<\/h2>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u00a0<a href=\"https:\/\/oauth.yandex.ru\/\" rel=\"noopener noreferrer nofollow\">https:\/\/oauth.yandex.ru\/<\/a> .\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/873\/a80\/b9a\/873a80b9a73c9efec022d4bf2578d19c.png\" width=\"977\" height=\"550\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/873\/a80\/b9a\/873a80b9a73c9efec022d4bf2578d19c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0444\u043e\u0440\u043c\u044b \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u043c \u043f\u043e\u043b\u0435 <strong>\u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u044b<\/strong>. \u0412 Callback URI \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430, \u043a\u0443\u0434\u0430 OAuth-\u0441\u0435\u0440\u0432\u0438\u0441 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043a\u043e\u0433\u0434\u0430 \u0442\u043e\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442 \u0434\u043e\u0441\u0442\u0443\u043f, \u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u043e\u043c\u0435\u043d API Gateway.\u00a0\u00a0<\/p>\n<pre><code class=\"xml\">https:\/\/social.yandex.net\/broker\/redirect  &lt;apigateway technical domain>\/yandex-oauth <\/code><\/pre>\n<h2>\u041f\u0438\u0448\u0435\u043c\u00a0\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e\u00a0API 3.0<\/h2>\n<p>C\u0435\u0440\u0432\u0438\u0441 API Gateway \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c HTTP API. \u0412 \u043d\u0451\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/gateway\/openapi-template.yaml\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/a>\u00a0OpenAPI 3.0, \u043a \u043d\u0435\u0439 \u043c\u044b \u0438 \u043f\u0440\u0438\u0431\u0435\u0433\u043d\u0435\u043c. \u042d\u0442\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0443\u0442\u0438 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u0441\u0430\u0439\u0442\u0435 \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u043e\u0440\u043c\u0443 \u043e\u0442\u0432\u0435\u0442\u0430. \u0412 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0434\u0442\u0438 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 Object Storage. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u2014 \u044d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u0432\u0435\u0440\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u0435\u043b\u0430\u0442\u044c serverless-\u0441\u0430\u0439\u0442\u044b.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/487\/323\/fad\/487323fad687ab1594c42957d1b3293a.png\" width=\"977\" height=\"550\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/487\/323\/fad\/487323fad687ab1594c42957d1b3293a.png\"\/><figcaption><\/figcaption><\/figure>\n<pre><code class=\"yaml\"># Backend-driven redirect pages   \/login:     get:       operationId: page_login       x-yc-apigateway-integration: { type: cloud_functions, function_id: \"${WEB_FUNCTION_ID}\", tag: $latest, service_account: \"${GATEWAY_SA_ID}\" }       responses:         302:           description: 'Login redirect page'           headers:             Location:               schema: { type: string }               description: \"Redirect location\"   \/receive-token:     get:       operationId: page_receive_token       x-yc-apigateway-integration: { type: cloud_functions, function_id: \"${WEB_FUNCTION_ID}\", tag: $latest, service_account: \"${GATEWAY_SA_ID}\" }       responses:         302:           description: 'Login redirect page'           headers:             Location:               schema: { type: string }               description: \"Redirect location\"       parameters:         - name: state           in:   query           schema: { type: string }         - name:     code           in:       query           required: true           schema: { type: string } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c API Gateway \u0438 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u0435, \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u0432\u0441\u0435 \u0444\u043e\u0440\u043c\u044b \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041d\u043e \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432\u0430\u0448 API, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e. \u041d\u0430\u043c \u0432\u044b\u0433\u043e\u0434\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451.<\/p>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0448\u043b\u044e\u0437\u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0443\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0448 API Gateway, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u0442 \u0432 \u0441\u0442\u0430\u0442\u0443\u0441 running. \u041a \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0443\u0442\u0438\u043b\u0438\u0442 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0439 \u043a\u043e\u0434 \u2014 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e, \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439, \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0434\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438: \u0434\u043b\u044f \u0431\u044d\u043a\u0435\u043d\u0434\u0430 go-swagger \u0438 \u0434\u043b\u044f \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 restful-react.\u00a0<\/p>\n<h2>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u0442\u0430\u0442\u0438\u043a\u0443 \u0432 Object Storage\u00a0<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 Go \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0435\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<h4>\u041f\u0438\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c<\/h4>\n<p>\u0414\u043b\u044f Go \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/tree\/master\/serverless\/alice-shareable-todolist\/app\/generated\/openapi\/models\" rel=\"noopener noreferrer nofollow\">\u043c\u043e\u0434\u0435\u043b\u0438<\/a>\u00a0\u0438\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app\/generated\/openapi\/restapi\/server.go\" rel=\"noopener noreferrer nofollow\">\u0441\u0435\u0440\u0432\u0435\u0440<\/a>, \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u041d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0430 \u0432 \u0432\u0438\u0434\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e \u0441\u0432\u043e\u0438\u043c API, \u0442\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0438\u043d\u044f\u0442\u044c JSON-\u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c JSON-\u043e\u0442\u0432\u0435\u0442. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f, \u043c\u043e\u0436\u043d\u043e\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app\/web\/apigw\/request.go\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.\u00a0\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dc6\/e26\/c2b\/dc6e26c2b590aadb75435a0542a39a7c.png\" width=\"977\" height=\"550\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dc6\/e26\/c2b\/dc6e26c2b590aadb75435a0542a39a7c.png\"\/><figcaption><\/figcaption><\/figure>\n<h4>\u041f\u0438\u0448\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0443\u044e \u0447\u0430\u0441\u0442\u044c<\/h4>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u0441 Node.js \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e \u043f\u043e\u0439\u0434\u0451\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u0443\u0442\u0451\u043c \u2014 \u0437\u0430\u0432\u0435\u0440\u043d\u0451\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432 SPA, \u043a\u043e\u0433\u0434\u0430 \u0432\u0435\u0441\u044c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u0440\u044f\u043c\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u0430 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430\u0434\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u0434\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u043a\u0443 \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c API, \u0447\u0442\u043e \u0443\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e. \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f SPA \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 React \u0438 Bootstrap, \u0447\u0442\u043e\u0431\u044b \u043e\u0436\u0438\u0432\u0438\u0442\u044c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043d\u0435 \u0432\u0435\u0440\u0441\u0442\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0438 \u0440\u0443\u043a\u0430\u043c\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 restful-react \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/frontend\/src\/FETCHERS.tsx\" rel=\"noopener noreferrer nofollow\">\u0444\u0430\u0439\u043b<\/a>,\u00a0<a href=\"https:\/\/cloud.yandex.ru\/docs\/storage\/operations\/objects\/upload\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c<\/a>\u00a0\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0432 \u0431\u0430\u043a\u0435\u0442 OS, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0443\u0436\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438 API Gateway.\u00a0<\/p>\n<h4>\u0427\u0442\u043e \u0443\u043c\u0435\u0435\u0442 \u0410\u043b\u0438\u0441\u0430: \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0430\u0432\u044b\u043a\u00a0<\/h4>\n<p>\u041d\u0430 \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0410\u043b\u0438\u0441\u0430 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0447\u0438, \u0441\u0430\u043c\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f text-to-speech \u0438 speech-to-text. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 API: \u0410\u043b\u0438\u0441\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441 JSON-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c JSON-\u043e\u0442\u0432\u0435\u0442. \u042d\u0442\u043e\u0442 API \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u043d\u0430\u0441 \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e \u0410\u043b\u0438\u0441\u0430 \u0443\u043c\u0435\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 Yandex Cloud Functions, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u043d\u0430\u0432\u044b\u043a \u043d\u0430\u043c \u043f\u0440\u043e\u0449\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445.<\/p>\n<p>\u0418\u0434\u0451\u043c \u0432\u00a0<a href=\"https:\/\/dialogs.yandex.ru\/developer\/\" rel=\"noopener noreferrer nofollow\">\u0414\u0438\u0430\u043b\u043e\u0433\u0438<\/a>\u00a0\u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043d\u0430\u0432\u044b\u043a. \u0412 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u2014 \u043d\u0430\u0432\u044b\u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3cc\/42c\/779\/3cc42c77996fa15b39d592c74abef99d.png\" width=\"977\" height=\"550\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3cc\/42c\/779\/3cc42c77996fa15b39d592c74abef99d.png\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0432 \u0410\u043b\u0438\u0441\u0435<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0410\u043b\u0438\u0441\u044b. \u041d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0447\u0435\u0440\u0435\u0437 \u0410\u043b\u0438\u0441\u0443, \u0430 \u043f\u043e\u0442\u043e\u043c \u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0438\u043c \u0447\u0435\u0440\u0435\u0437 \u0441\u0430\u0439\u0442. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0410\u043b\u0438\u0441\u0435 \u0435\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 OAuth 2.0. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0440\u0432\u0438\u0441 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u0430\u0441\u043f\u043e\u0440\u0442, \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0410\u043b\u0438\u0441\u044b.\u00a0\u00a0<\/p>\n<blockquote>\n<p><strong>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/strong>: id \u0432\u0430\u0448\u0435\u0433\u043e Yandex OAuth \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u00a0<\/p>\n<p><strong>\u0421\u0435\u043a\u0440\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/strong>\u00a0\u0441\u0435\u043a\u0440\u0435\u0442 (\u043f\u0430\u0440\u043e\u043b\u044c) \u0432\u0430\u0448\u0435\u0433\u043e Yandex OAuth \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u00a0<\/p>\n<p><strong>Authorization url:<\/strong>\u00a0<em>https:\/\/oauth.yandex.ru\/authorize<\/em>\u00a0<\/p>\n<p><strong>URL for token receive:<\/strong>\u00a0<em>https:\/\/oauth.yandex.ru\/token<\/em>\u00a0<\/p>\n<p><strong>URL for token refresh:<\/strong>\u00a0<em>https:\/\/oauth.yandex.ru\/token<\/em>\u00a0<\/p>\n<\/blockquote>\n<h2>\u0418\u043d\u0442\u0435\u043d\u0442\u044b \u0432 \u0410\u043b\u0438\u0441\u0435\u00a0<\/h2>\n<p>\u0418\u043d\u0442\u0435\u043d\u0442\u044b \u2014 \u044d\u0442\u043e \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0442\u043e, \u0447\u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0445\u043e\u0442\u0435\u0442\u044c \u043e\u0442 \u043d\u0430\u0432\u044b\u043a\u0430. \u041e\u043d\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0414\u0438\u0430\u043b\u043e\u0433\u043e\u0432. \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0430\u0432\u044b\u043a\u0430 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u043d\u0442\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0443\u0436\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u044b\u0435 \u0438 \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0435\u043d\u043d\u044b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435 \u0441 \u043d\u0438\u043c\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0418\u043d\u0442\u0435\u043d\u0442\u044b \u0434\u0430\u044e\u0442 \u0410\u043b\u0438\u0441\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u0443\u043b\u0443\u0447\u0448\u0430\u044e\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0447\u0438. \u041e\u043d\u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430\u0432\u044b\u043a\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u043e\u0439 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u044b\u0447\u043b\u0435\u043d\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0418\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 <strong>\u0418\u043d\u0442\u0435\u043d\u0442\u044b<\/strong>:\u00a0\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ee7\/6ed\/6d0\/ee76ed6d0a4348eccc51a3047bbda7cf.png\" width=\"977\" height=\"474\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee7\/6ed\/6d0\/ee76ed6d0a4348eccc51a3047bbda7cf.png\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u041a\u043d\u043e\u043f\u043a\u0438 \u0432 \u0410\u043b\u0438\u0441\u0435<\/h2>\n<p>\u041a\u043d\u043e\u043f\u043a\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u0438\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0430\u0448 \u043d\u0430\u0432\u044b\u043a. \u041e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043d\u0430 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0410\u043b\u0438\u0441\u0435 \u0432 \u043e\u0434\u0438\u043d \u0442\u0430\u043f. \u041a\u043d\u043e\u043f\u043a\u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u044d\u0432\u0440\u0438\u0441\u0442\u0438\u043a \u0438 \u0443\u0433\u0430\u0434\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043d\u0430\u0432\u044b\u043a\u0430 \u2014 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044b \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c UI. \u0412\u043e\u0442\u00a0<a href=\"https:\/\/github.com\/avhaliullin\/code-fragments\/blob\/main\/alice-buttons.json\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a>\u00a0\u043e\u0442\u0432\u0435\u0442\u0430 \u0410\u043b\u0438\u0441\u0435 \u043a\u043d\u043e\u043f\u043a\u0430\u043c\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f\u00a0<a href=\"https:\/\/github.com\/avhaliullin\/code-fragments\/blob\/main\/buttons-handler.sh\" rel=\"noopener noreferrer nofollow\">\u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/a>\u00a0\u043d\u0430 bash, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0438:\u00a0\u00a0<\/p>\n<pre><code class=\"bash\">echo '{    \"version\": \"1.0\",    \"response\": {      \"text\": \"\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438 \u043d\u0430 \u043c\u043e\u0438 \u043a\u043d\u043e\u043f\u043a\u0438\",      \"buttons\": [        {          \"title\": \"\u041a\u043d\u043e\u043f\u043a\u0430 1\",          \"payload\": {            \"a\": \"b\"          }        },        {            \"title\": \"\u041a\u043d\u043e\u043f\u043a\u0430 2\",          \"payload\": {            \"a\": \"c\"          }        }      ]    }  }' <\/code><\/pre>\n<h2>\u041f\u0438\u0448\u0435\u043c \u043d\u0430\u0432\u044b\u043a <\/h2>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0432\u044b\u043a\u0430 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app\/alice\/api\/api.go\" rel=\"noopener noreferrer nofollow\">\u043e\u043f\u0438\u0441\u0430\u0442\u044c<\/a>\u00a0\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u043d\u0442\u044b, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438\u0445 \u043f\u0440\u0438\u0451\u043c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043d\u0430\u0432\u044b\u043a\u0430 \u0438\u00a0\u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a,\u00a0\u043d\u0435 \u0437\u0430\u0431\u044b\u0432 \u043f\u0440\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e.\u00a0<\/p>\n<h2>\u0425\u0440\u0430\u043d\u0438\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438\u00a0<\/h2>\n<p>\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u043c. \u041a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b, \u2014 \u043d\u0430\u0434\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0432 \u0442\u0443\u043f\u0438\u043a\u0435, \u0430 \u043c\u043e\u0433 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u00ab\u041e\u0442\u043c\u0435\u043d\u0430\u00bb \u0438\u043b\u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0dc\/0de\/b2b\/0dc0deb2bdf0e5b7e391b2b5519113d8.png\" width=\"977\" height=\"502\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0dc\/0de\/b2b\/0dc0deb2bdf0e5b7e391b2b5519113d8.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u043f\u0440\u043e\u0441 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c. \u0425\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445? \u0412 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0414\u0438\u0430\u043b\u043e\u0433\u043e\u0432 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0430\u044f \u0444\u0438\u0447\u0430 \u2014 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0414\u0438\u0430\u043b\u043e\u0433\u043e\u0432 (\u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0432 1 \u041a\u0411) \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435. \u041e\u043d\u043e \u043f\u0440\u0438\u0434\u0451\u0442 \u043a \u043d\u0430\u043c \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435.    <\/p>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441:<\/p>\n<pre><code class=\"go\">type ReqState struct { Session StateData `json:\"session\"` }<\/code><\/pre>\n<p>\u041e\u0442\u0432\u0435\u0442:<\/p>\n<pre><code class=\"go\">type Response struct { Version             string     `json:\"version\"` Response            *Resp      `json:\"response\"` StartAccountLinking *EmptyObj  `json:\"start_account_linking\"` State               *StateData `json:\"session_state\"` }<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app\/alice\/api\/api.go\" rel=\"noopener noreferrer nofollow\"><u>\u041a\u043e\u0434\u00a0\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f\u00a0\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432\u00a0\u2014 stateless handler<\/u><\/a>\u00a0<\/p>\n<p><a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app\/alice_handler.go\" rel=\"noopener noreferrer nofollow\"><u>\u041a\u043e\u0434\u00a0\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f\u00a0\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432\u00a0\u2014 stateful handler<\/u><\/a>\u00a0<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u0442\u0430\u043f\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Go \u0432 serverless-\u0441\u0442\u0435\u043a\u0435 \u043d\u0430 Yandex.Cloud \u0434\u043b\u044f \u043d\u0430\u0432\u044b\u043a\u0430 \u0410\u043b\u0438\u0441\u044b. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0435\u0441\u0442\u044c \u0432\u00a0<a href=\"https:\/\/youtu.be\/PMWMDTBKFAc\" rel=\"noopener noreferrer nofollow\">\u0432\u0438\u0434\u0435\u043e\u0437\u0430\u043f\u0438\u0441\u0438<\/a>\u00a0\u0438\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/tree\/master\/serverless\/alice-shareable-todolist#readme\" rel=\"noopener noreferrer nofollow\">Readme\u00a0<\/a>\u043d\u0430 GitHub, \u0433\u0434\u0435 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043a\u043e\u0434\u0430\u0445.\u00a0<\/p>\n<h2>\u0420\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u00a0\u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c<\/h2>\n<p>\u0412 Yandex.Cloud \u0435\u0441\u0442\u044c \u0436\u0438\u0432\u043e\u0435 \u0438 \u0440\u0430\u0441\u0442\u0443\u0449\u0435\u0435 serverless-\u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438\u00a0<a href=\"https:\/\/t.me\/YandexCloudFunctions\" rel=\"noopener noreferrer nofollow\">Yandex Serverless Ecosystem<\/a>\u00a0\u0438 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0447\u0430\u0442\u00a0<a href=\"https:\/\/t.me\/yandexcloud_chat\" rel=\"noopener noreferrer nofollow\">Yandex.Cloud<\/a>\u00a0\u0432 Telegram, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u043e\u0442 \u0435\u0434\u0438\u043d\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u043e\u0432 \u0438 \u043a\u043e\u043b\u043b\u0435\u0433. \u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c!<\/p>\n<p>\u0418 \u0435\u0449\u0451 \u0432 Yandex.Cloud \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u00a0<a href=\"https:\/\/cloud.yandex.ru\/docs\/billing\/concepts\/serverless-free-tier\" rel=\"noopener noreferrer nofollow\">free tier<\/a>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c \u0437\u0430 \u043b\u0438\u043c\u0438\u0442\u044b.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/570470\/\"> https:\/\/habr.com\/ru\/articles\/570470\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0440\u0443\u0434\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0435, \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0451 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043d\u0430\u0432\u044b\u043a\u0430 \u0410\u043b\u0438\u0441\u044b, \u0430 \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043d\u0430 serverless-\u0441\u0442\u0435\u043a\u0435 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0438 \u043d\u043e\u0432\u0438\u0447\u043a\u0443 \u0431\u044b\u043b\u043e \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u043e, \u0438 \u0437\u0430\u044f\u0434\u043b\u043e\u043c\u0443 \u0434\u0435\u0432\u0435\u043b\u043e\u043f\u0435\u0440\u0443 \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u043a\u0443\u0447\u0430\u0442\u044c. \u041d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043e\u0441\u0438\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043d\u0430\u0432\u044b\u043a \u043d\u0430 Go. \u0418 \u0431\u0443\u0434\u0435\u0442 \u0443 \u043c\u0435\u043d\u044f \u0441\u0435\u043c\u0435\u0439\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b.\u00a0<\/p>\n<h2>\u041a\u0430\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0435\u043b\u0430\u0435\u043c<\/h2>\n<p>\u041c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043d\u0430\u0432\u044b\u043a \u0434\u043b\u044f \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430 \u00ab\u0421\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b\u00bb. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0410\u043b\u0438\u0441\u044b \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u0434\u0435\u043b \u0447\u0435\u0440\u0435\u0437 \u0441\u0430\u0439\u0442 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u0412\u043e\u0442 \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f.\u00a0<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/61078e4f920526a288c7e19a\" data-style=\"\" id=\"61078e4f920526a288c7e19a\" width=\"\"><\/div>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u044d\u0442\u0430\u043f\u043d\u043e \u043f\u0440\u043e\u0439\u0434\u0451\u043c \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0432\u044b\u043a\u0430 \u2014 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0440\u0435\u0434\u044b \u0434\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0435\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/p>\n<h2>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h2>\n<p>\u041a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 serverless-\u0441\u0442\u0435\u043a\u0435 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0410\u043b\u0438\u0441\u0443 \u2014 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u042f\u043d\u0434\u0435\u043a\u0441.\u0414\u0438\u0430\u043b\u043e\u0433\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043a\u0430\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Cloud Functions, \u043a\u0443\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434.\u00a0\u00a0<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421 \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u042d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f serverless \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u2014 pay-as-you-go. \u041d\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u2014 \u043d\u0435\u0442 \u0434\u0435\u043d\u0435\u0436\u043d\u044b\u0445 \u0442\u0440\u0430\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043b\u0430\u0442\u0430 \u0432\u0437\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0437\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432. \u0412 \u044d\u0442\u043e\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 serverless \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u0422\u0430\u043a\u0436\u0435 \u0432 serverless-\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 load-balancer \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u2014 \u0438\u0445 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Yandex.Cloud.\u00a0\u00a0<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u00a0\u0440\u0430\u0431\u043e\u0447\u0443\u044e\u00a0\u0441\u0440\u0435\u0434\u0443<\/h2>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c serverless-\u0441\u0442\u0435\u043a Yandex.Cloud \u2014 \u0432\u0441\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u0434\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 Yandex Database, \u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 API Gateway. \u0422\u0430\u043a \u043c\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u043c \u0441\u0435\u0431\u044f \u043e\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043c \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u044b.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 Yandex.Cloud:\u00a0\u00a0<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/cloud.yandex.ru\/services\/functions\" rel=\"noopener noreferrer nofollow\">Yandex Cloud Functions<\/a> \u2014 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u0432\u0438\u0434\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/cloud.yandex.ru\/services\/ydb\" rel=\"noopener noreferrer nofollow\">Yandex Database<\/a> \u2014 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0430\u044f NewSQL \u0421\u0423\u0411\u0414 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439      \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/cloud.yandex.ru\/services\/api-gateway\" rel=\"noopener noreferrer nofollow\">Yandex Cloud API Gateway<\/a> \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f API-\u0448\u043b\u044e\u0437\u043e\u0432. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e OpenAPI 3.0 \u0438 \u043d\u0430\u0431\u043e\u0440 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/cloud.yandex.ru\/docs\/storage\/\" rel=\"noopener noreferrer nofollow\">Yandex Object Storage<\/a> \u2014 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/cloud.yandex.ru\/docs\/kms\/\" rel=\"noopener noreferrer nofollow\">Yandex KMS<\/a> \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438 \u0438 \u0434\u0435\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/cloud.yandex.ru\/docs\/cli\/\" rel=\"noopener noreferrer nofollow\">CLI Yandex<\/a> \u2014 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 Yandex;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/yandex.ru\/dev\/passport\/\" rel=\"noopener noreferrer nofollow\">API Yandex ID<\/a>\u00a0+\u00a0<a href=\"https:\/\/yandex.ru\/dev\/oauth\/\" rel=\"noopener noreferrer nofollow\">OAuth 2.0<\/a> \u2014 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.\u00a0<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0438 \u043f\u0430\u043a\u0435\u0442\u044b:\u00a0\u00a0<\/p>\n<ul>\n<li>\n<p><a href=\"http:\/\/github.com\/gorilla\/sessions\" rel=\"noopener noreferrer nofollow\"><u>Gorilla<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/goswagger.io\/install.html\" rel=\"noopener noreferrer nofollow\"><u>go-swagger<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.npmjs.com\/package\/api-spec-converter\" rel=\"noopener noreferrer nofollow\"><u>api-spec-converter<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/stedolan.github.io\/jq\/\" rel=\"noopener noreferrer nofollow\"><u>jq<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/terraform.io\/\" rel=\"noopener noreferrer nofollow\"><u>Terraform<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/aws.amazon.com\/ru\/cli\/\" rel=\"noopener noreferrer nofollow\"><u>AWS command line tool<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p>Node.js\u00a0<\/p>\n<\/li>\n<li>\n<p>Go\u00a0<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443\u00a0<a href=\"http:\/\/github.com\/contiamo\/restful-react\" rel=\"noopener noreferrer nofollow\">restful-react\u00a0<\/a>\u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u043c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u043c Node\/JS\/Go \u0438 \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u043d\u0435\u0439 \u0437\u0430\u0440\u0430\u043d\u0435\u0435.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 serverless-\u0441\u0442\u0435\u043a\u043e\u043c Yandex.Cloud, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 Yandex.Cloud \u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438.\u00a0\u00a0<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/h2>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u0421\u0435\u0440\u0432\u0438\u0441 Cloud Functions \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0435\u0451 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u041f\u0440\u0438\u0447\u0451\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u2014 \u043c\u043e\u0434\u0443\u043b\u0438\u00a0<strong>mod\u00a0<\/strong>\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u00a0<strong>dep<\/strong>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/cloud.yandex.ru\/docs\/functions\/lang\/golang\/dependencies\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\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 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/tree\/master\/serverless\/alice-shareable-todolist\/app\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a>\u00a0\u0444\u0430\u0439\u043b go.mod \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0412 \u043d\u0451\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u044d\u043a\u0435\u043d\u0434\u0430. \u041d\u0430\u0448 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043d\u0443\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434:\u00a0\u00a0<\/p>\n<pre><code class=\"go\">require ( github.com\/go-openapi\/errors v0.20.0 github.com\/go-openapi\/loads v0.20.2 github.com\/go-openapi\/runtime v0.19.26 github.com\/go-openapi\/spec v0.20.3 github.com\/go-openapi\/strfmt v0.20.0 github.com\/go-openapi\/swag v0.19.14 github.com\/go-openapi\/validate v0.20.2 github.com\/golang\/protobuf v1.4.3 \/\/ indirect github.com\/google\/go-cmp v0.5.4 \/\/ indirect github.com\/gorilla\/securecookie v1.1.1 github.com\/gorilla\/sessions v1.2.1 github.com\/jessevdk\/go-flags v1.4.0 github.com\/stretchr\/testify v1.7.0 github.com\/texttheater\/golang-levenshtein v1.0.1 github.com\/yandex-cloud\/go-genproto v0.0.0-20210211094722-b4ab90f1132d github.com\/yandex-cloud\/go-sdk v0.0.0-20210211095836-1e646debd48a github.com\/yandex-cloud\/ydb-go-sdk v0.0.0-20210203152813-253585cf1c0d go.uber.org\/zap v1.16.0 golang.org\/x\/net v0.0.0-20210119194325-5f4716e94777 google.golang.org\/grpc v1.35.0 \/\/ indirect )<\/code><\/pre>\n<h2>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e: \u043d\u0430\u043f\u0438\u0448\u0435\u043c\u00a0<strong>hello world<\/strong>, \u043d\u043e \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u0435\u043b\u0430\u044e\u0442 \u0431\u0435\u0437 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a:\u00a0<\/p>\n<pre><code class=\"go\">func Handler(_ context.Context, req map[string]string) (string, error) {  return fmt.Sprintf(\"Hello, %s!\", req[\"name\"])  } <\/code><\/pre>\n<p>\u041d\u043e \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043e\u043d\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u00ab\u0432\u044b\u0442\u0435\u0441\u043d\u0435\u043d\u0430\u00bb. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0441 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043a\u0435\u0448\u0435\u0439 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u00ab\u0442\u044f\u0436\u0451\u043b\u044b\u0445\u00bb \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0411\u0414. \u041d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0430\u043c \u0432\u0430\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043f\u043e\u0442\u0435\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c, \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u00a0<a href=\"https:\/\/github.com\/avhaliullin\/code-fragments\/blob\/main\/dummy-handler.go\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u041a\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 Cloud Functions \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u2014 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u0434\u0440\u0443\u0433 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0440\u0430\u0441\u0442\u0451\u0442 \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c cold start. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043d\u0443\u043b\u044f.<\/p>\n<p>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0434\u043b\u044f Go \u044d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u043e\u0445\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044f\u0437\u044b\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 AOT-, \u0430 \u043d\u0435 JIT-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u0438 \u0432 \u043e\u0431\u0449\u0435\u043c \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0435.<\/p>\n<p>\u041d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c \u2014 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0447\u0442\u043e \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0430\u0440\u0443 \u00ab\u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0445\u00bb \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439:\u00a0<\/p>\n<ol>\n<li>\n<p>\u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u2014 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c KMS, \u043e\u043d, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e, \u043d\u043e \u044d\u0442\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0445\u043e\u0434 \u043f\u043e \u0441\u0435\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u043e Yandex Database (\u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435). \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u043d\u043e \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u2014 \u0438 \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043a\u0440\u0430\u0441\u0442\u044c \u0434\u0440\u0430\u0433\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043c\u044b \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443\u00a0<strong>app<\/strong> \u0438 \u0437\u0430\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u044d\u0442\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439\u00a0<strong>singleton<\/strong>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 cold start, \u0430 \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e, \u043a\u0430\u043a \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0412\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app\/web_handler.go\" rel=\"noopener noreferrer nofollow\">\u0432\u043e\u0442 \u0442\u0430\u043a.<\/a>\u00a0<\/p>\n<h2>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 Terraform<\/h2>\n<p>\u041f\u0440\u043e\u0441\u0442\u044b\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u041d\u043e \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0435\u043b\u0438\u043a, \u0438 \u043a\u043e\u0434\u0430 \u0432 \u043d\u0451\u043c \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f Terraform. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c Terraform-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0434\u0435\u043f\u043b\u043e\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e\u00a0<a href=\"https:\/\/github.com\/yandex-cloud\/examples\/blob\/master\/serverless\/alice-shareable-todolist\/app.tf\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435.<\/a><\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430 \u0434\u0435\u043f\u043b\u043e\u0439 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. Terraform \u0434\u0435\u043f\u043b\u043e\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0438 \u043c\u044b \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0432\u044b\u0437\u0432\u0430\u0432 \u0435\u0451 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<a href=\"https:\/\/cloud.yandex.ru\/docs\/functions\/concepts\/function-invoke\" rel=\"noopener noreferrer nofollow\">yc serverless function invoke<\/a>. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f OAuth token \u2014 \u044d\u0442\u043e \u0442\u043e\u043a\u0435\u043d, \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0439 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u043f\u0440\u0438 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 OAuth token, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u00a0<a href=\"https:\/\/cloud.yandex.ru\/docs\/iam\/concepts\/authorization\/oauth-token\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0421\u0440\u043e\u043a \u0436\u0438\u0437\u043d\u0438 OAuth-\u0442\u043e\u043a\u0435\u043d\u0430 \u2014 \u043e\u0434\u0438\u043d \u0433\u043e\u0434. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 OAuth-\u0442\u043e\u043a\u0435\u043d \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043d\u0430 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 Terraform-\u0440\u0435\u0446\u0435\u043f\u0442 \u0434\u043b\u044f\u00a0<a href=\"https:\/\/github.com\/avhaliullin\/code-fragments\/blob\/main\/dummy-app.tf\" rel=\"noopener noreferrer nofollow\">hello world \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430<\/a>:\u00a0<\/p>\n<pre><code>## \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c:  terraform init --var yc-token=&lt;OAuth-\u0442\u043e\u043a\u0435\u043d \u043e\u0431\u043b\u0430\u043a\u0430>  --var folder-id=&lt;id folder \u0432 Yandex.Cloud>  ## \u0414\u0435\u043f\u043b\u043e\u0438\u043c:  terraform apply --var yc-token=&lt;OAuth-\u0442\u043e\u043a\u0435\u043d \u043e\u0431\u043b\u0430\u043a\u0430>  --var folder-id=&lt;id folder \u0432 Yandex.Cloud> <\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0434\u0435\u043f\u043b\u043e\u0439 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f, Terraform \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0442\u0432\u0435\u0442:\u00a0<\/p>\n<pre><code class=\"bash\">Apply complete! Resources: 1 added, 0 changed, 0 destroyed.\u00a0 Outputs:\u00a0 function-id = \"d4e3rf325cn81ckd5484\"\u00a0<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 function-id, \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u0435\u0451 \u0440\u0430\u0431\u043e\u0442\u044b:\u00a0\u00a0<\/p>\n<pre><code class=\"bash\">yc serverless function invoke d4e3rf325cn81ckd5484\u00a0<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0432 OAuth-\u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Yandex.Cloud \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u042f\u043d\u0434\u0435\u043a\u0441.OAuth.\u00a0<\/p>\n<pre><code class=\"bash\">terraform apply -var-file .\/variables.json -var yc-token=&lt;OAuth token><\/code><\/pre>\n<h2>\u0413\u043e\u0442\u043e\u0432\u0438\u043c\u00a0\u0431\u0430\u0437\u0443\u00a0\u0434\u0430\u043d\u043d\u044b\u0445\u00a0<\/h2>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0443\u044e NewSQL \u0421\u0423\u0411\u0414 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u2014 Yandex Database (YDB). \u042d\u0442\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u042f\u043d\u0434\u0435\u043a\u0441\u0430. YDB \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u0438 ACID-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043b\u0435\u0433\u043a\u0430 \u0432 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>\u041d\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u043e\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u0436\u0438\u043c \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0414\u043e \u043e\u043a\u0442\u044f\u0431\u0440\u044f 2021 \u0433\u043e\u0434\u0430 \u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0442\u0430\u0440\u0438\u0444\u0435 \u043c\u0438\u043b\u043b\u0438\u043e\u043d \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432 \u043c\u0435\u0441\u044f\u0446 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e Yandex Database \u043c\u043e\u0436\u043d\u043e\u00a0<a href=\"https:\/\/habr.com\/ru\/post\/562746\/\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0443 \u043c\u043e\u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0438<\/a>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0430\u0432\u044b\u043a\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0440\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b:\u00a0\u00a0<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>User \u2014 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u0435\u043b;<\/p>\n<\/li>\n<li>\n<p>TODOList_ACL \u2014 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u0432\u044f\u0437\u0438. \u041e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430 \u043d\u0430\u043c, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>TODOList \u2014 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u0435\u043b.\u00a0<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"sql\">CREATE TABLE `user`  (      id string,      name utf8,      yandex_avatar_id string,      PRIMARY KEY (id)  );   CREATE TABLE `todolist_acl`  (      user_id string,      mode string,      list_id string,      alias utf8,      accepted bool,      inviter string,      PRIMARY KEY (list_id, user_id),      INDEX UserToListACL GLOBAL ON (user_id)  );<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\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-388760","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/388760","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=388760"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/388760\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=388760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=388760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=388760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}