{"id":332109,"date":"2022-04-19T15:00:31","date_gmt":"2022-04-19T15:00:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=332109"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=332109","title":{"rendered":"<span>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u0441\u0442\u0440\u0430\u043d\u0435 Serverless: \u0441\u043e\u0437\u0434\u0430\u0435\u043c REST API (\u0427\u0430\u0441\u0442\u044c 4)<\/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\/23a\/457\/314\/23a457314bc6c58bf5bba160dabe2abc.png\" alt=\"\" title=\"\" width=\"1752\" height=\"1210\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/23a\/457\/314\/23a457314bc6c58bf5bba160dabe2abc.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043a\u0443\u0431\u0438\u043a\u0438, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 serverless \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/lineate\/blog\/655523\/\"><u>\u041f\u0435\u0440\u0432\u044b\u0435 \u0448\u0430\u0433\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u043b\u044f\u043c\u0431\u0434\u0430 (\u0427\u0430\u0441\u0442\u044c 1)<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/lineate\/blog\/656695\/\"><u>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0411\u0414 (\u0427\u0430\u0441\u0442\u044c 2)<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/lineate\/blog\/657171\/\"><u>\u041a\u0430\u043a \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c\u0441\u044f \u0441 \u0411\u0414 (\u0427\u0430\u0441\u0442\u044c 3)<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e 4 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u0430 \u0411\u0414. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0441 \u0411\u0414, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438. \u0412\u0441\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 SAM \u043a\u043e\u043c\u0430\u043d\u0434.<\/p>\n<p>\u041d\u043e \u043f\u043e\u043a\u0430 \u044d\u0442\u043e \u043c\u0430\u043b\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0442.\u043a. \u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435\u0442 API. \u041c\u043e\u0438 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u0443\u043c\u0435\u044e\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c http \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0422\u0430\u043a \u0447\u0442\u043e\u00a0 \u0432 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u0437\u0430\u0439\u043c\u0443\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e API. \u0422\u0430\u043a\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 github api.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 API \u0432 SAM \u0448\u0430\u0431\u043b\u043e\u043d\u0435<\/h2>\n<p>\u0412 \u043c\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c REST API. \u0414\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 http \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 ApiGateway \u043e\u0442 AWS. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c API, \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 http \u0437\u0430\u043f\u0440\u043e\u0441 ApiGateway \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439.\u00a0<\/p>\n<p>\u0412 \u043c\u043e\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0411\u0414. \u041d\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430. \u041d\u0430\u0434\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u043f\u043e\u0434 \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0442 ApiGateway. \u041f\u043e\u0445\u043e\u0436\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0438 \u0441 \u043e\u0442\u0432\u0435\u0442\u043e\u043c, \u043c\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f ApiGateway. \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043f\u0430\u043f\u043a\u0435 events \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. SAM \u0437\u0430\u0431\u043e\u0442\u043b\u0438\u0432\u043e \u0441\u043e\u0437\u0434\u0430\u043b \u0435\u0433\u043e, \u043a\u043e\u0433\u0434\u0430 \u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.\u00a0<\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 SAM \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 API. \u0412 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0434\u043b\u044f \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e Events:<\/p>\n<pre><code class=\"yaml\"># .\/template.yaml Resources:   GetProjectByIdFunction:     Type: AWS::Serverless::Function     Properties:       CodeUri: src\/handlers\/get-project-by-id       Handler: app.lambdaHandler       Runtime: nodejs14.x       Events:         HelloWorld:           Type: Api           Properties:             Path: \/hello             Method: get<\/code><\/pre>\n<p>\u042d\u0442\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c, \u0442\u0438\u043f \u201cApi\u201d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 ApiGateway \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430, \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u043f\u0443\u0442\u044c, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439.<\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u044f \u043d\u0438\u0433\u0434\u0435 \u044f\u0432\u043d\u043e \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u0440\u0435\u0441\u0443\u0440\u0441 ApiGateway. SAM \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0435\u0433\u043e \u0441\u0430\u043c. \u0422\u0430\u043a\u043e\u0439 \u0432\u0438\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f API \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f implicit api. SAM \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b Events \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u0441 \u0442\u0438\u043f\u043e\u043c <em>Api, \u0441<\/em>\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u0443\u0442\u0438, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442. \u0418 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441 \u0442\u0438\u043f\u0430 AWS::Serverless::Api \u0441 \u0438\u043c\u0435\u043d\u0435\u043c ServerlessRestApi. \u0412 \u044d\u0442\u043e\u043c API \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u043f\u0443\u0442\u0438, \u043d\u0430 \u044d\u0442\u0438 \u043f\u0443\u0442\u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u043b\u044f\u043c\u0431\u0434\u044b. Implicit api \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445, \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u043d\u0443\u0436\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043d\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 ApiGateway \u0441 \u0438\u043c\u0435\u043d\u0435\u043c, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u043c \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0441\u0442\u0435\u043a\u0430, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"yaml\"># .\/template.yaml BugTrackerApi:     Type: AWS::Serverless::Api     Properties:       StageName: prod       OpenApiVersion: \"3.0.3\"   GetProjectByIdFunction:     Type: AWS::Serverless::Function     Properties:       ...       Events:         ApiEvent:           Type: Api           Properties:             Path: \/hello             Method: get             RestApiId: !Ref BugTrackerApi<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 API Gateway. <\/p>\n<p>\u0421 OpenApiVersion \u0441\u0432\u044f\u0437\u0430\u043d \u043e\u0434\u0438\u043d <a href=\"https:\/\/github.com\/aws\/serverless-application-model\/issues\/191\"><u>\u0431\u0430\u0433 \u0432 SAM<\/u><\/a>. \u0411\u0430\u0433 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 ApiGateway \u043f\u043e\u043c\u0438\u043c\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u0442\u0435\u0439\u0434\u0436\u0430 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e prod), sam \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0435\u0449\u0435 \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u044b\u0439 \u0441\u0442\u0435\u0439\u0434\u0436 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u201cStage\u201d. \u0415\u0441\u043b\u0438 \u0432 \u0440\u0435\u0441\u0443\u0440\u0441\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u0435 OpenApiVersion, \u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442. \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u0440\u0447\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u044d\u0442\u043e\u0442 \u0444\u043b\u0430\u0436\u043e\u043a \u043b\u0435\u0447\u0438\u0442\u044c \u043d\u0435 \u0443\u043c\u0435\u0435\u0442.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0435\u0440\u0443\u0441\u044c \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c StageName. \u041d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2014 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439.    <\/p>\n<h3>Multi Stage vs Multi Stack<\/h3>\n<p>\u0420\u0430\u043d\u0435\u0435 \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u0430\u0441\u0430\u043b\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441 CF \u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u043c\u0438. \u0412\u0435\u0440\u043d\u0443\u0441\u044c \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u0438 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u0435\u0433\u043e \u0433\u043b\u0443\u0431\u0436\u0435.\u00a0<\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c 3-4 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u2014 dev, qa, stg, prod (\u0447\u0430\u0441\u0442\u043e \u044d\u0442\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0435). \u041e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c feature environment \u0434\u043b\u044f \u0447\u043b\u0435\u043d\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0442\u0430\u043a\u0438\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439:<\/p>\n<ul>\n<li>\n<p>\u0432\u0441\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0432 \u043e\u0434\u043d\u043e\u043c SAM\/CF \u0441\u0442\u0435\u043a\u0435,\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0435\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043e\u0434\u0438\u043d \u0441\u0442\u0435\u043a \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439. \u041a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043b\u044f\u043c\u0431\u0434\u0430\u043c\u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435?\u00a0<\/p>\n<h4>\u041e\u0434\u0438\u043d \u0441\u0442\u0435\u043a<\/h4>\n<p>\u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u0420\u0435\u0441\u0443\u0440\u0441 \u0441 \u043b\u044f\u043c\u0431\u0434\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u043e\u0434\u0438\u043d. \u041d\u043e \u043a\u0430\u043a-\u0442\u043e \u043d\u0430\u0434\u043e \u0440\u0430\u0437\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u043b\u044f\u043c\u0431\u0434\u044b \u0438\u043c\u0435\u0442\u044c \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439: \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0430\u043b\u0438\u0430\u0441\u044b. \u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044b\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u0441\u043b\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f. \u0412\u0435\u0440\u0441\u0438\u044f \u2014 \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, AWS \u0441\u0430\u043c \u0435\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442. \u0414\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043b\u044f\u043c\u0431\u0434\u044b \u0435\u0441\u0442\u044c $LATEST \u0432\u0435\u0440\u0441\u0438\u044f. \u041f\u043e\u043c\u0438\u043c\u043e \u0432\u0435\u0440\u0441\u0438\u0439 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0430\u043b\u0438\u0430\u0441\u044b \u2014 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.\u00a0<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u0430\u044f \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f MyFunc. \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u043b\u0438\u0430\u0441 DEV_MY_FUNC, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 $LATEST, \u0430\u043b\u0438\u0430\u0441 QA_MY_FUNC \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 5, \u0438 \u0430\u043b\u0438\u0430\u0441 STG_MY_FUNC \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 4. \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043c\u043e\u0435\u043c \u043e\u0431\u043b\u0430\u043a\u0435 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0438 \u043e\u0434\u043d\u043e\u0439 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 \u043c\u043e\u0435\u043c SAM \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0435\u0441\u0443\u0440\u0441 \u0441 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439.<\/p>\n<p>\u0412 ApiGateway \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0442\u0435\u0439\u0434\u0436\u0438. \u0421\u0442\u0435\u0439\u0434\u0436\u0438 \u043f\u043e \u0441\u0443\u0442\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u043f\u0438. \u0422\u0430\u043a\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043c\u043e\u0438\u0445 dev\/qa\/stg \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0443 \u043c\u043e\u0435\u0433\u043e \u0430\u043f\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u0442\u0435\u0439\u0434\u0436\u0438 dev, qa, stg \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u0442\u0435\u0439\u0434\u0436 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0443\u0440\u043b\u044b:  <\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/gateway_host\/alpha\/*\"><u>https:\/\/GATEWAY_HOST\/dev\/*<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/gateway_host\/alpha\/*\"><u>https:\/\/GATEWAY_HOST\/qa\/*<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/gateway_host\/alpha\/*\"><u>https:\/\/GATEWAY_HOST\/stg\/*<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f MyFunc. \u0425\u043e\u0447\u0443, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u043f\u0443\u0442\u0438 \/hello.  <\/p>\n<pre><code class=\"yaml\">MyFunc:     Type: AWS::Serverless::Function     Properties:       ...       Events:         ApiEvent:           Type: Api           Properties:             Path: \/hello             Method: get             RestApiId: !Ref MyApiGateway<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0432\u044f\u0437\u0430\u0442\u044c ApiGateway \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0442\u043e \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>https:\/\/GATEWAY_HOST\/dev\/hello<\/p>\n<\/li>\n<li>\n<p>https:\/\/GATEWAY_HOST\/qa\/hello<\/p>\n<\/li>\n<li>\n<p>https:\/\/GATEWAY_HOST\/stg\/hello<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0432\u0441\u0435 \u043c\u043e\u0438 API \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u0410 \u044f \u0445\u043e\u0447\u0443, \u0447\u0442\u043e\u0431\u044b dev \u0441\u0442\u0435\u0439\u0434\u0436 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441\u043e \u0441\u0432\u0435\u0436\u0438\u043c \u043a\u043e\u0434\u043e\u043c, \u0430 qa \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c. \u041a\u0430\u043a \u0440\u0430\u0437 \u0442\u0443\u0442 \u0432 \u0438\u0433\u0440\u0443 \u0438 \u0432\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0430\u043b\u0438\u0430\u0441\u044b.<\/p>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0442\u0435\u0439\u0434\u0436\u0430 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u042f \u0441\u043e\u0437\u0434\u0430\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e MY_FUNC_ALIAS. \u041e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438\u043c\u044f \u0430\u043b\u0438\u0430\u0441\u0430 \u043c\u043e\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044e.\u00a0<\/p>\n<p>\u0414\u043b\u044f dev \u0441\u0442\u0435\u0439\u0434\u0436\u0430\u00a0 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 DEV_MY_FUNC, \u0434\u043b\u044f qa \u2014\u00a0 QA_MY_FUNC, \u0434\u043b\u044f stg \u2014\u00a0 STG_MY_FUNC.<\/p>\n<p>\u041d\u0443 \u0438 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0430\u0433. \u041d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c ApiGateway \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 $LATEST \u0432\u0435\u0440\u0441\u0438\u044e \u043c\u043e\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u0442\u0443 \u0432\u0435\u0440\u0441\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0434\u0430\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 MY_FUNC_ALIAS.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 ApiGateway \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u043d\u0435 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u0441 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 MyFunc:${stageVariables.MY_FUNC_ALIAS}.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 UI, \u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5e8\/22c\/815\/5e822c8153c0402f425380f61187a646.png\" width=\"1342\" height=\"655\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5e8\/22c\/815\/5e822c8153c0402f425380f61187a646.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0442\u0435\u0439\u0434\u0436 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u0443\u044e \u0434\u043b\u044f \u043d\u0435\u0433\u043e .\u00a0<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u0435\u0441\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u0441\u043f\u0440\u0430\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u0435\u0440\u0435\u0432\u0435\u0448\u0438\u0432\u0430\u0442\u044c \u0430\u043b\u0438\u0430\u0441\u044b \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0444\u0438\u0447\u0438, \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443\u0436\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0432\u0435\u0442\u043a\u0435. \u042d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 aws cli.<\/p>\n<p>\u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u044f \u0437\u0430\u0445\u043e\u0447\u0443, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u043b\u0435\u043d \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u043e\u0433 \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c feature environment \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438? \u041a\u0430\u0436\u0434\u043e\u0435 \u043d\u043e\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u2014\u00a0 \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u0439\u0434\u0436. \u0412\u0441\u0435 \u0441\u0442\u0435\u0439\u0434\u0436\u0438 \u0438 \u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0433\u0434\u0435-\u0442\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 SAM \u0448\u0430\u0431\u043b\u043e\u043d\u0435 (\u043d\u0435 \u0440\u0443\u043a\u0430\u043c\u0438 \u0436\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c?!), \u0447\u0442\u043e\u0431\u044b AWS \u0441\u043e\u0437\u0434\u0430\u043b ApiGateway \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0435\u0439\u0434\u0436\u0435\u0439, \u0430\u043b\u0438\u0430\u0441\u043e\u0432 \u0438 \u0432\u0435\u0440\u0441\u0438\u0439 \u0432\u044b\u0440\u0430\u0441\u0442\u0435\u0442 \u0432 \u0440\u0430\u0437\u044b.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u0432\u043e\u0442 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0441 \u043e\u0434\u043d\u0438\u043c \u0441\u0442\u0435\u043a\u043e\u043c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439.\u00a0<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f CF. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0435\u0439\u0434\u0436\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 CF \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u042f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043b\u043e\u0436\u043d\u044b\u0439 CI\/CD: \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e \u0432\u0435\u0440\u0441\u0438\u0439 \u0438 \u0430\u043b\u0438\u0430\u0441\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0444\u0438\u0447\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0441\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0432 \u201c\u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435\u201d, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e\u043b\u043e\u043c\u0430\u0442\u044c \u201c\u0447\u0443\u0436\u043e\u0435\u201d \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442. \u041d\u0435 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 feature environment \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0431\u043e\u043b\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d (\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u0442\u0435\u0439\u0434\u0436\u0438, \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435).<\/p>\n<\/li>\n<\/ul>\n<h4>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0435\u043a \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435<\/h4>\n<p>\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439 \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0448\u0430\u0431\u043b\u043e\u043d. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438. \u041d\u0435 \u043d\u0443\u0436\u043d\u044b \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438, \u0430\u043b\u0438\u0430\u0441\u044b, \u0441\u0442\u0435\u0439\u0434\u0436\u0438. \u041b\u044f\u043c\u0431\u0434\u0430 \u0432 \u0441\u0442\u0435\u043a\u0435 \u0434\u043b\u044f dev \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043b\u044f\u043c\u0431\u0434\u044b \u0434\u043b\u044f qa. \u042d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 ARN. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435\u0433\u0434\u0430. \u041f\u0440\u0438\u0447\u0435\u043c \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438. \u0412\u043e <a href=\"https:\/\/habr.com\/ru\/company\/lineate\/blog\/656695\/\"><u>\u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/u><\/a> \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u0449\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0435\u043a. \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442\u0441\u044f \u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u0442\u0435\u043a\u043e\u0432.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0441\u044c \u043d\u0430 \u043d\u0435\u043c. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043c\u043e\u0439 ApiGateway \u0440\u0435\u0441\u0443\u0440\u0441 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u0442\u0435\u0439\u0434\u0436. \u041f\u0443\u0441\u0442\u044c \u043e\u043d \u0431\u0443\u0434\u0435\u0442 prod.<\/p>\n<p>\u041e\u043a, \u0441\u043e Stage \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0441\u044f. \u0410 \u0447\u0442\u043e \u0437\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0441 OpenApiVersion? \u0410 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e <a href=\"https:\/\/github.com\/aws\/serverless-application-model\/issues\/191\"><u>\u0431\u0430\u0433\u0430 \u0432 SAM<\/u><\/a>. \u041e\u043d \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0430\u043a\u0442\u0443\u0430\u043b\u0435\u043d. \u0411\u0430\u0433 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 ApiGateway \u043f\u043e\u043c\u0438\u043c\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u0442\u0435\u0439\u0434\u0436\u0430 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e prod), sam \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0435\u0449\u0435 \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u044b\u0439 \u0441\u0442\u0435\u0439\u0434\u0436 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u201cStage\u201d. \u0415\u0441\u043b\u0438 \u0432 \u0440\u0435\u0441\u0443\u0440\u0441\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u0435 OpenApiVersion, \u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442. \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u0440\u0447\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u044d\u0442\u043e\u0442 \u0444\u043b\u0430\u0436\u043e\u043a \u043b\u0435\u0447\u0438\u0442\u044c \u043d\u0435 \u0443\u043c\u0435\u0435\u0442.<\/p>\n<h2>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 API  <\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 ApiGateway \u0440\u0435\u0441\u0443\u0440\u0441 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a \u043b\u044f\u043c\u0431\u0434\u0435 \u0432 sam \u043a\u043e\u043d\u0444\u0438\u0433\u0435. \u0417\u0430\u043e\u0434\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u044e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 REST \u0443\u0440\u043b\u044b:  <\/p>\n<pre><code class=\"yaml\"># .\/template.yaml GetProjectByIdFunction:     Type: AWS::Serverless::Function     Properties: ...       Events:         ApiEvent:           Type: Api           Properties:             Path: \/projects\/{projectId}             Method: get             RestApiId: !Ref BugTrackerApi<\/code><\/pre>\n<p>\u042f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432 \u043f\u0443\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e projectId, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u2014 http \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 RestApiId \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 API. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u043b\u044e \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 \u043c\u043e\u0438\u043c ApiGateway.<\/p>\n<p>ApiGateway \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0412 \u043a\u043e\u0434\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043c\u043e\u0435\u0439 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 event. \u0424\u043e\u0440\u043c\u0430\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u044f \u0441\u0434\u0435\u043b\u0430\u044e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 GET \/projects\/1, \u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 event \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f (\u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u044b\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435):<\/p>\n<pre><code class=\"json\">{   \"pathParameters\": {      \"projectId\": \"1\"    },   \"httpMethod\": \"GET\", ... }<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 POST \/projects\/1 \u0437\u0430\u043f\u0440\u043e\u0441\u0430:  <\/p>\n<pre><code class=\"json\">{   \"pathParameters\": {      \"projectId\": \"1\"    },   \"httpMethod\": \"POST\",   \"body\": \"{\\\"message\\\": \\\"hello world\\\"}\", ... }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0440\u0430\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0438 query \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f:  <\/p>\n<pre><code class=\"javascript\">\/\/ .\/src\/handlers\/get-project-by-id\/app.js exports.lambdaHandler = async (event, context) => {     const projectId = event.pathParameters.projectId;     try {         const dbPassword = ...;         const dbConnection = ...;         const [rows, fields] = await dbConnection.execute(\"SELECT * FROM `projects` where `id` = ?\", [projectId]);<\/code><\/pre>\n<p>\u0427\u0442\u043e \u043d\u0430\u0441\u0447\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0430? \u0412 \u043b\u044f\u043c\u0431\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u043d\u043e \u0434\u043b\u044f ApiGateway \u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435 \u0432\u0441\u0435. \u0421\u0435\u0440\u0432\u0438\u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435:  <\/p>\n<pre><code class=\"json\">{     \"isBase64Encoded\":false,     \"statusCode\": 200,     \"headers\": { \"Content-Type\": \"application\/json\", ... },     \"multiValueHeaders\": { \"headerName\": [\"headerValue\", \"headerValue2\", ...], ... },     \"body\": \"{\\\"status\\\":\\\"ok\\\"}\" }<\/code><\/pre>\n<p>\u0421\u0430\u043c\u044b\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u2014 \u044d\u0442\u043e statusCode \u0438 body. \u041f\u0435\u0440\u0432\u043e\u0435 ApiGateway \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442 \u0432 http code. \u0410 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 body \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0432\u0438\u0434\u0438\u0442 \u043a\u043b\u0438\u0435\u043d\u0442. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 json \u0432 \u043e\u0442\u0432\u0435\u0442\u0435, \u0442\u043e \u043d\u0430\u0434\u043e \u0432 body \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0443\u044e \u044d\u0442\u043e\u0442 json. isBase64Encoded \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 base64 \u0434\u0430\u043d\u043d\u044b\u0435. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u201c\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430\u201d \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439:  <\/p>\n<pre><code class=\"javascript\">\/\/ .\/src\/handlers\/get-project-by-id\/app.js  const [rows, fields] = await dbConnection.execute(..., [projectId]); var response = {   statusCode: 404,   body: {     msg: \"entity not found\"   } }; if(rows.length == 1) {   return {     statusCode: 200,     body: JSON.stringify(rows[0])   }; } else {   throw \"Entity not found\"; }<\/code><\/pre>\n<p>\u041b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438. \u0415\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435 (c async \u0438 promise, \u043a\u0430\u043a \u0443 \u043c\u0435\u043d\u044f), \u0442\u043e \u043b\u044e\u0431\u043e\u0435 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u043e\u0448\u0438\u0431\u043a\u0435. \u041e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043e\u0442 \u043b\u044f\u043c\u0431\u0434\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"json\">{   \"errorType\": \"TypeError\",   \"errorMessage\": \"Cannot read property 'projectId' of undefined\",   \"trace\": [     \"TypeError: Cannot read property 'projectId' of undefined\",     \"    at Runtime.exports.lambdaHandler [as handler] (\/var\/task\/get_project_by_id.js:7:44)\",     \"    at Runtime.handleOnce (\/var\/runtime\/Runtime.js:66:25)\"   ] }<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0435 errorMessage \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0435\u043a\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0438. \u041f\u043e\u043b\u0435 errorType \u2014 \u0442\u0438\u043f \u043e\u0448\u0438\u0431\u043a\u0438. \u0410 \u043f\u043e\u043b\u0435 trace \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0442\u0435\u043a\u0442\u0440\u0435\u0439\u0441 \u043e\u0448\u0438\u0431\u043a\u0438, \u0435\u0441\u043b\u0438 \u043e\u043d \u0435\u0441\u0442\u044c.<\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u044d\u0442\u043e\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u043d\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0432 ApiGateway. \u041b\u044e\u0431\u044b\u0435 \u0442\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043b\u044f\u043c\u0431\u0434\u0435 ApiGateway \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u0412\u043e\u043e\u0431\u0449\u0435, \u0435\u0441\u043b\u0438 \u043b\u044f\u043c\u0431\u0434\u0430 \u0432\u0435\u0440\u043d\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0435 \u043f\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0443, \u0442\u043e \u044f \u0443\u0432\u0438\u0436\u0443 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 502 \u043e\u0448\u0438\u0431\u043a\u0443. \u0427\u0442\u043e\u0431\u044b \u0442\u0430\u043a\u0438\u0445 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u043d\u0435 \u0441\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c, \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0438 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 http code.<\/p>\n<pre><code class=\"javascript\">\/\/ .\/src\/handlers\/get-project-by-id\/app.js try {   \/\/db query here     var response = ...; return response; } catch (err) {     \/\/db exception   console.log(\"Cannot retrieve project by id\", err); return {   statusCode: 500,   body: JSON.stringify({     msg: err.message   }) }; } <\/code><\/pre>\n<p>\u041b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u044f \u043c\u043e\u0433\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a. \u041d\u043e \u044f \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0433\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u00a0 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0435 \u0441 http \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0433\u0440\u0430\u0442\u044c \u0440\u043e\u043b\u044c ApiGateway. \u041f\u043e \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0438, \u043e\u043f\u0438\u0448\u0443 2 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438 \u043f\u043b\u0430\u0433\u0438\u043d AWS Toolkit \u0434\u043b\u044f VSCode.<\/p>\n<h4>\u0417\u0430\u043f\u0443\u0441\u043a \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438<\/h4>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u2014 \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u0434\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 sam cli. \u0412 \u044d\u0442\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u043e\u043a\u0430 \u0435\u0433\u043e \u044f\u0432\u043d\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c. \u042d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 hot reloading, \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043a \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0431\u0435\u0437 \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">serverless-bugtracker> sam local start api .\/env.json<\/code><\/pre>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e \u0444\u0430\u0439\u043b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 <a href=\"https:\/\/habr.com\/ru\/company\/lineate\/blog\/657171\/\"><u>\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438<\/u><\/a>. \u0422\u0430\u043a\u0430\u044f \u0436\u0435 \u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 API. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u0440\u0435\u0436\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043e\u0442\u043b\u0430\u0434\u043a\u0430 \u0442\u0443\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0447\u0435\u0440\u0435\u0437 \u0431\u043e\u043b\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u0435\u043d \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a, \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043b\u044f\u043c\u0431\u0434\u0443 \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435&#8230; \u041f\u043e \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f\u043c \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f.<\/p>\n<h4>\u0417\u0430\u043f\u0443\u0441\u043a \u0432 VSCode<\/h4>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u2014 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 VSCode. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 API \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"json\">\/\/ .\/vscode\/launch.json {   \"type\": \"aws-sam\",   \"request\": \"direct-invoke\",   \"name\": \"API serverless-bugtracker:GetProjectByIdFunction\",   \"invokeTarget\": {     \"target\": \"api\",     \"templatePath\": \"${workspaceFolder}\/template.yaml\",     \"logicalId\": \"GetProjectByIdFunction\",   },   \"api\": {     \"path\": \"\/projects\/1\",     \"httpMethod\": \"get\",     \"payload\": {       \"json\": {}     }   },   \"sam\": {     \"localArguments\": [\"--env-vars\",\"D:\\\\serverless-bugtracker\\\\env.json\"]   } },<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043a\u043e\u0434\u0430, \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 api \u044f \u0432 \u044f\u0432\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e url \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u0441\u043b\u0430\u0442\u044c. \u042f \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043c\u043e\u0433\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043b\u044f\u043c\u0431\u0434\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u0432\u0441\u0435\u0433\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b payload, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u043f\u043e\u0441\u044b\u043b\u0430\u043b \u0440\u0430\u043d\u0435\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0440\u0430\u0437\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u044f\u043c\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0442\u043e \u0434\u043b\u044f API \u044d\u0442\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u0439\u043b. \u0412 \u0441\u0435\u043a\u0446\u0438\u0438 json (\u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438) \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f POST\/PUT \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0412 \u043b\u043e\u0433\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043e\u0442\u0432\u0435\u0442\u044b ApiGateway. \u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0443 \u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0447\u0442\u043e \u044f \u043e\u043f\u0438\u0441\u0430\u043b \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 sam local start-api. \u041f\u0440\u0430\u0432\u0434\u0430, \u044d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u043d\u0435\u0434\u0440 VSCode, \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438. \u0412 \u044d\u0442\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 VSCode \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a. \u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0434 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u0442\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438.<\/p>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u0412 AWS Console \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0443\u0440\u043b, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d ApiGateway.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0ae\/f27\/50b\/0aef2750bbca904525c3bfc80dcd2873.png\" width=\"1021\" height=\"339\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0ae\/f27\/50b\/0aef2750bbca904525c3bfc80dcd2873.png\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 GitHub  <\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b, \u043c\u043d\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 GitHub \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f github api. \u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043f\u0430\u0440\u043e\u043b\u044f\u043c\u0438 \u043e\u0442 RDS, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 SSM. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 github-token \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u043a \u0411\u0414:  <\/p>\n<pre><code class=\"javascript\">\/\/ .\/src\/handlers\/get-project-by-id\/app.js const { Octokit } = require(\"@octokit\/rest\");  const githubTokenPromise = getParameterFromSsm(\"\/dev\/serverless-bugtracker\/github-token\"); const githubPromise = githubTokenPromise.then(token => {     return new Octokit({         auth: token, request:  {agent: new https.Agent({ keepAlive: true })}     }); }); exports.lambdaHandler = async (event, context) => {     \/\/connect to db, etc...     const [rows, fields] = ...;     const project = rows[0];     const { data: prInfo} = await listPullRequests(project['github_owner'], project['github_repo']);     \/\/parse pull requests and prepare response... }  async function listPullRequests(projectOwner, projectRepo) {     const githubClient = await githubPromise;     return githubClient.rest.pulls.list(...); }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e \u0441\u043f\u0438\u0441\u043e\u043a \u0435\u0433\u043e PR \u0438\u0437 \u0433\u0438\u0442\u0445\u0430\u0431\u0430. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u044f \u043d\u0430\u0441\u0442\u0440\u043e\u044e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043c\u043e\u0438\u043c ApiGateway: \u0434\u043e\u0431\u0430\u0432\u043b\u044e URL, \u043d\u0430\u0441\u0442\u0440\u043e\u044e VPC \u043f\u043e\u0434\u0441\u0435\u0442\u0438.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 \u043a\u043e\u0434\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u0448\u0438\u0442\u044b \u0438\u043c\u0435\u043d\u0430 SSM \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0438 github \u0442\u043e\u043a\u0435\u043d\u043e\u043c. \u042d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 template.yaml, \u0442\u043e \u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439. \u042d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f dev \u0438 qa \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u044d\u0442\u043e \u0438\u043c\u044f \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 &#8212; \u0438\u043c\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"yaml\">Parameters:   Env:     Description: Environment name     Type: String     Default: dev<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0439\u0442\u0438 \u0434\u0432\u0443\u043c\u044f \u043f\u0443\u0442\u044f\u043c\u0438.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 &#8212; \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443-\u0448\u0430\u0431\u043b\u043e\u043d, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Env. \u042d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:<\/p>\n<pre><code class=\"yaml\">Globals:   Function:     Environment:       Variables:         DB_NAME: !Sub '{{resolve:ssm:\/${Env}\/serverless-bugtracker\/db-name}}'<\/code><\/pre>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 &#8212; \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c\u044b \u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044f \u0445\u043e\u0447\u0443 \u0438\u043c\u0435\u0442\u044c \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"yaml\">Mappings:   LambdaSizes:     dev:       \"memorySize\": \"128\"     qa:       \"memorySize\": \"128\"     stg:       \"memorySize\": \"512\"   Globals:   Function:     MemorySize: !FindInMap [LambdaSizes, !Ref Env, memorySize]<\/code><\/pre>\n<p>\u0411\u043b\u043e\u043a Mappings \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u044e\u0447 &#8212; \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u0435\u043d\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043f\u043e\u043b\u0435 memorySize. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0432 \u044d\u0442\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435. \u0424\u0443\u043d\u043a\u0446\u0438\u044f FindInMap \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u0447\u0442\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443.  <\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u0438  <\/h2>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0435 REST API.\u00a0<\/p>\n<p>\u041d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 API \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0438\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u0442\u043e \u044f \u0441\u043c\u043e\u0433\u0443 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. \u0412 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043d\u0435\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0430\u0441\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 (\u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Bearer-\u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 \u0441 AWS WAF \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Cognito). \u041d\u043e \u044f \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e, \u0442.\u043a. \u043c\u0435\u043d\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043c\u043e\u0435\u043c\u0443 ApiGateway \u043d\u0430 \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 ApiGateway \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043c\u043e\u0435\u0439 VPC.<\/p>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0433\u043e API \u0441\u0435\u0440\u0432\u0438\u0441 ApiGateway \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 Endpoint Type, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0442\u0438\u043f\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>edge-optimized &#8212; \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a API. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u043e\u0447\u043a\u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f CloudFront (CDN \u043e\u0442 AWS) &#8212; \u0442\u043e \u0435\u0441\u0442\u044c, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u044d\u0442\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 ApiGateway \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043a \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0439 \u0442\u043e\u0447\u043a\u0435 CloudFront;<\/p>\n<\/li>\n<li>\n<p>regional &#8212; \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0437 \u0440\u0435\u0433\u0438\u043e\u043d\u0430, \u0433\u0434\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043e API;<\/p>\n<\/li>\n<li>\n<p>private &#8212; \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 VPC.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u0435\u043d\u044f \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043f\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c, \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b \u0442\u0438\u043f Private. \u0414\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 Private-\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 ApiGateway \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f VPC Endpoints \u0438 Resource Policies. VPC Endpoints \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 VPC \u0434\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 AWS, \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u044f\u043c\u043e\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0432 VPC. \u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 VPC Endpoints, \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u043e\u0439 \u043d\u0438\u0436\u0435 \u2014 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a ApiGateway \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u043a\u0440\u0430\u0441\u043d\u0430\u044f \u043b\u0438\u043d\u0438\u044f) \u0438 \u0447\u0435\u0440\u0435\u0437 VPC Endpoint (\u0437\u0435\u043b\u0435\u043d\u0430\u044f \u043b\u0438\u043d\u0438\u044f). \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u0440\u0430\u0444\u0438\u043a \u043a ApiGateway \u0438\u0434\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u0443\u044e \u0441\u0435\u0442\u044c \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442, \u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f VPC Endpoint \u043c\u043e\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043d\u0435 \u043f\u043e\u043a\u0438\u043d\u0435\u0442 \u043f\u0440\u0435\u0434\u0435\u043b\u043e\u0432 \u0441\u0435\u0442\u0438 AWS:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e8f\/365\/c8d\/e8f365c8d09065d95e9f03358093510e.png\" width=\"720\" height=\"421\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e8f\/365\/c8d\/e8f365c8d09065d95e9f03358093510e.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f VPC Endpoint \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0432 CF \u0448\u0430\u0431\u043b\u043e\u043d \u043c\u043e\u0435\u0439 VPC. \u0414\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0440\u044f\u0434 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445:<\/p>\n<ul>\n<li>\n<p>PrivateDnsEnabled \u2014\u00a0 \u0434\u0430\u043d\u043d\u0430\u044f \u043e\u043f\u0446\u0438\u044f \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 DNS-\u0438\u043c\u044f \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0433\u043e ApiGateway, \u0442\u043e \u0435\u0441\u0442\u044c \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043c\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 ApiGateway endpoint URL \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 VPC Endpoint;<\/p>\n<\/li>\n<li>\n<p>ServiceName\u00a0 \u2014 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 AWS \u043c\u043d\u0435 \u043d\u0443\u0436\u0435\u043d VPC Endpoint \u2014\u00a0 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AWS CLI.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0438\u0436\u0435 \u044f \u043f\u0440\u0438\u0432\u0435\u043b \u043a\u043e\u0434 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 VPC Endpoint \u0431\u0435\u0437 \u0432\u0441\u0435\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432:<\/p>\n<pre><code class=\"yaml\"># .\/global-resources\/vpc.yaml ApiGwVpcEndpoint:   Type: AWS::EC2::VPCEndpoint   Properties:     PolicyDocument:       Version: 2012-10-17       Statement:         - Effect: Allow           Principal: '*'           Action: '*'           Resource: '*'     SubnetIds:       - !Ref PrivateSubnet00       - !Ref PrivateSubnet01     VpcEndpointType: Interface     PrivateDnsEnabled: true     SecurityGroupIds:       - !Ref ApiGwSecurityGroup     ServiceName: !Sub 'com.amazonaws.${AWS::Region}.execute-api'     VpcId: !Ref VPC<\/code><\/pre>\n<p>\u0412 \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0445 Resource Policies \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a ApiGateway. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0440\u0435\u0441\u0443\u0440\u0441 ApiGateway \u043f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432 Private-\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435:  <\/p>\n<pre><code class=\"yaml\"># .\/teamplate.yaml BugTrackerApi:     Type: AWS::Serverless::Api     Properties:     ...       EndpointConfiguration:         Type: PRIVATE         VPCEndpointIds:           - !ImportValue             'Fn::Sub': '${GlobalResourceStack}-VPCeApiGW'       Auth:         ResourcePolicy:           IntrinsicVpceWhitelist:             - !ImportValue               'Fn::Sub': '${GlobalResourceStack}-VPCeApiGW'<\/code><\/pre>\n<p>\u0412 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0433\u043e Endpoint, \u0433\u0434\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u0438\u043f Endpoint \u0438 ID \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e VPC Endpoint, \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Auth \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f Resource Policy, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0434\u043b\u044f ApiGateway \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Resource Policy \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 SAM-\u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0434\u043b\u044f ApiGateway \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043f\u043e\u043b\u0438\u0442\u0438\u043a \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0430\u0432\u0438\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f \u0432\u0437\u044f\u043b \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0448\u0430\u0431\u043b\u043e\u043d IntrinsicVpceWhitelist. \u0414\u0430\u043d\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0437\u0430\u0434\u0430\u0435\u0442 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 ApiGateway \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e VPC Endpoint. \u0422\u043e \u0435\u0441\u0442\u044c, \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Resource Policies \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0434\u0438\u043d \u0438\u0437 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 (\u0432 \u0432\u0438\u0434\u0435 allow\/block-\u043b\u0438\u0441\u0442\u043e\u0432 \u0434\u043b\u044f IP Range, AWS Account ID, VPC \u0438\u043b\u0438 VPC-endpoint), \u0442\u0430\u043a \u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043f\u043e\u0445\u043e\u0436\u0435\u043c \u043d\u0430 IAM-\u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443(CustomStatements). \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Resource Policy \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 IAM-\u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438, \u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u043e\u0442\u043b\u0438\u0447\u0438\u0439. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u2014 \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430: \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 IAM \u044d\u0442\u043e \u043b\u0438\u0431\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0433\u0440\u0443\u043f\u043f\u0430 \u0438\u043b\u0438 \u0440\u043e\u043b\u044c; \u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 Resource Policy \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c \u0441\u0435\u0440\u0432\u0438\u0441. \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043b \u0432\u044b\u0448\u0435\u00a0 \u2014 \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u043f\u0440\u0435\u0441\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Resource Policy (\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a VPC-endpoint \u2014\u00a0 IntrinsicVpceWhitelist).\u00a0<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u0434\u0432\u0435\u0434\u0443 \u0438\u0442\u043e\u0433 \u043f\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a ApiGateway:\u00a0 \u044f \u0441\u043e\u0437\u0434\u0430\u043b Interface VPC Endpoint, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 Endpoint Type \u0438 \u0437\u0430\u0434\u0430\u043b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 Resource Policy. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a ApiGateway. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e Endpoint Type \u043c\u043e\u0436\u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.\u00a0<\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u043f\u043e\u0441\u043b\u0435 \u043b\u044e\u0431\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Resource Policy \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c Deploy API, \u0442.\u043a. \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 Resource Policy \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 UI \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430 \u043c\u0435\u043d\u044e Deploy API \u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"bash\">aws apigateway create-deployment --rest-api-id xxxxxxxx --stage-name prod --description 'Deployment to the prod stage'<\/code><\/pre>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 rest-api-id \u2014\u00a0 \u044d\u0442\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e ApiGateway \u0440\u0435\u0441\u0443\u0440\u0441\u0430. \u0412\u0437\u044f\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 AWS \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0442\u0430\u043a \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 CLI \u043a\u043e\u043c\u0430\u043d\u0434\u044b:  <\/p>\n<pre><code class=\"bash\">aws apigateway get-rest-apis --query 'items[*].[name,id]'<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e (\u0438\u043c\u044f \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440) \u043f\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c ApiGateway. \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043d\u0438\u0436\u0435:  <\/p>\n<pre><code class=\"json\">[     [         \"myapi1\",         \"bay55rt458\"     ],     [         \"serverless-bugtracker-ch3\",         \"q0cr55puj4\"     ] ]<\/code><\/pre>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0440\u0435\u0437\u043e\u043d\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u0430 \u043a\u0430\u043a \u043c\u043d\u0435 \u0441\u0430\u043c\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e ApiGateway, \u0435\u0441\u043b\u0438 \u044f \u0435\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u044e \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c \u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0435\u043c\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 VPC? \u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0433\u043b\u0430\u0432\u0435 \u044f \u0443\u0436\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u043b \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 VPN \u043e\u0442 AWS, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u043c\u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e RDS \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e \u044f \u043c\u043e\u0433\u0443 \u0434\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u043e ApiGateway \u2014 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043e\u0441\u0442\u0440\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0447\u0435\u0440\u0435\u0437 \u043e\u0434\u0438\u043d VPC Endpoint \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c ApiGateway, \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c CF-\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 VPC Endpoint \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0432 CF-\u0441\u0442\u0435\u043a \u0434\u043b\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043d\u0438\u0436\u043d\u0438\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 Application-\u0441\u0442\u0435\u043a (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, dev\/stg\/qa) \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 VPC Endpoint, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0432 \u0441\u0442\u0435\u043a\u0435 \u0441 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.<\/p>\n<h2>\u041f\u043e\u0434\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438\u0442\u043e\u0433\u043e\u0432<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u0441\u043e\u0431\u0440\u0430\u043b \u0432\u0441\u0435 \u0441\u0432\u043e\u0438 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043e\u0434\u043d\u043e API. \u042d\u0442\u043e API, \u043a\u0430\u043a \u0438 \u0432\u0441\u0435 \u043c\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0434\u0432\u0443\u0445 sam \u043a\u043e\u043c\u0430\u043d\u0434. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 VSCode.<\/p>\n<p>API \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 VPC, \u0433\u0434\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u0430 \u0440\u0430\u043d\u0435\u0435 \u0411\u0414.<\/p>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e. \u041a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/akoval\/serverless-bugtracker\/tree\/chapter4\">\u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0431\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0434 \u0440\u0438\u0441\u043a\u043e\u0432\u0430\u043d\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u043d\u0430\u0441\u0442\u0440\u043e\u044e CI\/CD \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043b\u043e\u0433\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c, \u0433\u0434\u0435 \u043d\u0430\u0439\u0442\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c AWS \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c \u0434\u043b\u044f \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043a\u043e\u043d\u0447\u0443 \u0431\u043e\u0440\u044c\u0431\u0443 \u0441 cold start.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/company\/lineate\/blog\/659579\/\"> https:\/\/habr.com\/ru\/company\/lineate\/blog\/659579\/<\/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>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043a\u0443\u0431\u0438\u043a\u0438, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 serverless \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/lineate\/blog\/655523\/\"><u>\u041f\u0435\u0440\u0432\u044b\u0435 \u0448\u0430\u0433\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u043b\u044f\u043c\u0431\u0434\u0430 (\u0427\u0430\u0441\u0442\u044c 1)<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/lineate\/blog\/656695\/\"><u>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0411\u0414 (\u0427\u0430\u0441\u0442\u044c 2)<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/lineate\/blog\/657171\/\"><u>\u041a\u0430\u043a \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c\u0441\u044f \u0441 \u0411\u0414 (\u0427\u0430\u0441\u0442\u044c 3)<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e 4 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u0430 \u0411\u0414. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0441 \u0411\u0414, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438. \u0412\u0441\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 SAM \u043a\u043e\u043c\u0430\u043d\u0434.<\/p>\n<p>\u041d\u043e \u043f\u043e\u043a\u0430 \u044d\u0442\u043e \u043c\u0430\u043b\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0442.\u043a. \u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435\u0442 API. \u041c\u043e\u0438 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u0443\u043c\u0435\u044e\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c http \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0422\u0430\u043a \u0447\u0442\u043e\u00a0 \u0432 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u0437\u0430\u0439\u043c\u0443\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e API. \u0422\u0430\u043a\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 github api.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 API \u0432 SAM \u0448\u0430\u0431\u043b\u043e\u043d\u0435<\/h2>\n<p>\u0412 \u043c\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c REST API. \u0414\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 http \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 ApiGateway \u043e\u0442 AWS. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c API, \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 http \u0437\u0430\u043f\u0440\u043e\u0441 ApiGateway \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439.\u00a0<\/p>\n<p>\u0412 \u043c\u043e\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0411\u0414. \u041d\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430. \u041d\u0430\u0434\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u043f\u043e\u0434 \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0442 ApiGateway. \u041f\u043e\u0445\u043e\u0436\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0438 \u0441 \u043e\u0442\u0432\u0435\u0442\u043e\u043c, \u043c\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f ApiGateway. \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043f\u0430\u043f\u043a\u0435 events \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. SAM \u0437\u0430\u0431\u043e\u0442\u043b\u0438\u0432\u043e \u0441\u043e\u0437\u0434\u0430\u043b \u0435\u0433\u043e, \u043a\u043e\u0433\u0434\u0430 \u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.\u00a0<\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 SAM \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 API. \u0412 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0434\u043b\u044f \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e Events:<\/p>\n<pre><code class=\"yaml\"># .\/template.yaml Resources:   GetProjectByIdFunction:     Type: AWS::Serverless::Function     Properties:       CodeUri: src\/handlers\/get-project-by-id       Handler: app.lambdaHandler       Runtime: nodejs14.x       Events:         HelloWorld:           Type: Api           Properties:             Path: \/hello             Method: get<\/code><\/pre>\n<p>\u042d\u0442\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c, \u0442\u0438\u043f \u201cApi\u201d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 ApiGateway \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430, \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u043f\u0443\u0442\u044c, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439.<\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u044f \u043d\u0438\u0433\u0434\u0435 \u044f\u0432\u043d\u043e \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u0440\u0435\u0441\u0443\u0440\u0441 ApiGateway. SAM \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0435\u0433\u043e \u0441\u0430\u043c. \u0422\u0430\u043a\u043e\u0439 \u0432\u0438\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f API \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f implicit api. SAM \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b Events \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u0441 \u0442\u0438\u043f\u043e\u043c <em>Api, \u0441<\/em>\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u0443\u0442\u0438, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442. \u0418 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441 \u0442\u0438\u043f\u0430 AWS::Serverless::Api \u0441 \u0438\u043c\u0435\u043d\u0435\u043c ServerlessRestApi. \u0412 \u044d\u0442\u043e\u043c API \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u043f\u0443\u0442\u0438, \u043d\u0430 \u044d\u0442\u0438 \u043f\u0443\u0442\u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u043b\u044f\u043c\u0431\u0434\u044b. Implicit api \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445, \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u043d\u0443\u0436\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043d\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 ApiGateway \u0441 \u0438\u043c\u0435\u043d\u0435\u043c, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u043c \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0441\u0442\u0435\u043a\u0430, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"yaml\"># .\/template.yaml BugTrackerApi:     Type: AWS::Serverless::Api     Properties:       StageName: prod       OpenApiVersion: \"3.0.3\"   GetProjectByIdFunction:     Type: AWS::Serverless::Function     Properties:       ...       Events:         ApiEvent:           Type: Api           Properties:             Path: \/hello             Method: get             RestApiId: !Ref BugTrackerApi<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 API Gateway. <\/p>\n<p>\u0421 OpenApiVersion \u0441\u0432\u044f\u0437\u0430\u043d \u043e\u0434\u0438\u043d <a href=\"https:\/\/github.com\/aws\/serverless-application-model\/issues\/191\"><u>\u0431\u0430\u0433 \u0432 SAM<\/u><\/a>. \u0411\u0430\u0433 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 ApiGateway \u043f\u043e\u043c\u0438\u043c\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u0442\u0435\u0439\u0434\u0436\u0430 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e prod), sam \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0435\u0449\u0435 \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u044b\u0439 \u0441\u0442\u0435\u0439\u0434\u0436 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u201cStage\u201d. \u0415\u0441\u043b\u0438 \u0432 \u0440\u0435\u0441\u0443\u0440\u0441\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u0435 OpenApiVersion, \u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442. \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u0440\u0447\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u044d\u0442\u043e\u0442 \u0444\u043b\u0430\u0436\u043e\u043a \u043b\u0435\u0447\u0438\u0442\u044c \u043d\u0435 \u0443\u043c\u0435\u0435\u0442.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0435\u0440\u0443\u0441\u044c \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c StageName. \u041d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2014 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439.    <\/p>\n<h3>Multi Stage vs Multi Stack<\/h3>\n<p>\u0420\u0430\u043d\u0435\u0435 \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u0430\u0441\u0430\u043b\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441 CF \u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u043c\u0438. \u0412\u0435\u0440\u043d\u0443\u0441\u044c \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u0438 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u0435\u0433\u043e \u0433\u043b\u0443\u0431\u0436\u0435.\u00a0<\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c 3-4 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u2014 dev, qa, stg, prod (\u0447\u0430\u0441\u0442\u043e \u044d\u0442\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0435). \u041e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c feature environment \u0434\u043b\u044f \u0447\u043b\u0435\u043d\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0442\u0430\u043a\u0438\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439:<\/p>\n<ul>\n<li>\n<p>\u0432\u0441\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0432 \u043e\u0434\u043d\u043e\u043c SAM\/CF \u0441\u0442\u0435\u043a\u0435,\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0435\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043e\u0434\u0438\u043d \u0441\u0442\u0435\u043a \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439. \u041a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043b\u044f\u043c\u0431\u0434\u0430\u043c\u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435?\u00a0<\/p>\n<h4>\u041e\u0434\u0438\u043d \u0441\u0442\u0435\u043a<\/h4>\n<p>\u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u0420\u0435\u0441\u0443\u0440\u0441 \u0441 \u043b\u044f\u043c\u0431\u0434\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u043e\u0434\u0438\u043d. \u041d\u043e \u043a\u0430\u043a-\u0442\u043e \u043d\u0430\u0434\u043e \u0440\u0430\u0437\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u043b\u044f\u043c\u0431\u0434\u044b \u0438\u043c\u0435\u0442\u044c \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439: \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0430\u043b\u0438\u0430\u0441\u044b. \u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044b\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u0441\u043b\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f. \u0412\u0435\u0440\u0441\u0438\u044f \u2014 \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, AWS \u0441\u0430\u043c \u0435\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442. \u0414\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043b\u044f\u043c\u0431\u0434\u044b \u0435\u0441\u0442\u044c $LATEST \u0432\u0435\u0440\u0441\u0438\u044f. \u041f\u043e\u043c\u0438\u043c\u043e \u0432\u0435\u0440\u0441\u0438\u0439 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0430\u043b\u0438\u0430\u0441\u044b \u2014 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.\u00a0<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u0430\u044f \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f MyFunc. \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u043b\u0438\u0430\u0441 DEV_MY_FUNC, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 $LATEST, \u0430\u043b\u0438\u0430\u0441 QA_MY_FUNC \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 5, \u0438 \u0430\u043b\u0438\u0430\u0441 STG_MY_FUNC \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 4. \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043c\u043e\u0435\u043c \u043e\u0431\u043b\u0430\u043a\u0435 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0438 \u043e\u0434\u043d\u043e\u0439 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 \u043c\u043e\u0435\u043c SAM \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0435\u0441\u0443\u0440\u0441 \u0441 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439.<\/p>\n<p>\u0412 ApiGateway \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0442\u0435\u0439\u0434\u0436\u0438. \u0421\u0442\u0435\u0439\u0434\u0436\u0438 \u043f\u043e \u0441\u0443\u0442\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u043f\u0438. \u0422\u0430\u043a\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043c\u043e\u0438\u0445 dev\/qa\/stg \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0443 \u043c\u043e\u0435\u0433\u043e \u0430\u043f\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u0442\u0435\u0439\u0434\u0436\u0438 dev, qa, stg \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u0442\u0435\u0439\u0434\u0436 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0443\u0440\u043b\u044b:  <\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/gateway_host\/alpha\/*\"><u>https:\/\/GATEWAY_HOST\/dev\/*<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/gateway_host\/alpha\/*\"><u>https:\/\/GATEWAY_HOST\/qa\/*<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/gateway_host\/alpha\/*\"><u>https:\/\/GATEWAY_HOST\/stg\/*<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f MyFunc. \u0425\u043e\u0447\u0443, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u043f\u0443\u0442\u0438 \/hello.  <\/p>\n<pre><code class=\"yaml\">MyFunc:     Type: AWS::Serverless::Function     Properties:       ...       Events:         ApiEvent:           Type: Api           Properties:             Path: \/hello             Method: get             RestApiId: !Ref MyApiGateway<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0432\u044f\u0437\u0430\u0442\u044c ApiGateway \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0442\u043e \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>https:\/\/GATEWAY_HOST\/dev\/hello<\/p>\n<\/li>\n<li>\n<p>https:\/\/GATEWAY_HOST\/qa\/hello<\/p>\n<\/li>\n<li>\n<p>https:\/\/GATEWAY_HOST\/stg\/hello<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0432\u0441\u0435 \u043c\u043e\u0438 API \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u0410 \u044f \u0445\u043e\u0447\u0443, \u0447\u0442\u043e\u0431\u044b dev \u0441\u0442\u0435\u0439\u0434\u0436 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441\u043e \u0441\u0432\u0435\u0436\u0438\u043c \u043a\u043e\u0434\u043e\u043c, \u0430 qa \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c. \u041a\u0430\u043a \u0440\u0430\u0437 \u0442\u0443\u0442 \u0432 \u0438\u0433\u0440\u0443 \u0438 \u0432\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0430\u043b\u0438\u0430\u0441\u044b.<\/p>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0442\u0435\u0439\u0434\u0436\u0430 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u042f \u0441\u043e\u0437\u0434\u0430\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e MY_FUNC_ALIAS. \u041e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438\u043c\u044f \u0430\u043b\u0438\u0430\u0441\u0430 \u043c\u043e\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044e.\u00a0<\/p>\n<p>\u0414\u043b\u044f dev \u0441\u0442\u0435\u0439\u0434\u0436\u0430\u00a0 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 DEV_MY_FUNC, \u0434\u043b\u044f qa \u2014\u00a0 QA_MY_FUNC, \u0434\u043b\u044f stg \u2014\u00a0 STG_MY_FUNC.<\/p>\n<p>\u041d\u0443 \u0438 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0430\u0433. \u041d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c ApiGateway \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 $LATEST \u0432\u0435\u0440\u0441\u0438\u044e \u043c\u043e\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u0442\u0443 \u0432\u0435\u0440\u0441\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0434\u0430\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 MY_FUNC_ALIAS.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 ApiGateway \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u043d\u0435 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u0441 \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 MyFunc:${stageVariables.MY_FUNC_ALIAS}.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 UI, \u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0442\u0435\u0439\u0434\u0436 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u0443\u044e \u0434\u043b\u044f \u043d\u0435\u0433\u043e .\u00a0<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u0435\u0441\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u0441\u043f\u0440\u0430\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u0435\u0440\u0435\u0432\u0435\u0448\u0438\u0432\u0430\u0442\u044c \u0430\u043b\u0438\u0430\u0441\u044b \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0444\u0438\u0447\u0438, \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443\u0436\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0432\u0435\u0442\u043a\u0435. \u042d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 aws cli.<\/p>\n<p>\u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u044f \u0437\u0430\u0445\u043e\u0447\u0443, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u043b\u0435\u043d \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u043e\u0433 \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c feature environment \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438? \u041a\u0430\u0436\u0434\u043e\u0435 \u043d\u043e\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u2014\u00a0 \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u0439\u0434\u0436. \u0412\u0441\u0435 \u0441\u0442\u0435\u0439\u0434\u0436\u0438 \u0438 \u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0433\u0434\u0435-\u0442\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 SAM \u0448\u0430\u0431\u043b\u043e\u043d\u0435 (\u043d\u0435 \u0440\u0443\u043a\u0430\u043c\u0438 \u0436\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c?!), \u0447\u0442\u043e\u0431\u044b AWS \u0441\u043e\u0437\u0434\u0430\u043b ApiGateway \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0435\u0439\u0434\u0436\u0435\u0439, \u0430\u043b\u0438\u0430\u0441\u043e\u0432 \u0438 \u0432\u0435\u0440\u0441\u0438\u0439 \u0432\u044b\u0440\u0430\u0441\u0442\u0435\u0442 \u0432 \u0440\u0430\u0437\u044b.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u0432\u043e\u0442 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0441 \u043e\u0434\u043d\u0438\u043c \u0441\u0442\u0435\u043a\u043e\u043c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439.\u00a0<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f CF. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0435\u0439\u0434\u0436\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 CF \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u042f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043b\u043e\u0436\u043d\u044b\u0439 CI\/CD: \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e \u0432\u0435\u0440\u0441\u0438\u0439 \u0438 \u0430\u043b\u0438\u0430\u0441\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0444\u0438\u0447\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0441\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0432 \u201c\u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435\u201d, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e\u043b\u043e\u043c\u0430\u0442\u044c \u201c\u0447\u0443\u0436\u043e\u0435\u201d \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442. \u041d\u0435 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 feature environment \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0431\u043e\u043b\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d (\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u0442\u0435\u0439\u0434\u0436\u0438, \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435).<\/p>\n<\/li>\n<\/ul>\n<h4>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0435\u043a \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435<\/h4>\n<p>\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439 \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0448\u0430\u0431\u043b\u043e\u043d. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438. \u041d\u0435 \u043d\u0443\u0436\u043d\u044b \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438, \u0430\u043b\u0438\u0430\u0441\u044b, \u0441\u0442\u0435\u0439\u0434\u0436\u0438. \u041b\u044f\u043c\u0431\u0434\u0430 \u0432 \u0441\u0442\u0435\u043a\u0435 \u0434\u043b\u044f dev \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043b\u044f\u043c\u0431\u0434\u044b \u0434\u043b\u044f qa. \u042d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 ARN. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435\u0433\u0434\u0430. \u041f\u0440\u0438\u0447\u0435\u043c \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438. \u0412\u043e <a href=\"https:\/\/habr.com\/ru\/company\/lineate\/blog\/656695\/\"><u>\u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/u><\/a> \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u0449\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0435\u043a. \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442\u0441\u044f \u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u0442\u0435\u043a\u043e\u0432.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0441\u044c \u043d\u0430 \u043d\u0435\u043c. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043c\u043e\u0439 ApiGateway \u0440\u0435\u0441\u0443\u0440\u0441 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u0442\u0435\u0439\u0434\u0436. \u041f\u0443\u0441\u0442\u044c \u043e\u043d \u0431\u0443\u0434\u0435\u0442 prod.<\/p>\n<p>\u041e\u043a, \u0441\u043e Stage \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0441\u044f. \u0410 \u0447\u0442\u043e \u0437\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0441 OpenApiVersion? \u0410 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e <a href=\"https:\/\/github.com\/aws\/serverless-application-model\/issues\/191\"><u>\u0431\u0430\u0433\u0430 \u0432 SAM<\/u><\/a>. \u041e\u043d \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0430\u043a\u0442\u0443\u0430\u043b\u0435\u043d. \u0411\u0430\u0433 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 ApiGateway \u043f\u043e\u043c\u0438\u043c\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u0442\u0435\u0439\u0434\u0436\u0430 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e prod), sam \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0435\u0449\u0435 \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u044b\u0439 \u0441\u0442\u0435\u0439\u0434\u0436 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u201cStage\u201d. \u0415\u0441\u043b\u0438 \u0432 \u0440\u0435\u0441\u0443\u0440\u0441\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u0435 OpenApiVersion, \u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442. \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u0440\u0447\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u044d\u0442\u043e\u0442 \u0444\u043b\u0430\u0436\u043e\u043a \u043b\u0435\u0447\u0438\u0442\u044c \u043d\u0435 \u0443\u043c\u0435\u0435\u0442.<\/p>\n<h2>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 API  <\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 ApiGateway \u0440\u0435\u0441\u0443\u0440\u0441 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a \u043b\u044f\u043c\u0431\u0434\u0435 \u0432 sam \u043a\u043e\u043d\u0444\u0438\u0433\u0435. \u0417\u0430\u043e\u0434\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u044e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 REST \u0443\u0440\u043b\u044b:  <\/p>\n<pre><code class=\"yaml\"># .\/template.yaml <\/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-332109","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332109","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=332109"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332109\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=332109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=332109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=332109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}