{"id":331085,"date":"2022-03-26T09:00:12","date_gmt":"2022-03-26T09:00:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=331085"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=331085","title":{"rendered":"<span>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 CI\/CD \u0441 AWS \u0438 Github Actions<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0432\u0435\u0434\u0430\u0442\u044c \u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 CI\/CD \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u043d\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0421\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 T2 \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u044b\u0445 \u0441\u043d\u0438\u043c\u043a\u043e\u0432 \u041c\u0420\u0422 \u043f\u043e\u044f\u0441\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u0430 \u043f\u043e\u0437\u0432\u043e\u043d\u043e\u0447\u043d\u0438\u043a\u0430 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0431-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, Flask, Django \u0438 Spring Boot. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 <a href=\"https:\/\/aws.amazon.com\/ru\/\" rel=\"noopener noreferrer nofollow\">AWS<\/a>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u0438\u0431\u043e Amazon \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0433\u0435\u0433\u0435\u043c\u043e\u043d\u043e\u043c \u0441\u0440\u0435\u0434\u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u043b\u0430\u043a\u043e\u0432 \u0438\u0437-\u0437\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u0442\u0438\u043b\u044c\u043d\u043e, \u043c\u043e\u0434\u043d\u043e \u0438 \u043c\u043e\u043b\u043e\u0434\u0435\u0436\u043d\u043e. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043c\u043e\u043d\u043e\u0442\u043e\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043d\u0430 \u0438\u0445 \u0436\u0438\u0437\u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c, \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c CI\/CD \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b.<\/p>\n<h2>\u041f\u0440\u043e Github Actions<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u043e\u0432 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 <a href=\"https:\/\/github.com\/features\/actions\" rel=\"noopener noreferrer nofollow\">Github Actions<\/a>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b \u0432 Github, \u0430 \u0435\u0449\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0432\u043e\u0439 Jenkins \u0441\u0435\u0440\u0432\u0435\u0440. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0442\u043e, \u0447\u0442\u043e \u0443\u043c\u0435\u043b\u044c\u0446\u044b \u043f\u0438\u0448\u0443\u0442 \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 Actions, \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e SSH, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 AWS CLI, \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u041e\u0421) \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u0441 \u043b\u0438\u0445\u0432\u043e\u0439. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Flask \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/p>\n<p>CI \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0441\u0432\u043e\u0435\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043f\u0440\u043e\u0433\u043e\u043d \u0442\u0435\u0441\u0442\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 AWS \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f S3 bucket. <\/p>\n<p>\u0421 CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u043e\u043c \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0438\u0431\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 AWS \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f (Route 53), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 IP-\u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (EC2) \u0441 \u0441\u0430\u043c\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439. \u0422\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u0430 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f (RDS). \u0414\u043b\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0436\u0438\u0437\u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c 3 AWS \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u0412 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c Flask \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 AWS \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u041d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0432\u043e\u043b\u044c\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 AWS \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u043b\u044f \u0440\u0430\u043d\u0435\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/430\/e88\/ccd\/430e88ccd3de4a37c0c21a4dc91713db.png\" alt=\"\u0418\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u0430\u044f AWS \u0441\u0445\u0435\u043c\u0430 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \" title=\"\u0418\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u0430\u044f AWS \u0441\u0445\u0435\u043c\u0430 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \" width=\"914\" height=\"908\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/430\/e88\/ccd\/430e88ccd3de4a37c0c21a4dc91713db.png\"\/><figcaption>\u0418\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u0430\u044f AWS \u0441\u0445\u0435\u043c\u0430 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f <\/figcaption><\/figure>\n<p>\u042f \u043d\u0435 \u0441\u0442\u0430\u043d\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0431\u043b\u043e\u043a \u0434\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e <s>\u043c\u043d\u0435 \u043b\u0435\u043d\u044c<\/s> \u044d\u0442\u043e \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c\u043e\u0439 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041d\u043e \u0434\u043b\u044f \u0441\u0433\u0443\u0449\u0435\u043d\u0438\u044f \u0442\u0443\u0447 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u0443\u0434\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0438 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u0430\u043d\u0443\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0438\u0437\u0431\u0430\u0432\u0438\u0432 \u0441\u0435\u0431\u044f \u043e\u0442 \u043c\u043e\u043d\u043e\u0442\u043e\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u0423 AWS \u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c<a href=\"https:\/\/aws.amazon.com\/ru\/cloudformation\/\" rel=\"noopener noreferrer nofollow\"> CloudFormation<\/a>, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0443\u0441\u043b\u0443\u0433\u0438 \u0432\u0438\u0434\u0430 \u00abInfrastructure as a Code\u00bb (IaaC), \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 AWS. \u0415\u0433\u043e \u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u043e\u0432.<\/p>\n<h2>Continuous Integration jobs<\/h2>\n<p>\u0412\u0441\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/537014\/\" rel=\"noopener noreferrer nofollow\">\u0434\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u044e\u0442<\/a>, \u0447\u0442\u043e Github Actions \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b \u0441\u043a\u043b\u0430\u0434\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f: <code>.github\/workflows\/*.yml<\/code><\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u0440\u043e\u0433\u043e\u043d \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 \u043f\u0443\u043b\u043b \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0430\u0445, \u0447\u0442\u043e\u0431\u044b \u0432 main \u0432\u0435\u0442\u043a\u0443 \u043d\u0435 \u043f\u043e\u043f\u0430\u043b \u043d\u0435\u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u043e\u0434. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u0434 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0434\u043b\u044f \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439.<\/p>\n<pre><code class=\"yaml\">name: Pipeline name  # \u0418\u043c\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 env:  # \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b   VARIABLE: \"var\"  on:  # \u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430   workflow_dispatch:  # \u0420\u0443\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0447\u0435\u0440\u0435\u0437 UI \u0413\u0438\u0442\u0445\u0430\u0431\u0430   pull_request:  # \u0414\u043b\u044f \u043f\u0443\u043b \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u0432  jobs: # \u0421\u043f\u0438\u0441\u043e\u043a \u0434\u0436\u043e\u0431   validation: # \u0418\u043c\u044f \u0434\u0436\u043e\u0431\u044b     runs-on: ubuntu-latest     steps:   # \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 job       - name: Clone repo  # \u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 (\u043c\u043e\u0436\u043d\u043e \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 (\u0434\u0430\u0436\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435), \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u0435\u043d \u0434\u0440\u0443\u0433\u043e\u0439 action)         uses: actions\/checkout@v2        - name: Set up Python 3.7  # \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0438\u0442\u043e\u043d\u0447\u0438\u043a \u043d\u0443\u0436\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438         uses: actions\/setup-python@v1         with:           python-version: 3.7        - name: Configure AWS Credentials  # \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 AWS         uses: aws-actions\/configure-aws-credentials@v1         with:           aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}  # \u041d\u0438\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430, \u0433\u0434\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 secrets           aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}           aws-region: ${{ env.AWS_REGION_NAME }}        - name: Get response of RDS DB structure  # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0411\u0414 \u0447\u0435\u0440\u0435\u0437 AWS CLI         run: aws rds describe-db-instances --db-instance-identifier ${{ secrets.MYSQL_SCHEMA_NAME }} >> rds_response.json        - name: Get database URL         id: url         uses: sergeysova\/jq-action@v2         with:           cmd: \"jq -r '.DBInstances[].Endpoint.Address' rds_response.json\"  # \u0424\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c JSON        - name: Install dependencies  # \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0430\u0435\u043c Python \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438         run: |           python -m pip install --upgrade pip           pip install -r requirements.txt                - name: Lint with pycodestyle  # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u043d\u0430\u0448 \u043a\u043e\u0434 PEP8         run: |           source venv\/bin\/activate           pycodestyle --exclude=venv --max-line-length=150 .        - name: Run unit tests  # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u043a\u0438         run: |           sudo apt upgrade           pytest         env:  # \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435 \u043a\u0440\u0430\u0448\u043d\u0443\u043b\u0441\u044f           # Configure AWS settings environments for tests           AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}           AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}           # Configure production MySQL settings           MYSQL_USER: ${{ secrets.MYSQL_USER }}           MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}           MYSQL_URL: ${{ steps.url.outputs.value }}           MYSQL_DB: ${{ secrets.MYSQL_DB }}           # Configure SQLAlchemy           SQL_ALCHEMY_SECRET_KEY: ${{ secrets.SQL_ALCHEMY_SECRET_KEY }} <\/code><\/pre>\n<p>\u041d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 secrets \u0434\u043b\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/620\/9b6\/119\/6209b6119dc8ec0e25ea55c00596731f.png\" alt=\"Github secrets \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\" title=\"Github secrets \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\" width=\"936\" height=\"566\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/620\/9b6\/119\/6209b6119dc8ec0e25ea55c00596731f.png\"\/><figcaption>Github secrets \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/figcaption><\/figure>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u0436\u043e\u0431\u044b (\u044d\u0442\u043e \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 .yml \u0444\u0430\u0439\u043b\u0438\u043a) \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430 \u043c\u0435\u043d\u044f.<\/p>\n<pre><code class=\"yaml\">name: Pipeline name  # \u0412\u0441\u0435 \u0435\u0449\u0435 \u0438\u043c\u044f \u043f\u0430\u0439\u043b\u0430\u0439\u043d\u0430 env:  # \u0412\u0441\u0435 \u0435\u0449\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435: ${{ env.VAR_NAME }}   ENV_VARIABLE: \"value\"  on:   workflow_dispatch:   push:     branches: [ main ]  # \u041f\u0440\u0438 merge \u0432 main \u0432\u0435\u0442\u043a\u0443  jobs:     ci:     runs-on: ubuntu-latest  # \u042f \u043e\u0444\u0438\u0433\u0435\u043b, \u043a\u043e\u0433\u0434\u0430 \u0443\u0437\u043d\u0430\u043b \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0430 MacOS \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c      steps:       - name: Git clone our repo         uses: actions\/checkout@v1        - name: Install zip  # \u0423\u0441\u0442\u0430\u043d\u0430\u043b\u0438\u0432\u0430\u0435\u043c zip \u0430\u0440\u0445\u0438\u0432\u0430\u0442\u043e\u0440, \u0442.\u043a. \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Python         run: sudo apt-get install zip gzip tar        - name: Archive project  # \u0410\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 *         run: sudo zip -r project.zip *        - name: Configure my AWS Credentials         uses: aws-actions\/configure-aws-credentials@v1         with:           aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}           aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}           aws-region: ${{ env.AWS_REGION_NAME }}        - name: Copy app to S3 bucket  # \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0430\u0440\u0445\u0438\u0432 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0432 AWS S3 bucket          run: aws s3 cp \"project.zip\" s3:\/\/${{ env.BUCKET_NAME }}\/project.zip        - name: Print Happy Message for CI finish         run: echo \"CI Pipeline part Finished successfully\"<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0438\u043c\u0435\u0435\u043c CI \u0434\u0436\u043e\u0431\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u044e\u0442 \u0442\u0435\u0441\u0442\u0438\u043a\u0438 \u0434\u043b\u044f \u043f\u0443\u043b \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u0432, \u0430 \u043f\u0440\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u0435 \u0432 main \u0432\u0435\u0442\u043a\u0443, \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u044e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0435\u0433\u043e \u0432 AWS S3 bucket. \u0418\u0437 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0440\u0430\u0442\u044c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 AWS CLI \u0438 \u043d\u0430\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430 EC2 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b.<\/p>\n<h2>Continious delivery job &amp; CF template<\/h2>\n<p>\u0412\u0435\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c CD \u0434\u0436\u043e\u0431\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043d\u0435 \u0432 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0435 \u0434\u043b\u044f Github Actions, \u0430 \u0432 CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d\u0435. \u0422\u0430\u043a \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0434\u043b\u044f CloudFormation \u0443\u0436\u0430\u0441\u043d\u0430. \u0422\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u044e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u044f, \u043d\u043e \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 <a href=\"https:\/\/www.youtube.com\/c\/ADVIT4000\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b<\/a>. \u0414\u0430\u0436\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0439\u0441\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 <a href=\"https:\/\/docs.aws.amazon.com\/AWSCloudFormation\/latest\/UserGuide\/working-with-templates-cfn-designer.html\" rel=\"noopener noreferrer nofollow\">\u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432<\/a> \u0434\u043b\u044f CloudFormation \u043d\u0435 \u0441\u043f\u0430\u0441\u0430\u0435\u0442 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043a\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0441\u043d\u0438\u043f\u043f\u0435\u0442\u044b \u0443\u043c\u0435\u043b\u044c\u0446\u0435\u0432 \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0438 \u043e\u0442\u0441\u0435\u043a\u0430\u0442\u044c \u043e\u0442 \u0441\u043d\u0438\u043f\u043f\u0435\u0442\u043e\u0432 \u0432\u0441\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u043e\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043b\u0435\u043d\u0434\u0438\u043d\u0433-\u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d \u0441 CDN (AWS CloudFront). \u041d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c Flask \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 Django-style \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (Flask-Script), \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 AWS ELB \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u043f\u0430\u0434\u0430\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441\u0430\u043c \u0447\u0435\u0440\u0442 \u043d\u043e\u0433\u0443 \u0441\u043b\u043e\u043c\u0438\u0442. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 EC2.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0443 \u0441 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 CD \u0434\u0436\u043e\u0431\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435\u043c CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0432 AWS \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435. \u042d\u0442\u0430 \u0434\u0436\u043e\u0431\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430.<\/p>\n<pre><code class=\"yaml\">... cd_part:  # \u0418\u043c\u044f \u0434\u0436\u043e\u0431\u044b   runs-on: ubuntu-latest   needs: [ci_part]  # \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0434\u0436\u043e\u0431\u044b    steps:     - name: Git clone our repo  # \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0430\u0448 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u0442.\u043a. \u0432 \u043d\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d       uses: actions\/checkout@v1      - name: Configure my AWS Credentials  # \u0412\u0441\u0435 \u0435\u0449\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c AWS \u043a\u0440\u0435\u0434\u044b, \u0442.\u043a. \u043e\u043d\u0438 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0434\u0436\u043e\u0431\u044b       uses: aws-actions\/configure-aws-credentials@v1       with:         aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}         aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}         aws-region: ${{ env.AWS_REGION_NAME }}      - name: Deploy main stack  # AWS CLI \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0443 \u043d\u0430\u0441 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438       run: |         aws cloudformation deploy \\         --stack-name main-stack \\  # \u0418\u043c\u044f \u0441\u0442\u0435\u043a\u0430 (\u0443 AWS \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u043f\u0435\u0446. \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0434\u043b\u044f \u0438\u043c\u0435\u043d CloudFormation \u0441\u0442\u044d\u043a\u043e\u0432)         --template-file cloudformation\/main_stack.json \\  # \u041f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u0441 CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c         --capabilities CAPABILITY_NAMED_IAM \\  # \u041c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043d\u0435 \u043b\u0435\u043d\u044c \u043f\u0438\u0441\u0430\u0442\u044c         --parameter-overrides YourParameterName=${{ secrets.PARAMETER }} \\  # \u041d\u0430\u0448\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0442\u044c \u0432 CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d         --no-fail-on-empty-changeset  # \u041e\u043a\u043e\u043b\u043e\u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0441\u0442\u0430\u0440\u0442\u0435 \u0434\u0436\u043e\u0431\u044b CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d \u043d\u0435 \u043f\u0430\u0434\u0430\u043b \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435      - name: Print Happy Message for CD finish       run: echo \"CD Pipeline part Finished successfully\"<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u0438. \u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c AWS CLI \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 CloudFormation. \u041c\u043e\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e AWS CLI \u043b\u0438\u0431\u043e \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430, \u043b\u0438\u0431\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043a\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 &#8212; \u00a0CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d:<\/p>\n<pre><code class=\"json\">{   \"Description\": \"AWS CloudFormation stack\",   \"Parameters\": {     \"ParameterName\": {       \"Type\": \"String\"\/\/ \u0432 99% \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c String     }   },   \"Resources\": { \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0430\u0448\u0438 AWS \u0440\u0435\u0441\u0443\u0440\u0441\u044b     \"S3Bucket\": { \/\/ \u0424\u0430\u0439\u043b\u043e\u0432\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435       \"Type\": \"AWS::S3::Bucket\",       \"Properties\": {         \"BucketName\": \"S3BucketName\",         \"PublicAccessBlockConfiguration\": { \/\/ \u042d\u0442\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438\/\u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u0438 S3 bucket (\u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u0438\u0437 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u043f\u043e URL)           \"BlockPublicAcls\": false,           \"BlockPublicPolicy\": false,           \"IgnorePublicAcls\": false,           \"RestrictPublicBuckets\": false         }       }     },     \"LogGroup\": { \/\/ \u042d\u0442\u043e \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043b\u043e\u0433\u043e\u0432, \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043d\u0438\u0445 \u043d\u0430\u0441\u0442\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f       \"Type\": \"AWS::Logs::LogGroup\",       \"Properties\": {         \"LogGroupName\": \"LogGroupName\"       }     },     \"SecurityIAMRole\": {  \/\/ \u042d\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f EC2       \"Type\": \"AWS::IAM::Role\",       \"Properties\": {         \"AssumeRolePolicyDocument\": {           \"Version\": \"2012-10-17\",           \"Statement\": [             {               \"Effect\": \"Allow\",               \"Principal\": {                 \"Service\": [                   \"ec2.amazonaws.com\"                 ]               },               \"Action\": [                 \"sts:AssumeRole\"               ]             }           ]         },         \"Policies\": [           {             \"PolicyName\": \"S3Policy\",             \"PolicyDocument\": {               \"Version\": \"2012-10-17\",               \"Statement\": [                 {                   \"Effect\": \"Allow\",                   \"Action\": \"s3:*\",                   \"Resource\": \"arn:aws:s3:::YOUR_S3_BUCKET_FOLDER\/*\"                 }               ]             }           }         ],         \"RoleName\": \"IAMRoleName\"       }     },     \"InstanceProfile\": {  \/\/ \u0422\u0430\u043a\u0430\u044f \u0436\u0435 \u043e\u043a\u043e\u043b\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430 \u0434\u043b\u044f EC2       \"Type\": \"AWS::IAM::InstanceProfile\",       \"Properties\": {         \"Roles\": [           {             \"Ref\": \"SecurityIAMRole\"           }         ]       }     },     \"SecurityGroup\": {       \"Type\": \"AWS::EC2::SecurityGroup\",       \"Properties\": {         \"GroupName\": \"SecurityGroupName\",         \"GroupDescription\": \"SecurityGroupDescription\",         \"SecurityGroupIngress\": [           { \/\/ \u041f\u043e\u0440\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u0440\u0443\u0436\u0443 \u0434\u043b\u044f EC2 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430             \"IpProtocol\": \"tcp\",             \"CidrIp\": \"0.0.0.0\/0\",             \"FromPort\": 22,             \"ToPort\": 22           },           {             \"IpProtocol\": \"tcp\",             \"CidrIpv6\": \"::\/0\",             \"FromPort\": 22,             \"ToPort\": 22           },           {             \"IpProtocol\": \"tcp\",             \"CidrIp\": \"0.0.0.0\/0\",             \"FromPort\": 80,             \"ToPort\": 80           },           {             \"IpProtocol\": \"tcp\",             \"CidrIpv6\": \"::\/0\",             \"FromPort\": 80,             \"ToPort\": 80           },           {             \"IpProtocol\": \"tcp\",             \"CidrIp\": \"0.0.0.0\/0\",             \"FromPort\": 443,             \"ToPort\": 443           },           {             \"IpProtocol\": \"tcp\",             \"CidrIpv6\": \"::\/0\",             \"FromPort\": 443,             \"ToPort\": 443           }         ]       }     },     \"CertificateManagerCertificate\": { \/\/ HTTPS \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442       \"Type\": \"AWS::CertificateManager::Certificate\",       \"Properties\": {         \"DomainName\": {           \"Ref\": \"ParameterUrlName\" \/\/ \u0412\u0430\u0448 url \u0430\u0434\u0440\u0435\u0441         },         \"ValidationMethod\": \"DNS\",         \"SubjectAlternativeNames\": [           {             \"Ref\": \"ParameterUrlName\"           },           {             \"Fn::Sub\": [               \"www.${Domain}\", \/\/ \u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 www.               {                 \"Domain\": {                   \"Ref\": \"ParameterUrlName\"                 }               }             ]           }         ],         \"DomainValidationOptions\": [           {             \"DomainName\": {               \"Ref\": \"ParameterUrlName\"             },             \"HostedZoneId\": {               \"Ref\": \"HostZoneId\" \/\/ \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0430 HostedZone id \u0432 Route53             }           },           {             \"DomainName\": {               \"Fn::Sub\": [                 \"www.${Domain}\",                 {                   \"Domain\": {                     \"Ref\": \"ParameterUrlName\"                   }                 }               ]             },             \"HostedZoneId\": {               \"Ref\": \"HostZoneId\"             }           }         ]       }     },     \"Ec2Instance\": { \/\/ \u0421\u0430\u043c \u0441\u0435\u0440\u0432\u0430\u043a \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u044c\u043a\u043e\u0439       \"Type\": \"AWS::EC2::Instance\",       \"Properties\": {         \"IamInstanceProfile\": {           \"Ref\": \"InstanceProfile\"         },         \"AvailabilityZone\": \"us-east-1c\", \/\/ \u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0435         \"ImageId\": \"ami-047a51fa27710816e\", \/\/ Amazon Linux \u041e\u0421         \"InstanceType\": \"t2.micro\", \/\/          \"KeyName\": \"key-pair\", \/\/ ssh \u043a\u043b\u044e\u0447\u0438\u043a         \"SecurityGroups\": [            {             \"Ref\": \"SecurityGroup\"           }         ],         \"Tags\": [           {             \"Key\": \"Name\",             \"Value\": \"\u0418\u043c\u044f \u0432\u0430\u0448\u0435\u0433\u043e EC2 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430\"           }         ],         \"UserData\": { \/\/ \u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 ec2 \u043f\u043e\u0434 \u043d\u0430\u0448\u0438 \u043d\u0443\u0436\u0434\u044b           \"Fn::Base64\": {             \"Fn::Join\": [               \"\",               [                  \"Content-Type: multipart\/mixed; boundary=\\\"\/\/\\\"\\n\", \/\/ \u0424\u0438\u0433\u043d\u044f \u0431\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442                 \"MIME-Version: 1.0\\n\\n\",                 \"--\/\/\\n\",                 \"Content-Type: text\/cloud-config; charset=\\\"us-ascii\\\"\\n\",                 \"MIME-Version: 1.0\\n\",                 \"Content-Transfer-Encoding: 7bit\\n\",                 \"Content-Disposition: attachment; filename=\\\"cloud-config.txt\\\"\\n\\n\",                 \"#cloud-config\\n\",                 \"cloud_final_modules:\\n\",                 \"- [scripts-user, always]\\n\\n\",                 \"--\/\/\\n\",                 \"Content-Type: text\/x-shellscript; charset=\\\"us-ascii\\\"\\nMIME-Version: 1.0\\n\",                 \"Content-Transfer-Encoding: 7bit\\n\",                 \"Content-Disposition: attachment; filename=\\\"userdata.txt\\\"\\n\\n\",                  \"#!\/bin\/bash\\n\",                 \"sudo yum -y install gcc openssl-devel bzip2-devel libffi-devel libssl-dev\\n\", \/\/ \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c python 3.7.2 \u0438 pip3                 \"sudo yum -y install python37 python3-devel\\n\",                 \"sudo yum -y install mysql-devel\\n\",                 \"sudo yum -y install vim\\n\",                 \"sudo yum -y install libXext libSM libXrender\\n\",                 \"sudo curl -O https:\/\/bootstrap.pypa.io\/get-pip.py\\n\",                 \"sudo python3 get-pip.py\\n\",                 \"pip3 install awsebcli --upgrade --user\\n\",                 \"pip3 install jmespath==0.7.1 python-dateutil\\n\",                 \"pip3 install awsebcli --upgrade --user\\n\",                 \"sudo echo 'export ENV_VARIABLE=\", \/\/ \u0421\u0435\u0442\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u044b                 {                   \"Ref\": \"ParameterName\"                 },                 \"'>>\/home\/ec2-user\/.bash_profile\\n\",                 \/\/ \u0423\u0434\u0430\u043b\u0438\u043b \u043e\u0442\u0441\u044e\u0434\u0430 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434, \u0442.\u043a. \u043e\u043d\u0438 \u043e\u0441\u043e\u0431\u043e\u0439 \u0440\u043e\u043b\u0438 \u043d\u0435 \u0438\u0433\u0440\u0430\u044e\u0442                 \"aws s3 cp s3:\/\/bucket\/file.zip \/home\/ec2-user\/file.zip\\n\", \/\/ \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430                 \"nohup gunicorn -w 1 --reload -b 127.0.0.1:5000 --chdir \/home\/ec2-user 'app:create_app()' > log.txt 2>&amp;1 &amp;\\n\", \/\/ \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c gunicorn                 \"sudo yum install -y https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm\\n\", \/\/ \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Let's encrypt                 \"sudo yum install -y epel-release\\n\",                 \"sudo yum install nginx -y\\n\",                 \"sudo amazon-linux-extras install -y epel\\n\",                 \"sudo yum-config-manager --enable epel*\\n\",                 \"sudo yum install -y certbot\\n\",                 \"sudo yum install -y python-certbot-nginx\\n\",                 \"pip3 install certbot-nginx\\n\",                 \"sudo sed -i '2 a server_name \", \/\/ \u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c url \u0430\u0434\u0440\u0435\u0441 \u0434\u043b\u044f Let's Encrypt \u0432 nginx \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043d\u0430 2 \u0441\u0442\u0440\u043e\u0447\u043a\u0443                 {                   \"Ref\": \"ParameterUrlName\"                 },                 \" www.\",                 {                   \"Ref\": \"ParameterUrlName\"                 },                 \";' \/home\/ec2-user\/deploy\/app.conf\\n\",                 \"sudo cp \/home\/ec2-user\/deploy\/app.conf \/etc\/nginx\/conf.d\/app.conf\\n\",                 \"sudo certbot --nginx --non-interactive --agree-tos -d \",                 {                   \"Ref\": \"ParameterUrlName\"                 },                 \" -d www.\",                 {                   \"Ref\": \"ParameterUrlName\"                 },                 \" -m \",                 {                   \"Ref\": \"YourEmailParameter\"                 },                 \"\\n\",                 \"sudo certbot renew --dry-run\\n\",                  \"sudo systemctl stop nginx\\n\",                 \"sudo pkill -f nginx &amp; wait $!\\n\", \/\/ \u041a\u043e\u0441\u0442\u044b\u043b\u044c \u0431\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e                 \"sudo systemctl start nginx\\n\",                 \"sudo systemctl enable nginx\\n\"               ]             ]           }         }       },       \"DependsOn\": [ \/\/ EC2 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u043b\u043e\u0433\u0438 \u0438 s3 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435         \"LogGroup\",         \"S3Bucket\"       ]     },     \"ElasticIP\": { \/\/ \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 ip \u0430\u0434\u0440\u0435\u0441 (\u043c\u043e\u0436\u043d\u043e \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e)       \"Type\": \"AWS::EC2::EIP\",       \"Properties\": {         \"Domain\": \"vpc\",         \"InstanceId\": {           \"Ref\": \"Ec2Instance\"         },         \"Tags\": [           {             \"Key\": \"Name\",             \"Value\": \"YourElasticIPName\"           }         ]       }     },     \"DNSRecord\": { \/\/ \u0417\u0430\u043f\u0438\u0441\u044c DNS        \"Type\": \"AWS::Route53::RecordSetGroup\",       \"Properties\": {         \"HostedZoneId\": {           \"Ref\": \"HostZoneId\"         },         \"RecordSets\": [           {             \"Name\": {               \"Ref\": \"ParameterUrlName\"             },             \"Type\": \"A\",             \"TTL\": 900,             \"ResourceRecords\": [               {                 \"Ref\": \"ElasticIP\"               }             ]           },           {             \"Name\": {               \"Fn::Sub\": [                 \"www.${Domain}\",                 {                   \"Domain\": {                     \"Ref\": \"ParameterUrlName\"                   }                 }               ]             },             \"Type\": \"A\",             \"TTL\": 900,             \"ResourceRecords\": [               {                 \"Ref\": \"ElasticIP\"               }             ]           }         ]       }     }   } }}<\/code><\/pre>\n<p>\u041d\u0430\u0448 ClodFormation \u0448\u0430\u0431\u043b\u043e\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u0438\u043a\u043e\u043c \u0432 AWS \u0438 \u0442\u0430\u043c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0442\u0441\u044f. \u041e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0432 \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, CloudFormation \u0441\u0442\u044d\u043a \u0441\u043e\u0437\u0434\u0430\u0441\u0442\u0441\u044f \u0438 \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0431\u0443\u0434\u0435\u043c \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u043c\u0438, \u043b\u043e\u0433\u0430\u043c\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.   <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/42c\/b09\/b3a\/42cb09b3ae5d9b9aefda1b75661f1abd.png\" alt=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u043e\u0433\u043e CloudFormation stack \u0441 MySQL RDS \u0411\u0414\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u043e\u0433\u043e CloudFormation stack \u0441 MySQL RDS \u0411\u0414\" width=\"3042\" height=\"1276\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/42c\/b09\/b3a\/42cb09b3ae5d9b9aefda1b75661f1abd.png\"\/><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u043e\u0433\u043e CloudFormation stack \u0441 MySQL RDS \u0411\u0414<\/figcaption><\/figure>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u044b\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Github Actions \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 AWS. \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f AWS \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0430 CloudFormation. \u00a0\u0423 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0435\u0441\u0442\u044c \u043c\u0438\u043d\u0443\u0441 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 JSON (YAML) \u0432 CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0438 \u043f\u043b\u044e\u0441 \u0432 \u0432\u0438\u0434\u0435 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. <\/p>\n<p>\u041a\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0435\u0449\u0435, \u0442\u043e \u044f \u0441\u043e\u0437\u0434\u0430\u043b <a href=\"https:\/\/gist.github.com\/selutin99\/db62633923de8db724829700fed3af7a\" rel=\"noopener noreferrer nofollow\">Github Gist<\/a>, \u0433\u0434\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (AWS RDS MySQL) \u0438 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0443\u044e nginx \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 CloudFormation template. <\/p>\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\/post\/657549\/\"> https:\/\/habr.com\/ru\/post\/657549\/<\/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_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0432\u0435\u0434\u0430\u0442\u044c \u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 CI\/CD \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u043d\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0421\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 T2 \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u044b\u0445 \u0441\u043d\u0438\u043c\u043a\u043e\u0432 \u041c\u0420\u0422 \u043f\u043e\u044f\u0441\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u0430 \u043f\u043e\u0437\u0432\u043e\u043d\u043e\u0447\u043d\u0438\u043a\u0430 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0431-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, Flask, Django \u0438 Spring Boot. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 <a href=\"https:\/\/aws.amazon.com\/ru\/\" rel=\"noopener noreferrer nofollow\">AWS<\/a>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u0438\u0431\u043e Amazon \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0433\u0435\u0433\u0435\u043c\u043e\u043d\u043e\u043c \u0441\u0440\u0435\u0434\u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u043b\u0430\u043a\u043e\u0432 \u0438\u0437-\u0437\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u0442\u0438\u043b\u044c\u043d\u043e, \u043c\u043e\u0434\u043d\u043e \u0438 \u043c\u043e\u043b\u043e\u0434\u0435\u0436\u043d\u043e. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043c\u043e\u043d\u043e\u0442\u043e\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043d\u0430 \u0438\u0445 \u0436\u0438\u0437\u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c, \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c CI\/CD \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b.<\/p>\n<h2>\u041f\u0440\u043e Github Actions<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u043e\u0432 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 <a href=\"https:\/\/github.com\/features\/actions\" rel=\"noopener noreferrer nofollow\">Github Actions<\/a>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b \u0432 Github, \u0430 \u0435\u0449\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0432\u043e\u0439 Jenkins \u0441\u0435\u0440\u0432\u0435\u0440. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0442\u043e, \u0447\u0442\u043e \u0443\u043c\u0435\u043b\u044c\u0446\u044b \u043f\u0438\u0448\u0443\u0442 \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 Actions, \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e SSH, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 AWS CLI, \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u041e\u0421) \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u0441 \u043b\u0438\u0445\u0432\u043e\u0439. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Flask \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/p>\n<p>CI \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0441\u0432\u043e\u0435\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043f\u0440\u043e\u0433\u043e\u043d \u0442\u0435\u0441\u0442\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 AWS \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f S3 bucket. <\/p>\n<p>\u0421 CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u043e\u043c \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0438\u0431\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 AWS \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f (Route 53), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 IP-\u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (EC2) \u0441 \u0441\u0430\u043c\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439. \u0422\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u0430 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f (RDS). \u0414\u043b\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0436\u0438\u0437\u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c 3 AWS \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u0412 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c Flask \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 AWS \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u041d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0432\u043e\u043b\u044c\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 AWS \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u043b\u044f \u0440\u0430\u043d\u0435\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<figure class=\"full-width\"><figcaption>\u0418\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u0430\u044f AWS \u0441\u0445\u0435\u043c\u0430 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f <\/figcaption><\/figure>\n<p>\u042f \u043d\u0435 \u0441\u0442\u0430\u043d\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0431\u043b\u043e\u043a \u0434\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e <s>\u043c\u043d\u0435 \u043b\u0435\u043d\u044c<\/s> \u044d\u0442\u043e \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c\u043e\u0439 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041d\u043e \u0434\u043b\u044f \u0441\u0433\u0443\u0449\u0435\u043d\u0438\u044f \u0442\u0443\u0447 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u0443\u0434\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0438 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u0430\u043d\u0443\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0438\u0437\u0431\u0430\u0432\u0438\u0432 \u0441\u0435\u0431\u044f \u043e\u0442 \u043c\u043e\u043d\u043e\u0442\u043e\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u0423 AWS \u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c<a href=\"https:\/\/aws.amazon.com\/ru\/cloudformation\/\" rel=\"noopener noreferrer nofollow\"> CloudFormation<\/a>, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0443\u0441\u043b\u0443\u0433\u0438 \u0432\u0438\u0434\u0430 \u00abInfrastructure as a Code\u00bb (IaaC), \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 AWS. \u0415\u0433\u043e \u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u043e\u0432.<\/p>\n<h2>Continuous Integration jobs<\/h2>\n<p>\u0412\u0441\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/537014\/\" rel=\"noopener noreferrer nofollow\">\u0434\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u044e\u0442<\/a>, \u0447\u0442\u043e Github Actions \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b \u0441\u043a\u043b\u0430\u0434\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f: <code>.github\/workflows\/*.yml<\/code><\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u0440\u043e\u0433\u043e\u043d \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 \u043f\u0443\u043b\u043b \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0430\u0445, \u0447\u0442\u043e\u0431\u044b \u0432 main \u0432\u0435\u0442\u043a\u0443 \u043d\u0435 \u043f\u043e\u043f\u0430\u043b \u043d\u0435\u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u043e\u0434. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u0434 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0434\u043b\u044f \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439.<\/p>\n<pre><code class=\"yaml\">name: Pipeline name  # \u0418\u043c\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 env:  # \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b   VARIABLE: \"var\"  on:  # \u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430   workflow_dispatch:  # \u0420\u0443\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0447\u0435\u0440\u0435\u0437 UI \u0413\u0438\u0442\u0445\u0430\u0431\u0430   pull_request:  # \u0414\u043b\u044f \u043f\u0443\u043b \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u0432  jobs: # \u0421\u043f\u0438\u0441\u043e\u043a \u0434\u0436\u043e\u0431   validation: # \u0418\u043c\u044f \u0434\u0436\u043e\u0431\u044b     runs-on: ubuntu-latest     steps:   # \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 job       - name: Clone repo  # \u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 (\u043c\u043e\u0436\u043d\u043e \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 (\u0434\u0430\u0436\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435), \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u0435\u043d \u0434\u0440\u0443\u0433\u043e\u0439 action)         uses: actions\/checkout@v2        - name: Set up Python 3.7  # \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0438\u0442\u043e\u043d\u0447\u0438\u043a \u043d\u0443\u0436\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438         uses: actions\/setup-python@v1         with:           python-version: 3.7        - name: Configure AWS Credentials  # \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 AWS         uses: aws-actions\/configure-aws-credentials@v1         with:           aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}  # \u041d\u0438\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430, \u0433\u0434\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 secrets           aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}           aws-region: ${{ env.AWS_REGION_NAME }}        - name: Get response of RDS DB structure  # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0411\u0414 \u0447\u0435\u0440\u0435\u0437 AWS CLI         run: aws rds describe-db-instances --db-instance-identifier ${{ secrets.MYSQL_SCHEMA_NAME }} >> rds_response.json        - name: Get database URL         id: url         uses: sergeysova\/jq-action@v2         with:           cmd: \"jq -r '.DBInstances[].Endpoint.Address' rds_response.json\"  # \u0424\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c JSON        - name: Install dependencies  # \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0430\u0435\u043c Python \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438         run: |           python -m pip install --upgrade pip           pip install -r requirements.txt                - name: Lint with pycodestyle  # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u043d\u0430\u0448 \u043a\u043e\u0434 PEP8         run: |           source venv\/bin\/activate           pycodestyle --exclude=venv --max-line-length=150 .        - name: Run unit tests  # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u043a\u0438         run: |           sudo apt upgrade           pytest         env:  # \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435 \u043a\u0440\u0430\u0448\u043d\u0443\u043b\u0441\u044f           # Configure AWS settings environments for tests           AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}           AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}           # Configure production MySQL settings           MYSQL_USER: ${{ secrets.MYSQL_USER }}           MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}           MYSQL_URL: ${{ steps.url.outputs.value }}           MYSQL_DB: ${{ secrets.MYSQL_DB }}           # Configure SQLAlchemy           SQL_ALCHEMY_SECRET_KEY: ${{ secrets.SQL_ALCHEMY_SECRET_KEY }} <\/code><\/pre>\n<p>\u041d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 secrets \u0434\u043b\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. <\/p>\n<figure class=\"full-width\"><figcaption>Github secrets \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/figcaption><\/figure>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u0436\u043e\u0431\u044b (\u044d\u0442\u043e \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 .yml \u0444\u0430\u0439\u043b\u0438\u043a) \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430 \u043c\u0435\u043d\u044f.<\/p>\n<pre><code class=\"yaml\">name: Pipeline name  # \u0412\u0441\u0435 \u0435\u0449\u0435 \u0438\u043c\u044f \u043f\u0430\u0439\u043b\u0430\u0439\u043d\u0430 env:  # \u0412\u0441\u0435 \u0435\u0449\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435: ${{ env.VAR_NAME }}   ENV_VARIABLE: \"value\"  on:   workflow_dispatch:   push:     branches: [ main ]  # \u041f\u0440\u0438 merge \u0432 main \u0432\u0435\u0442\u043a\u0443  jobs:     ci:     runs-on: ubuntu-latest  # \u042f \u043e\u0444\u0438\u0433\u0435\u043b, \u043a\u043e\u0433\u0434\u0430 \u0443\u0437\u043d\u0430\u043b \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0430 MacOS \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c      steps:       - name: Git clone our repo         uses: actions\/checkout@v1        - name: Install zip  # \u0423\u0441\u0442\u0430\u043d\u0430\u043b\u0438\u0432\u0430\u0435\u043c zip \u0430\u0440\u0445\u0438\u0432\u0430\u0442\u043e\u0440, \u0442.\u043a. \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Python         run: sudo apt-get install zip gzip tar        - name: Archive project  # \u0410\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 *         run: sudo zip -r project.zip *        - name: Configure my AWS Credentials         uses: aws-actions\/configure-aws-credentials@v1         with:           aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}           aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}           aws-region: ${{ env.AWS_REGION_NAME }}        - name: Copy app to S3 bucket  # \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0430\u0440\u0445\u0438\u0432 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0432 AWS S3 bucket          run: aws s3 cp \"project.zip\" s3:\/\/${{ env.BUCKET_NAME }}\/project.zip        - name: Print Happy Message for CI finish         run: echo \"CI Pipeline part Finished successfully\"<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0438\u043c\u0435\u0435\u043c CI \u0434\u0436\u043e\u0431\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u044e\u0442 \u0442\u0435\u0441\u0442\u0438\u043a\u0438 \u0434\u043b\u044f \u043f\u0443\u043b \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u0432, \u0430 \u043f\u0440\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u0435 \u0432 main \u0432\u0435\u0442\u043a\u0443, \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u044e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0435\u0433\u043e \u0432 AWS S3 bucket. \u0418\u0437 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0440\u0430\u0442\u044c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 AWS CLI \u0438 \u043d\u0430\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430 EC2 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b.<\/p>\n<h2>Continious delivery job &amp; CF template<\/h2>\n<p>\u0412\u0435\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c CD \u0434\u0436\u043e\u0431\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043d\u0435 \u0432 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0435 \u0434\u043b\u044f Github Actions, \u0430 \u0432 CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d\u0435. \u0422\u0430\u043a \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0434\u043b\u044f CloudFormation \u0443\u0436\u0430\u0441\u043d\u0430. \u0422\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u044e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u044f, \u043d\u043e \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 <a href=\"https:\/\/www.youtube.com\/c\/ADVIT4000\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b<\/a>. \u0414\u0430\u0436\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0439\u0441\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 <a href=\"https:\/\/docs.aws.amazon.com\/AWSCloudFormation\/latest\/UserGuide\/working-with-templates-cfn-designer.html\" rel=\"noopener noreferrer nofollow\">\u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432<\/a> \u0434\u043b\u044f CloudFormation \u043d\u0435 \u0441\u043f\u0430\u0441\u0430\u0435\u0442 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043a\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0441\u043d\u0438\u043f\u043f\u0435\u0442\u044b \u0443\u043c\u0435\u043b\u044c\u0446\u0435\u0432 \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0438 \u043e\u0442\u0441\u0435\u043a\u0430\u0442\u044c \u043e\u0442 \u0441\u043d\u0438\u043f\u043f\u0435\u0442\u043e\u0432 \u0432\u0441\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u043e\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043b\u0435\u043d\u0434\u0438\u043d\u0433-\u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d \u0441 CDN (AWS CloudFront). \u041d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c Flask \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 Django-style \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (Flask-Script), \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 AWS ELB \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u043f\u0430\u0434\u0430\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441\u0430\u043c \u0447\u0435\u0440\u0442 \u043d\u043e\u0433\u0443 \u0441\u043b\u043e\u043c\u0438\u0442. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 EC2.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0443 \u0441 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 CD \u0434\u0436\u043e\u0431\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435\u043c CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0432 AWS \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435. \u042d\u0442\u0430 \u0434\u0436\u043e\u0431\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430.<\/p>\n<pre><code class=\"yaml\">... cd_part:  # \u0418\u043c\u044f \u0434\u0436\u043e\u0431\u044b   runs-on: ubuntu-latest   needs: [ci_part]  # \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0434\u0436\u043e\u0431\u044b    steps:     - name: Git clone our repo  # \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0430\u0448 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u0442.\u043a. \u0432 \u043d\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d       uses: actions\/checkout@v1      - name: Configure my AWS Credentials  # \u0412\u0441\u0435 \u0435\u0449\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c AWS \u043a\u0440\u0435\u0434\u044b, \u0442.\u043a. \u043e\u043d\u0438 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0434\u0436\u043e\u0431\u044b       uses: aws-actions\/configure-aws-credentials@v1       with:         aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}         aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}         aws-region: ${{ env.AWS_REGION_NAME }}      - name: Deploy main stack  # AWS CLI \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0443 \u043d\u0430\u0441 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438       run: |         aws cloudformation deploy \\         --stack-name main-stack \\  # \u0418\u043c\u044f \u0441\u0442\u0435\u043a\u0430 (\u0443 AWS \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u043f\u0435\u0446. \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0434\u043b\u044f \u0438\u043c\u0435\u043d CloudFormation \u0441\u0442\u044d\u043a\u043e\u0432)         --template-file cloudformation\/main_stack.json \\  # \u041f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u0441 CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c         --capabilities CAPABILITY_NAMED_IAM \\  # \u041c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043d\u0435 \u043b\u0435\u043d\u044c \u043f\u0438\u0441\u0430\u0442\u044c         --parameter-overrides YourParameterName=${{ secrets.PARAMETER }} \\  # \u041d\u0430\u0448\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0442\u044c \u0432 CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d         --no-fail-on-empty-changeset  # \u041e\u043a\u043e\u043b\u043e\u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0441\u0442\u0430\u0440\u0442\u0435 \u0434\u0436\u043e\u0431\u044b CloudFormation \u0448\u0430\u0431\u043b\u043e\u043d \u043d\u0435 \u043f\u0430\u0434\u0430\u043b \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435      - name: Print Happy Message for CD finish       run: echo \"CD Pipeline part Finished successfully\"<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441<\/p>\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-331085","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331085","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=331085"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331085\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=331085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=331085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=331085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}