{"id":321337,"date":"2021-04-13T09:00:23","date_gmt":"2021-04-13T09:00:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=321337"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=321337","title":{"rendered":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Terraformer \u0434\u043b\u044f \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432 AWS \u0434\u043b\u044f \u0434\u0435\u043f\u043b\u043e\u0435\u0432 \u0441 Terraform"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a5d\/af9\/f92\/a5daf9f92fb6360cbb407c1cb00fe01c.png\" width=\"780\" height=\"450\"><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e \u043d\u0430\u0448 \u043e\u043f\u044b\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0438 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0440\u0430\u043d\u0435\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u043e\u0439 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432 AWS, \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 Terraform. \u0417\u0430\u0447\u0435\u043c? \u041f\u0440\u0438\u0447\u0438\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0433\u043e: \u0438 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c, \u0438 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435. \u0421 \u043d\u0438\u0445 \u0438 \u043d\u0430\u0447\u043d\u0435\u043c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u043a\u0430<\/h2>\n<p>\u0411\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0432\u044b \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u0442\u0435\u0441\u044c \u0441 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0442 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u041f\u041e;<\/p>\n<\/li>\n<li>\n<p>\u2026<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u043f\u0440\u043e\u0441 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0435 \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438: \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435, \u043d\u0430 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c\u2026 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0435\u0442\u0435 \u2014 \u043d\u0430 uptime. \u042d\u0442\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0440\u0430\u0441\u0446\u0432\u0435\u0442\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 IaC.<\/p>\n<p>\u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u0441\u043b\u0443\u0436\u0431 \u0432\u043e\u043f\u0440\u043e\u0441 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 (Ansible, Chef \u0438 \u0442.\u043f.), \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d\u0438 \u043d\u0435 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u0438\u0439 \u2014 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0439 \u2014 \u0441\u043b\u043e\u0439, \u0430 \u0432\u0435\u0434\u044c \u043e\u043d \u0442\u043e\u0436\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0441 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a Terraform. \u041e\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0443\u043c\u0435\u0441\u0442\u043d\u044b\u043c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441 \u043d\u0443\u043b\u044f. \u041d\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u043e\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 production, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 (\u0441\u043e\u0442\u0435\u043d, \u2026) \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432? \u0412\u0435\u0434\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u043a\u043e\u043b\u043e\u0441\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0443\u0434\u043e\u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u043c \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c <strong>\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/strong> \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e production-\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0430 \u0437\u0430\u0442\u0435\u043c \u2014 <strong>\u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/strong> \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u2014 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u2014 \u0431\u044b\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b (\u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0441\u0430\u043c Terraform, CLI-\u0443\u0442\u0438\u043b\u0438\u0442\u0443 AWS, <a href=\"https:\/\/github.com\/dtan4\/terraforming\"><u>Terraforming<\/u><\/a>), \u043d\u043e \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/GoogleCloudPlatform\/terraformer\"><u>Terraformer<\/u><\/a>. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u2014 \u043f\u043e\u043b\u043d\u043e\u0442\u0430 \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/450410\/\"><u>\u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f<\/u><\/a> \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u043c\u0438 \u0432\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0438. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u043c \u0442\u0430\u043a \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0441\u0440\u0430\u0437\u0443 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445, \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u0420\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0432 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0435\u0433\u0438\u043e\u043d. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0432 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0440\u0435\u0434\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u043e\u0439 \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0432\u0435\u0440\u0441\u0438\u044f\u043c \u041f\u041e.<\/p>\n<p>\u0421\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c Docker-\u043e\u0431\u0440\u0430\u0437\u0430 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0443\u0442\u0438\u043b\u0438\u0442\u044b werf, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0435\u0451 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c (<em>stapel<\/em>) \u0432\u043c\u0435\u0441\u0442\u043e Dockerfile. \u0412 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f (\u043e\u0431\u044b\u0447\u043d\u044b\u0439 <code>docker<\/code> \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442) \u2014 \u0432\u0441\u0435 \u0434\u0435\u043b\u043e \u0432 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u043c\/\u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435.&nbsp;<\/p>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Ubuntu \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 Terraform \u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Terraformer. \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438 \u0444\u0430\u0439\u043b \u0441 \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 AWS. \u0412\u043e\u0442 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 stapel-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 \u0434\u043b\u044f werf (\u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u043d\u0430 <code>Dockerfile<\/code> \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438):<\/p>\n<pre><code class=\"json\">configVersion: 1 project: terraform ---   {{- $params := dict -}} {{- $_ := set $params \"UbuntuVersion\" \"18.04\" -}} {{- $_ := set $params \"UbuntuCodename\" \"bionic\" -}} {{- $_ := set $params \"TerraformVersion\" \"0.13.6\" -}} {{- $_ := set $params \"TerraformerVersion\" \"0.8.10\" -}} {{- $_ := set $params \"WorkDir\" \"\/opt\/terraform\" -}} {{- $_ := set $params \"AWSDefaultOutput\" \"json\" -}}   {{- $_ := env \"AWS_SECRET_ACCESS_KEY\" | set $ \"AWSSecretAccessKey\" -}} {{- $_ := env \"AWS_ACCESS_KEY_ID\" | set $ \"AWSAccessKeyId\" }} {{- $_ := env \"AWS_REGION\" | set $ \"AWSRegion\" }} {{- $_ := env \"CI_ENVIRONMENT_SLUG\" | set $ \"Environment\" }}   --- image: terraform from: ubuntu:{{ $params.UbuntuVersion }} git: - add: \/  to: \"{{ $params.WorkDir }}\"  owner: terraform  group: terraform  excludePaths:  - \"*.tfstate\"  - \"*.tfstate.backup\"  - \"*.bak\"  - \".gitlab-ci.yml\"  stageDependencies:    setup:    - \"regions\/*\"    - \"states\/*\" ansible:  beforeInstall:  - name: \"Install essential utils\"    apt:      name:      - tzdata      - apt-transport-https      - curl      - locales      - locales-all      - unzip      - python      - groff      - vim      update_cache: yes  - name: \"Remove old timezone symlink\"    file:      state: absent      path: \"\/etc\/localtime\"  - name: \"Set timezone\"    file:      src: \/usr\/share\/zoneinfo\/Europe\/Moscow      dest: \/etc\/localtime      owner: root      group: root      state: link  - name: \"Create non-root main application user\"    user:      name: terraform      comment: \"Non-root main application user\"      uid: 7000      shell: \/bin\/bash      home: {{ $params.WorkDir }}  - name: \"Remove excess docs and man files\"    file:      path: \"{{`{{ item }}`}}\"      state: absent    with_items:    - \/usr\/share\/doc\/    - \/usr\/share\/man\/  - name: \"Disable docs and man files installation in dpkg\"    copy:      content: |        path-exclude=\"\/usr\/share\/doc\/*\"      dest: \"\/etc\/dpkg\/dpkg.cfg.d\/01_nodoc\"  - name: \"Generate ru_RU.UTF-8 default locale\"    locale_gen:      name: ru_RU.UTF-8      state: present   install:  - name: \"Download terraform\"    get_url:      url: https:\/\/releases.hashicorp.com\/terraform\/{{ $params.TerraformVersion }}\/terraform_{{ $params.TerraformVersion }}_linux_amd64.zip      dest: \/usr\/src\/terraform_{{ $params.TerraformVersion }}_linux_amd64.zip      mode: 0644  - name: \"Install terraform\"    shell: |      unzip \/usr\/src\/terraform_{{ $params.TerraformVersion }}_linux_amd64.zip -d \/usr\/local\/bin      terraform -install-autocomplete  - name: \"Install terraformer provider\"    get_url:      url: https:\/\/github.com\/GoogleCloudPlatform\/terraformer\/releases\/download\/{{ $params.TerraformerVersion }}\/terraformer-aws-linux-amd64      dest: \/usr\/local\/bin\/terraformer      mode: 0755  - name: \"Make AWS config files\"    shell: |      set -e      mkdir \"{{ $params.WorkDir }}\/.aws\"      touch \"{{ $params.WorkDir }}\/.aws\/credentials\"      touch \"{{ $params.WorkDir }}\/.aws\/config\"      chown -R 7000:7000 \"{{ $params.WorkDir }}\/.aws\"      chmod 0700 \"{{ $params.WorkDir }}\/.aws\"      chmod 0600 \"{{ $params.WorkDir }}\/.aws\/credentials\"  beforeSetup:  - name: \"Write AWS credentials\"    shell: |      set -e      printf \"[default]\\noutput = %s\\nregion = %s\\n\" \"{{ $params.AWSDefaultOutput }}\" \"{{ $.AWSRegion }}\" &gt;&gt; \"{{ $params.WorkDir }}\/.aws\/config\"      printf \"[default]\\naws_access_key_id = %s\\naws_secret_access_key = %s\\n\" \"{{ $.AWSAccessKeyId }}\" \"{{ $.AWSSecretAccessKey }}\" &gt;&gt; \"{{ $params.WorkDir }}\/.aws\/credentials\"  - name: \"Create region directories\"    file:      path: \"{{`{{ item }}`}}\"      state: directory      owner: 7000      group: 7000      mode: 0775    with_items:      - \"{{ $params.WorkDir }}\/regions\/{{ $.Environment }}\"      - \"{{ $params.WorkDir }}\/states\/{{ $.Environment }}\"  setup:  - name: \"Init\"    shell: |      terraform init    args:      chdir: \"{{ $params.WorkDir }}\"    become: true    become_user: terraform  beforeSetupCacheVersion: \"{{ $.AWSRegion }}-{{ $.AWSAccessKeyId }}\"  setupCacheVersion: \"{{ $.Environment }}-{{ $.AWSRegion }}-{{ $.AWSAccessKeyId }}\"<\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437, \u0443\u043a\u0430\u0437\u0430\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441 \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f AWS IAM. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0438\u043b\u0438 \u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432 CI-\u0441\u0440\u0435\u0434\u0435:<\/p>\n<pre><code class=\"bash\"># werf build CI_ENVIRONMENT_SLUG=\"eu\" AWS_SECRET_ACCESS_KEY=\"XXX\" AWS_ACCESS_KEY_ID=\"YYY\" AWS_REGION=\"eu-central-1\" werf build --stages-storage :local<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0438 \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u043c \u0441 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 \u0441\u043b\u043e\u0438 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0431\u0440\u0430\u043d\u043e:<\/p>\n<pre><code class=\"bash\"># werf run terraform CI_ENVIRONMENT_SLUG=\"eu\" AWS_SECRET_ACCESS_KEY=\"XXX\" AWS_ACCESS_KEY_ID=\"YYY\" AWS_REGION=\"eu-central-1\" werf run --stages-storage :local --docker-options=\"--rm -ti -w \/opt\/terraform\/ -u terraform\" terraform -- \/bin\/bash<\/code><\/pre>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<h3>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>\u042d\u0442\u0430\u043f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Terraform \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0441\u0430\u043c \u043e\u0431\u0440\u0430\u0437. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442 \u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043c, \u043d\u043e \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442, \u2014 \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (\u0447\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0437\u0430\u0434\u0430\u0447\u0438).<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b (<code>providers.tf<\/code>) \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0435\u0433\u043e \u0432 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0432 \u043e\u0431\u0440\u0430\u0437\u0435:<\/p>\n<pre><code class=\"json\">terraform {  required_providers {    aws = {      source  = \"hashicorp\/aws\"      version = \"~&gt; 3.25\"    }  } }   provider \"aws\" {  profile = \"default\" }<\/code><\/pre>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e Terraform. \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0435 \u043f\u043b\u0430\u0433\u0438\u043d \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438, \u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0448\u0430\u0433\u043e\u043c, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0443\u0436\u0435 \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<pre><code class=\"bash\">~$ terraform init Initializing the backend... ~~~ Terraform has been successfully initialized!<\/code><\/pre>\n<h3>\u0418\u043c\u043f\u043e\u0440\u0442<\/h3>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043b\u044e\u0447\u0438:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"284\" width=\"284\">\n<p><code>aws<\/code><\/p>\n<\/td>\n<td>\n<p>\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"284\" width=\"284\">\n<p><code>--path-pattern=\"{output}\/\"<\/code><\/p>\n<\/td>\n<td>\n<p>\u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"284\" width=\"284\">\n<p><code>--compact=true<\/code><\/p>\n<\/td>\n<td>\n<p>\u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0432\u0441\u0435\u0445 \u0442\u0438\u043f\u043e\u0432 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0432 \u0435\u0434\u0438\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u0424\u0430\u0439\u043b\u044b \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"284\" width=\"284\">\n<p><code>--regions=eu-central-1<\/code><\/p>\n<\/td>\n<td>\n<p>\u0440\u0435\u0433\u0438\u043e\u043d \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"284\" width=\"284\">\n<p><code>--resources=elasticache,rds<\/code><\/p>\n<\/td>\n<td>\n<p>\u0442\u0438\u043f\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<pre><code class=\"bash\">~$ terraformer import aws --path-pattern=\"{output}\/\" --compact=true --regions=eu-central-1 --resources=elasticache,rds aws importing region eu-central-1 aws importing... elasticache                 ~~~ aws importing... rds                 ~~~ aws Connecting....  aws save  aws save tfstate<\/code><\/pre>\n<p>\u041c\u0435\u043d\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043d\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 \u0438\u043c\u043f\u043e\u0440\u0442\u0430, \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 (\u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432):<\/p>\n<pre><code class=\"bash\">~$ cd generated\/ ~\/generated$ terraform init  Initializing the backend...                 ~~~ Terraform has been successfully initialized!<\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"bash\">~\/generated$ terraform plan Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage.  data.terraform_remote_state.local: Refreshing state...                 ~~~  An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols:   ~ update in-place  Terraform will perform the following actions:    # aws_db_instance.tfer--db1 will be updated in-place   ~ resource \"aws_db_instance\" \"tfer--db1\" {                 ~~~       + delete_automated_backups              = true                 ~~~       + skip_final_snapshot                   = false                 ~~~     }    # aws_db_instance.tfer--db2 will be updated in-place   ~ resource \"aws_db_instance\" \"tfer--db2\" {                 ~~~       + delete_automated_backups              = true                 ~~~       + skip_final_snapshot                   = false                 ~~~     }  Plan: 0 to add, 2 to change, 0 to destroy.<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0444\u0430\u0439\u043b\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0435, \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 Terraform \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 <code>aws_db_instance<\/code>. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437-\u0437\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0438 Terraform&#8217;\u0430. \u042d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0448\u0442\u0430\u0442\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u0442.\u043a. \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u043e\u0434\u043d\u043e\u043c\u0443 \u0432\u0435\u043d\u0434\u043e\u0440\u0443, \u0438 \u043e\u0434\u043d\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0435\u0439 \u043f\u043e\u0432\u0435\u0440\u0445 \u0434\u0440\u0443\u0433\u043e\u0439. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0442\u0441\u0442\u0430\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u044e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438 \u0444\u0430\u0439\u043b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f <code>tfstate<\/code> \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u043e \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0432 \u0434\u0432\u0443\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445 <code>aws_db_instance<\/code>:<\/p>\n<ul>\n<li>\n<p><code>delete_automated_backups<\/code><\/p>\n<\/li>\n<li>\n<p><code>skip_final_snapshot<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0432\u044b\u044f\u0441\u043d\u0438\u043c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0448\u0442\u0430\u0442\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b AWS: web-gui \u0438\u043b\u0438 aws-cli. \u041f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u044d\u0442\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432:<\/p>\n<pre><code class=\"bash\">~\/generated$ vim resources.tf    delete_automated_backups = \"false\"             ~~~   skip_final_snapshot = \"false\"  ~\/generated$ vim terraform.tfstate    \"delete_automated_backups\": \"false\",             ~~~   \"skip_final_snapshot\": \"false\",<\/code><\/pre>\n<p>\u2026 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"bash\">~\/generated$ terraform plan Refreshing Terraform state in-memory prior to plan...<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0434\u0430\u0435\u0442 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"bash\">0 to add, 0 to change, 0 to destroy<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430 \u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433.<\/p>\n<h3>\u0414\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438 \u0441\u043b\u0438\u044f\u043d\u0438\u0435<\/h3>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<p>\u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0438\u043c\u043f\u043e\u0440\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u0436\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433. \u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f <code>path-pattern<\/code> \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439, \u0442.\u043a. Terraformer \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u043e\u0439 \u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0448\u0435\u0442 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0444\u0430\u0439\u043b\u044b.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a \u0443\u0436\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b EC2, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u0431\u0449\u0438\u0439 \u0442\u0435\u0433 <code>NodeRole=node<\/code>, \u0443\u043a\u0430\u0437\u0430\u0432 \u044d\u0442\u043e \u0432 \u043a\u043b\u044e\u0447\u0435 <code>--filter<\/code>:<\/p>\n<pre><code class=\"bash\">~\/generated$ cd ..\/ ~$ terraformer import aws --path-pattern=\".\/ec2\/\" --compact=true --regions=eu-central-1 --resources=ec2_instance --filter=\"Name=tags.NodeRole;Value=node\" aws importing region eu-central-1 aws importing... ec2_instance Refreshing state... aws_instance.tfer--i-002D-03f57062-node-1 Refreshing state... aws_instance.tfer--i-002D-009fc9e6-node-2 Refreshing state... aws_instance.tfer--i-002D-0b4b4c7c-node-3 aws Connecting....  aws save  aws save tfstate<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"bash\">~$ cd ec2\/ ~\/ec2$ terraform init  Initializing the backend...  Initializing provider plugins... - terraform.io\/builtin\/terraform is built in to Terraform - Finding hashicorp\/aws versions matching \"~&gt; 3.29.0\"... - Finding latest version of -\/aws... - Installing -\/aws v3.29.0... - Installed -\/aws v3.29.0 (signed by HashiCorp) - Installing hashicorp\/aws v3.29.0... - Installed hashicorp\/aws v3.29.0 (signed by HashiCorp)  The following providers do not have any version constraints in configuration, so the latest version was installed.  To prevent automatic upgrades to new major versions that may contain breaking changes, we recommend adding version constraints in a required_providers block in your configuration, with the constraint strings suggested below.  * -\/aws: version = \"~&gt; 3.29.0\"  Terraform has been successfully initialized!  You may now begin working with Terraform. Try running \"terraform plan\" to see any changes that are required for your infrastructure. All Terraform commands should now work.  If you ever set or change modules or backend configuration for Terraform, rerun this command to reinitialize your working directory. If you forget, other commands will detect it and remind you to do so if necessary.<\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435:<\/p>\n<pre><code class=\"bash\">~\/ec2$ terraform plan<\/code><\/pre>\n<p>\u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e:<\/p>\n<pre><code class=\"bash\">0 to add, 0 to change, 0 to destroy<\/code><\/pre>\n<p>\u2026 \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0438\u044f\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 <code>resources.tf<\/code> \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u043e\u043c \u0431\u043b\u043e\u043a\u043e\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439.<\/p>\n<p>\u0421\u043b\u0438\u044f\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 <code>tfstate<\/code> \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e Terraform \u2014 <code>state mv<\/code>. \u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432 \u043e\u0431\u0449\u0438\u0439 \u0444\u0430\u0439\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0437\u0430 \u0440\u0430\u0437. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0430\u043a\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<pre><code class=\"bash\">~\/ec2$ cd ..\/generated\/ ~\/generated$ terraform state mv -state=..\/ec2\/terraform.tfstate -state-out=terraform.tfstate 'tfer--i-002D-03f57062-node-1' 'tfer--i-002D-03f57062-node-1'<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/h3>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e Terraform \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c. \u0412\u0435\u0434\u044c \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u044b\u0435, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438 \u043f\u043e\u043b\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>\u0438\u043c\u0435\u043d\u043d\u043e Plan: 0 to add, 0 to change, 0 to destroy<\/code>.<\/p>\n<pre><code class=\"bash\">~\/regions\/eu$ terraform apply                 ~~~ Terraform will perform the following actions:  Plan: 0 to add, 0 to change, 0 to destroy.                 ~~~ Apply complete! Resources: 0 added, 0 changed, 0 destroyed.<\/code><\/pre>\n<h3>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432 S3<\/h3>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b <code>tfstate<\/code> \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 S3. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u044d\u0442\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c\u0438 Terraform. \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0444\u0430\u0439\u043b\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432 \u043d\u0430\u0434 \u043e\u0431\u044a\u0435\u043c\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0431\u0435\u0437 \u0440\u0438\u0441\u043a\u0430 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432 S3 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f <code>tfstate<\/code> \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0444\u0430\u0439\u043b\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f.<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430:<\/p>\n<pre><code class=\"json\">provider \"aws\" {   region = \"eu-central-1\" }  terraform {   required_providers {     aws = {       version = \"~&gt; 3.28.0\"     }   } }<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u2014 \u043a\u043e\u043d\u0444\u0438\u0433 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 <code>aws_s3_bucket<\/code>. \u0414\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0432 S3:<\/p>\n<pre><code class=\"json\">resource \"aws_s3_bucket\" \"terraform_state\" {   bucket = \"eu-terraform-state\"   lifecycle {     prevent_destroy = true   }   versioning {     enabled = true   }   server_side_encryption_configuration {     rule {       apply_server_side_encryption_by_default {         sse_algorithm = \"AES256\"       }     }   } }<\/code><\/pre>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"325\" width=\"325\">\n<p><code>bucket<\/code><\/p>\n<\/td>\n<td>\n<p>\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"325\" width=\"325\">\n<p><code>lifecycle { prevent_destroy = true }<\/code><\/p>\n<\/td>\n<td>\n<p>\u0437\u0430\u043f\u0440\u0435\u0442 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"325\" width=\"325\">\n<p><code>versioning { enabled = true }<\/code><\/p>\n<\/td>\n<td>\n<p>\u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 <code>terraform.tfstate<\/code> \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 S3-\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"325\" width=\"325\">\n<p><code>server_side_encryption_configuration<\/code><\/p>\n<\/td>\n<td>\n<p>\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433 \u0440\u0435\u0441\u0443\u0440\u0441 <code>aws_dynamodb_table<\/code>. \u042d\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430 AWS DynamoDB, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u0445 \u0444\u0430\u0439\u043b\u0430 <code>terraform.tfstate<\/code>:<\/p>\n<pre><code class=\"json\">resource \"aws_dynamodb_table\" \"terraform_locks\" {   name = \"eu-terraform-locks\"   billing_mode = \"PAY_PER_REQUEST\"   hash_key = \"LockID\"   attribute {     name = \"LockID\"     type = \"S\"   } }<\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"197\" width=\"197\">\n<p><code>name<\/code><\/p>\n<\/td>\n<td>\n<p>\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u0445;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"197\" width=\"197\">\n<p><code>billing_mode = \"PAY_PER_REQUEST\"<\/code><\/p>\n<\/td>\n<td>\n<p>\u0442\u0438\u043f \u043e\u043f\u043b\u0430\u0442\u044b. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>PAY_PER_REQUEST<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0439 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"197\" width=\"197\">\n<p><code>hash_key<\/code><\/p>\n<p><code>attribute {<br \/>&nbsp;&nbsp;name = \"LockID\"<br \/>&nbsp;&nbsp;type = \"S\"<br \/>}<\/code><\/p>\n<\/td>\n<td>\n<p>\u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"bash\">~$ terraform init Initializing the backend...                 ~~~ Terraform has been successfully initialized!  ~\/states\/eu$ terraform plan Terraform will perform the following actions:    # aws_dynamodb_table.terraform_locks will be created    # aws_s3_bucket.terraform_state will be created  Plan: 2 to add, 0 to change, 0 to destroy.  ~\/states\/eu$ terraform apply Terraform will perform the following actions:    # aws_dynamodb_table.terraform_locks will be created    # aws_s3_bucket.terraform_state will be created  Plan: 2 to add, 0 to change, 0 to destroy.  aws_dynamodb_table.terraform_locks: Creating... aws_s3_bucket.terraform_state: Creating\u2026  Apply complete! Resources: 2 added, 0 changed, 0 destroyed.<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 AWS \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432 \u043d\u0435\u0439 \u0444\u0430\u0439\u043b <code>backend.tf<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"bash\">~$ cd ..\/..\/regions\/eu ~$ vim backend.tf<\/code><\/pre>\n<pre><code class=\"json\">terraform {  backend \"s3\" {    bucket = \"eu-terraform-state\"    key = \"terraform.tfstate\"    region = \"eu-central-1\"    dynamodb_table = \"eu-terraform-locks\"    encrypt = true  } }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430:<\/p>\n<pre><code class=\"bash\">Backend reinitialization required. Please run \"terraform init\". Reason: Initial configuration of the requested backend \"s3\"<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0435\u0435 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c Terraform \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0430\u043d\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 S3 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442 \u0444\u0430\u0439\u043b <code>terraform.tfstate<\/code>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0435\u0449\u0435 \u043f\u0443\u0441\u0442\u043e\u0435, \u043e\u043d \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u043d\u0430\u043c \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 state-\u0444\u0430\u0439\u043b \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 S3:<\/p>\n<pre><code class=\"bash\">~\/regions\/eu$ terraform init  Initializing the backend... Do you want to copy existing state to the new backend?   Pre-existing state was found while migrating the previous \"local\" backend to the   newly configured \"s3\" backend. No existing state was found in the newly   configured \"s3\" backend. Do you want to copy this state to the new \"s3\"   backend? Enter \"yes\" to copy and \"no\" to start with an empty state.    Enter a value: yes  Releasing state lock. This may take a few moments...  Successfully configured the backend \"s3\"! Terraform will automatically use this backend unless the backend configuration changes.  Terraform has been successfully initialized!<\/code><\/pre>\n<p>\u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"bash\">~\/regions\/eu$ terraform plan Refreshing Terraform state in-memory prior to plan...                 ~~~ No changes. Infrastructure is up-to-date.<\/code><\/pre>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u043d\u0430\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430. \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0435 \u0432 Git-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432 \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 (\u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0438\u0434\u0435) \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f. \u0424\u0430\u0439\u043b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 S3 \u0441 \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0441\u0435\u0441\u0441\u0438\u0438.<\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u043b\u044f \u0432\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0440\u043e\u043a\u0438 \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u0430 \u0441 \u043f\u043e\u043b\u043d\u043e\u0439 \u043f\u043e\u0442\u0435\u0440\u0435\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u044c \u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0438\u0445 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430\u043c\u0438.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430. \u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430, \u0431\u0435\u0437 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0435 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u0441\u044f, \u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0433\u043e\u043d\u044f\u0442\u044c \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0443\u0442\u0438\u043b\u0438\u0442\u0430 Terraformer \u043f\u043e\u043c\u043e\u0433\u043b\u0430 \u043d\u0430\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0443, \u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u044b\u043b \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043d, \u043c\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432 \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u043e\u043a\u0438 \u0438 \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<p>\u041f\u0440\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c (\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0434\u0430\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0430\u0440\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435) \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0442\u0440\u0443\u0434\u043e\u0435\u043c\u043a\u043e\u0441\u0442\u0438. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0438 Terraform \u0441 \u043d\u0443\u043b\u044f, \u043b\u0438\u0431\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0448\u0442\u0430\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445. \u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043d\u0435\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443.<\/p>\n<h2>P.S.<\/h2>\n<p>\u0427\u0438\u0442\u0430\u0439\u0442\u0435 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u0431\u043b\u043e\u0433\u0435:<\/p>\n<ul>\n<li>\n<p>\u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/542082\/\">\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432 AWS \u0441 Prometheus \u0438 exporter\u2019\u0430\u043c\u0438 \u0434\u043b\u044f CloudWatch<\/a>\u00bb;<\/p>\n<\/li>\n<li>\n<p>\u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/542540\/\">\u041a\u0430\u043a \u043c\u044b \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043b\u0438 2000 USD \u043d\u0430 \u0442\u0440\u0430\u0444\u0438\u043a\u0435 \u0438\u0437 Amazon S3 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e nginx-\u043a\u044d\u0448\u0430<\/a>\u00bb.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/550974\/\"> https:\/\/habr.com\/ru\/company\/flant\/blog\/550974\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e \u043d\u0430\u0448 \u043e\u043f\u044b\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0438 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0440\u0430\u043d\u0435\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u043e\u0439 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432 AWS, \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 Terraform. \u0417\u0430\u0447\u0435\u043c? \u041f\u0440\u0438\u0447\u0438\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0433\u043e: \u0438 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c, \u0438 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435. \u0421 \u043d\u0438\u0445 \u0438 \u043d\u0430\u0447\u043d\u0435\u043c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u043a\u0430<\/h2>\n<p>\u0411\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0432\u044b \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u0442\u0435\u0441\u044c \u0441 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0442 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u041f\u041e;<\/p>\n<\/li>\n<li>\n<p>\u2026<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u043f\u0440\u043e\u0441 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0435 \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438: \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435, \u043d\u0430 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c\u2026 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0435\u0442\u0435 \u2014 \u043d\u0430 uptime. \u042d\u0442\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0440\u0430\u0441\u0446\u0432\u0435\u0442\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 IaC.<\/p>\n<p>\u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u0441\u043b\u0443\u0436\u0431 \u0432\u043e\u043f\u0440\u043e\u0441 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 (Ansible, Chef \u0438 \u0442.\u043f.), \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d\u0438 \u043d\u0435 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u0438\u0439 \u2014 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0439 \u2014 \u0441\u043b\u043e\u0439, \u0430 \u0432\u0435\u0434\u044c \u043e\u043d \u0442\u043e\u0436\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0441 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a Terraform. \u041e\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0443\u043c\u0435\u0441\u0442\u043d\u044b\u043c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441 \u043d\u0443\u043b\u044f. \u041d\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u043e\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 production, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 (\u0441\u043e\u0442\u0435\u043d, \u2026) \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432? \u0412\u0435\u0434\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u043a\u043e\u043b\u043e\u0441\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0443\u0434\u043e\u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u043c \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c <strong>\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/strong> \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e production-\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0430 \u0437\u0430\u0442\u0435\u043c \u2014 <strong>\u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/strong> \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u2014 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u2014 \u0431\u044b\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b (\u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0441\u0430\u043c Terraform, CLI-\u0443\u0442\u0438\u043b\u0438\u0442\u0443 AWS, <a href=\"https:\/\/github.com\/dtan4\/terraforming\"><u>Terraforming<\/u><\/a>), \u043d\u043e \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/GoogleCloudPlatform\/terraformer\"><u>Terraformer<\/u><\/a>. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u2014 \u043f\u043e\u043b\u043d\u043e\u0442\u0430 \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/450410\/\"><u>\u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f<\/u><\/a> \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u043c\u0438 \u0432\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0438. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u043c \u0442\u0430\u043a \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0441\u0440\u0430\u0437\u0443 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445, \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u0420\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0432 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0435\u0433\u0438\u043e\u043d. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0432 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0440\u0435\u0434\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u043e\u0439 \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0432\u0435\u0440\u0441\u0438\u044f\u043c \u041f\u041e.<\/p>\n<p>\u0421\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c Docker-\u043e\u0431\u0440\u0430\u0437\u0430 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0443\u0442\u0438\u043b\u0438\u0442\u044b werf, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0435\u0451 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c (<em>stapel<\/em>) \u0432\u043c\u0435\u0441\u0442\u043e Dockerfile. \u0412 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f (\u043e\u0431\u044b\u0447\u043d\u044b\u0439 <code>docker<\/code> \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442) \u2014 \u0432\u0441\u0435 \u0434\u0435\u043b\u043e \u0432 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u043c\/\u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435.&nbsp;<\/p>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Ubuntu \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 Terraform \u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Terraformer. \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438 \u0444\u0430\u0439\u043b \u0441 \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 AWS. \u0412\u043e\u0442 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 stapel-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 \u0434\u043b\u044f werf (\u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u043d\u0430 <code>Dockerfile<\/code> \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438):<\/p>\n<pre><code class=\"json\">configVersion: 1 project: terraform ---   {{- $params := dict -}} {{- $_ := set $params \"UbuntuVersion\" \"18.04\" -}} {{- $_ := set $params \"UbuntuCodename\" \"bionic\" -}} {{- $_ := set $params \"TerraformVersion\" \"0.13.6\" -}} {{- $_ := set $params \"TerraformerVersion\" \"0.8.10\" -}} {{- $_ := set $params \"WorkDir\" \"\/opt\/terraform\" -}} {{- $_ := set $params \"AWSDefaultOutput\" \"json\" -}}   {{- $_ := env \"AWS_SECRET_ACCESS_KEY\" | set $ \"AWSSecretAccessKey\" -}} {{- $_ := env \"AWS_ACCESS_KEY_ID\" | set $ \"AWSAccessKeyId\" }} {{- $_ := env \"AWS_REGION\" | set $ \"AWSRegion\" }} {{- $_ := env \"CI_ENVIRONMENT_SLUG\" | set $ \"Environment\" }}   --- image: terraform from: ubuntu:{{ $params.UbuntuVersion }} git: - add: \/  to: \"{{ $params.WorkDir }}\"  owner: terraform  group: terraform  excludePaths:  - \"*.tfstate\"  - \"*.tfstate.backup\"  - \"*.bak\"  - \".gitlab-ci.yml\"  stageDependencies:    setup:    - \"regions\/*\"    - \"states\/*\" ansible:  beforeInstall:  - name: \"Install essential utils\"    apt:      name:      - tzdata      - apt-transport-https      - curl      - locales      - locales-all      - unzip      - python      - groff      - vim      update_cache: yes  - name: \"Remove old timezone symlink\"    file:      state: absent      path: \"\/etc\/localtime\"  - name: \"Set timezone\"    file:      src: \/usr\/share\/zoneinfo\/Europe\/Moscow      dest: \/etc\/localtime      owner: root      group: root      state: link  - name: \"Create non-root main application user\"    user:      name: terraform      comment: \"Non-root main application user\"      uid: 7000      shell: \/bin\/bash      home: {{ $params.WorkDir }}  - name: \"Remove excess docs and man files\"    file:      path: \"{{`{{ item }}`}}\"      state: absent    with_items:    - \/usr\/share\/doc\/    - \/usr\/share\/man\/  - name: \"Disable docs and man files installation in dpkg\"    copy:      content: |        path-exclude=\"\/usr\/share\/doc\/*\"      dest: \"\/etc\/dpkg\/dpkg.cfg.d\/01_nodoc\"  - name: \"Generate ru_RU.UTF-8 default locale\"    locale_gen:      name: ru_RU.UTF-8      state: present   install:  - name: \"Download terraform\"    get_url:      url: https:\/\/releases.hashicorp.com\/terraform\/{{ $params.TerraformVersion }}\/terraform_{{ $params.TerraformVersion }}_linux_amd64.zip      dest: \/usr\/src\/terraform_{{ $params.TerraformVersion }}_linux_amd64.zip      mode: 0644  - name: \"Install terraform\"    shell: |      unzip \/usr\/src\/terraform_{{ $params.TerraformVersion }}_linux_amd64.zip -d \/usr\/local\/bin      terraform -install-autocomplete  - name: \"Install terraformer provider\"    get_url:      url: https:\/\/github.com\/GoogleCloudPlatform\/terraformer\/releases\/download\/{{ $params.TerraformerVersion }}\/terraformer-aws-linux-amd64      dest: \/usr\/local\/bin\/terraformer      mode: 0755  - name: \"Make AWS config files\"    shell: |      set -e      mkdir \"{{ $params.WorkDir }}\/.aws\"      touch \"{{ $params.WorkDir }}\/.aws\/credentials\"      touch \"{{ $params.WorkDir }}\/.aws\/config\"      chown -R 7000:7000 \"{{ $params.WorkDir }}\/.aws\"      chmod 0700 \"{{ $params.WorkDir }}\/.aws\"      chmod 0600 \"{{ $params.WorkDir }}\/.aws\/credentials\"  beforeSetup:  - name: \"Write AWS credentials\"    shell: |      set -e      printf \"[default]\\noutput = %s\\nregion = %s\\n\" \"{{ $params.AWSDefaultOutput }}\" \"{{ $.AWSRegion }}\" &gt;&gt; \"{{ $params.WorkDir }}\/.aws\/config\"      printf \"[default]\\naws_access_key_id = %s\\naws_secret_access_key = %s\\n\" \"{{ $.AWSAccessKeyId }}\" \"{{ $.AWSSecretAccessKey }}\" &gt;&gt; \"{{ $params.WorkDir }}\/.aws\/credentials\"  - name: \"Create region directories\"    file:      path: \"{{`{{ item }}`}}\"      state: directory      owner: 7000      group: 7000      mode: 0775    with_items:      - \"{{ $params.WorkDir }}\/regions\/{{ $.Environment }}\"      - \"{{ $params.WorkDir }}\/states\/{{ $.Environment }}\"  setup:  - name: \"Init\"    shell: |      terraform init    args:      chdir: \"{{ $params.WorkDir }}\"    become: true    become_user: terraform  beforeSetupCacheVersion: \"{{ $.AWSRegion }}-{{ $.AWSAccessKeyId }}\"  setupCacheVersion: \"{{ $.Environment }}-{{ $.AWSRegion }}-{{ $.AWSAccessKeyId }}\"<\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437, \u0443\u043a\u0430\u0437\u0430\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441 \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f AWS IAM. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0438\u043b\u0438 \u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432 CI-\u0441\u0440\u0435\u0434\u0435:<\/p>\n<pre><code class=\"bash\"># werf build CI_ENVIRONMENT_SLUG=\"eu\" AWS_SECRET_ACCESS_KEY=\"XXX\" AWS_ACCESS_KEY_ID=\"YYY\" AWS_REGION=\"eu-central-1\" werf build --stages-storage :local<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0438 \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u043c \u0441 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 \u0441\u043b\u043e\u0438 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0431\u0440\u0430\u043d\u043e:<\/p>\n<pre><code class=\"bash\"># werf run terraform CI_ENVIRONMENT_SLUG=\"eu\" AWS_SECRET_ACCESS_KEY=\"XXX\" AWS_ACCESS_KEY_ID=\"YYY\" AWS_REGION=\"eu-central-1\" werf run --stages-storage :local --docker-options=\"--rm -ti -w \/opt\/terraform\/ -u terraform\" terraform -- \/bin\/bash<\/code><\/pre>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<h3>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>\u042d\u0442\u0430\u043f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Terraform \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0441\u0430\u043c \u043e\u0431\u0440\u0430\u0437. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442 \u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043c, \u043d\u043e \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442, \u2014 \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (\u0447\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0437\u0430\u0434\u0430\u0447\u0438).<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b (<code>providers.tf<\/code>) \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0435\u0433\u043e \u0432 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0432 \u043e\u0431\u0440\u0430\u0437\u0435:<\/p>\n<pre><code class=\"json\">terraform {  required_providers {    aws = {      source  = \"hashicorp\/aws\"      version = \"~&gt; 3.25\"    }  } }   provider \"aws\" {  profile = \"default\" }<\/code><\/pre>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e Terraform. \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0435 \u043f\u043b\u0430\u0433\u0438\u043d \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438, \u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0448\u0430\u0433\u043e\u043c, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0443\u0436\u0435 \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<pre><code class=\"bash\">~$ terraform init Initializing the backend... ~~~ Terraform has been successfully initialized!<\/code><\/pre>\n<h3>\u0418\u043c\u043f\u043e\u0440\u0442<\/h3>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043b\u044e\u0447\u0438:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"284\" width=\"284\">\n<p><code>aws<\/code><\/p>\n<\/td>\n<td>\n<p>\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"284\" width=\"284\">\n<p><code>--path-pattern=\"{output}\/\"<\/code><\/p>\n<\/td>\n<td>\n<p>\u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"284\" width=\"284\">\n<p><code>--compact=true<\/code><\/p>\n<\/td>\n<td>\n<p>\u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0432\u0441\u0435\u0445 \u0442\u0438\u043f\u043e\u0432 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0432 \u0435\u0434\u0438\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u0424\u0430\u0439\u043b\u044b \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"284\" width=\"284\">\n<p><code>--regions=eu-central-1<\/code><\/p>\n<\/td>\n<td>\n<p>\u0440\u0435\u0433\u0438\u043e\u043d \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"284\" width=\"284\">\n<p><code>--resources=elasticache,rds<\/code><\/p>\n<\/td>\n<td>\n<p>\u0442\u0438\u043f\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<pre><code class=\"bash\">~$ terraformer import aws --path-pattern=\"{output}\/\" --compact=true --regions=eu-central-1 --resources=elasticache,rds aws importing region eu-central-1 aws importing... elasticache                 ~~~ aws importing... rds                 ~~~ aws Connecting....  aws save  aws save tfstate<\/code><\/pre>\n<p>\u041c\u0435\u043d\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043d\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 \u0438\u043c\u043f\u043e\u0440\u0442\u0430, \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 (\u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432):<\/p>\n<pre><code class=\"bash\">~$ cd generated\/ ~\/generated$ terraform init  Initializing the backend...                 ~~~ Terraform has been successfully initialized!<\/code><\/pre>\n<p>\u0412\u044b<\/p>\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-321337","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321337","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=321337"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321337\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=321337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=321337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=321337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}