{"id":1144,"date":"2019-05-29T18:31:25","date_gmt":"2019-05-29T15:31:25","guid":{"rendered":"https:\/\/artem.services\/?p=1144"},"modified":"2019-12-01T00:49:44","modified_gmt":"2019-11-30T21:49:44","slug":"aws-codedeploy-%d0%bd%d0%b0-ec2-instance","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=1144","title":{"rendered":"AWS &#8212; CodeDeploy \u043d\u0430 EC2 Instance"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"size-full wp-image-214 aligncenter\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2018\/11\/AWS-Logo.png\" alt=\"\" width=\"975\" height=\"450\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2018\/11\/AWS-Logo.png 975w, https:\/\/artem.services\/wp-content\/uploads\/2018\/11\/AWS-Logo-300x138.png 300w, https:\/\/artem.services\/wp-content\/uploads\/2018\/11\/AWS-Logo-768x354.png 768w, https:\/\/artem.services\/wp-content\/uploads\/2018\/11\/AWS-Logo-954x440.png 954w\" sizes=\"(max-width: 975px) 100vw, 975px\" \/><\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <strong>AWS Pipeline<\/strong>, \u0433\u0434\u0435 <strong>CloudWatch<\/strong> \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0432 <strong>CodeCommit<\/strong>, \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 <strong>CodeBuild<\/strong> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0435\u0433\u043e \u0432 <strong>S3 Bucket<\/strong>. <strong>CodeDeploy<\/strong> \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a <strong>EC2 Instance<\/strong> \u0438 <strong>codedeploy-agent<\/strong> \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0441 <strong>S3<\/strong> \u0430\u0440\u0445\u0438\u0432 \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435.<\/p>\n<p>&nbsp;<\/p>\n<blockquote><p><strong>S3 Bucket<\/strong> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u0430 \u043e\u0442 <strong>CodeBuild<\/strong> \u0434\u043e<strong> codedeploy-agent<\/strong>&#39;\u0430 \u043d\u0430 <strong>EC2<\/strong> \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0430\u0433\u0435\u043d\u0442 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 <strong>CodeCommit<\/strong>.<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>CloudWatch &#8212; Logs &#8212; Action &#8212; Create log group<\/p>\n<p>CodeBuild<\/p>\n<p>CodeDeploy<\/p>\n<p>CodeDeploy -&gt; Applications -&gt; Create application<br \/>\nDeployment Groups -&gt; Create deployment group<\/p>\n<p>Environment configuration &#8212; \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c EC2 Instance<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0438\u043c\u0435\u043d\u0438 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0442\u0435\u0433\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0430\u043d\u0441. \u0414\u043b\u044f \u0435\u0433\u043e, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438 \u0442\u0435\u0433, \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0435\u0433\u043e \u043a EC2 Instance. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0442\u0435\u0433 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c &quot;ENV&quot; \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c &quot;Staging&quot;<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439.<\/p>\n<p>Load balancer &#8212; \u0441\u043d\u0438\u043c\u0430\u0435\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0434\u0438\u043d EC2 Instance<\/p>\n<p>Deployment group deployment -&gt; Create deployment<\/p>\n<p>https:\/\/docs.aws.amazon.com\/en_us\/codedeploy\/latest\/userguide\/codedeploy-agent-operations-install-ubuntu.html<\/p>\n<p>https:\/\/docs.aws.amazon.com\/en_us\/codedeploy\/latest\/userguide\/codedeploy-agent-operations-install-linux.html<\/p>\n<p>sudo service codedeploy-agent start<\/p>\n<p>service codedeploy-agent status<\/p>\n<p>wget https:\/\/aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com\/latest\/install<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u043e\u043b\u044c \u0434\u043b\u044f EC2 !!!!!!!!!!!!!!!!<\/p>\n<p>CodeDeploy-EC2<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043f\u043e\u043b\u0438\u0441\u0438:<\/p>\n<p>CodeDeploy-EC2-Permissions<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n{\r\n    &quot;Version&quot;: &quot;2012-10-17&quot;,\r\n    &quot;Statement&quot;: [\r\n        {\r\n            &quot;Action&quot;: [\r\n                &quot;s3:Get*&quot;,\r\n                &quot;s3:List*&quot;\r\n            ],\r\n            &quot;Effect&quot;: &quot;Allow&quot;,\r\n            &quot;Resource&quot;: &quot;*&quot;\r\n        }\r\n    ]\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f AWS Pipeline, \u0433\u0434\u0435 CloudWatch \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0432 CodeCommit, \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 CodeBuild \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0435\u0433\u043e \u0432 S3 Bucket. CodeDeploy \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a EC2 Instance \u0438 codedeploy-agent \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0441 S3 \u0430\u0440\u0445\u0438\u0432 \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435. &nbsp; S3 Bucket \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u0430 \u043e\u0442 CodeBuild &hellip; <a href=\"https:\/\/artem.services\/?p=1144\" class=\"more-link\">\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0447\u0438\u0442\u0430\u0442\u044c<span class=\"screen-reader-text\"> &quot;AWS &#8212; CodeDeploy \u043d\u0430 EC2 Instance&quot;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1144"}],"collection":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1144"}],"version-history":[{"count":4,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1144\/revisions"}],"predecessor-version":[{"id":1497,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1144\/revisions\/1497"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}