{"id":405420,"date":"2024-06-29T18:18:48","date_gmt":"2024-06-29T18:18:48","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=405420"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=405420","title":{"rendered":"<span>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Terraform \u043d\u0430 Terragrunt<\/span>"},"content":{"rendered":"<div><!--[--><img loading=\"lazy\" decoding=\"async\" height=\"1\" src=\"https:\/\/www.facebook.com\/tr?id=971720443354181&amp;ev=PageView&amp;noscript=1\" style=\"display:none;\" width=\"1\"><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/826\/ace\/298\/826ace29832d3106fa5850586edd3c42.png\" alt=\"https:\/\/miro.medium.com\/max\/700\/1*FnD69VqaPYSOaKzTUb_njw.jpeg\" title=\"https:\/\/miro.medium.com\/max\/700\/1*FnD69VqaPYSOaKzTUb_njw.jpeg\" width=\"1200\" height=\"554\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/826\/ace\/298\/826ace29832d3106fa5850586edd3c42.png\"\/><figcaption>https:\/\/miro.medium.com\/max\/700\/1*FnD69VqaPYSOaKzTUb_njw.jpeg<\/figcaption><\/figure>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 <a href=\"https:\/\/bestmile.com\/\"><u>Bestmile<\/u><\/a> \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/www.terraform.io\/\"><u>Terraform<\/u><\/a> \u0434\u043b\u044f AWS IaC. \u041d\u043e \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0430\u0448\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u0435\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043a\u043e\u0434 Terraform.<\/p>\n<p>\u041a\u043e\u0434 Terraform \u0441\u0442\u0430\u043b\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c. \u041e\u043d \u0442\u0435\u0440\u044f\u043b \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c.Terraform\u00a0\u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043d\u043e \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\u0445. \u0417\u0434\u0435\u0441\u044c-\u0442\u043e \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f Terragrunt.<\/p>\n<p>Terragrunt\u00a0\u2014 \u044d\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430 (wrapper) \u0434\u043b\u044f Terraform, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f.\u00a0<a href=\"https:\/\/terragrunt.gruntwork.io\/\"><u>Terragrunt<\/u><\/a> \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 Terraform \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0434\u0430 HCL (<a href=\"https:\/\/github.com\/hashicorp\/hcl\"><u>HashiCorp Configuration Language<\/u><\/a>), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 Terragrunt \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043e\u0434 Terraform \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435 \u043a\u043e\u0434 HCL. \u0418\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u0434\u0430\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0438\u0436\u0435, \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 Terragrunt \u0432 \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442.<\/p>\n<h4>\u0427\u0435\u0433\u043e \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c Terraform<\/h4>\n<p>\u0412 Terraform <strong>\u043d\u0435\u0442<\/strong> <strong>\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438<\/strong>: \u0434\u0432\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0412 Terragrunt \u0435\u0441\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>dependencies<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p><strong>\u041d\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a<\/strong> \u0434\u043b\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a: \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 Terraform \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c, \u043f\u0440\u043e\u0441\u0442\u043e \u0435\u0449\u0435 \u0440\u0430\u0437 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <em>apply<\/em>.<\/p>\n<p><strong>\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/strong> <strong>\u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u044e<\/strong> \u043c\u043e\u0434\u0443\u043b\u044f Terraform \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445, \u0435\u0441\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c VPC Terraform. \u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u0438 \u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u043c. Terragrunt \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0442\u043a\u0438 \u0438\u043b\u0438 \u0442\u0435\u0433\u0430 \u0434\u043b\u044f \u0434\u0435\u043f\u043b\u043e\u044f.<\/p>\n<p>\u0412 Terraform <strong>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c<\/strong> <strong>\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445 \u043f\u0440\u0438\u043d\u0446\u0438\u043f DRY<\/strong> \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445 (\u0431\u0430\u043a\u0435\u0442 S3, \u0440\u0435\u0433\u0438\u043e\u043d, \u0442\u0430\u0431\u043b\u0438\u0446\u0430 DynamoDB \u0438 \u0442.\u00a0\u0434.)\u00a0\u2014 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b (EKS, S3, IAM, MSK&#8230;) \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0431\u044d\u043a\u0435\u043d\u0434-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e Terraform. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b SRE. Terragrunt \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>path_relative_to_include()<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043a\u043e\u0434\u0430 Terraform \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e, \u0435\u0433\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u043e \u043f\u0430\u043f\u043a\u0430\u043c. \u0412 Terraform \u043f\u0440\u043e\u0441\u0442\u043e <strong>\u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/strong> plan \u0438\u043b\u0438 apply \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0430\u043f\u043e\u043a. \u0412 Terragrunt \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c plan-all \u0438 apply-all.<\/p>\n<blockquote>\n<p>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0443.<br \/>\u041c\u043d\u0435 \u043d\u0435 \u0440\u0430\u0437 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043b\u044e\u0434\u044f\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0422\u0435\u0440\u0440\u0430\u0444\u043e\u0440\u043c \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0418 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0440\u0435\u0447\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e \u0434\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043e\u0431\u0430 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0435: \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430 \u043f\u0430\u043f\u043a\u0438 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0432 \u0434\u0435\u043f\u043b\u043e\u0435. \u0422\u0435\u0440\u0440\u0430\u0433\u0440\u0430\u043d\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043e\u0431\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0422\u0435\u0440\u0440\u0430\u0444\u043e\u0440\u043c\u0430 \u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. <em>\u041f\u0430\u0432\u0435\u043b \u0417\u0430\u043c\u043e\u0448\u0438\u043d, \u0430\u0432\u0442\u043e\u0440 <\/em><a href=\"https:\/\/slurm.club\/2Vugw1E\"><em>\u043a\u0443\u0440\u0441\u043e\u0432 \u0421\u043b\u0451\u0440\u043c \u043f\u043e Terraform<\/em><\/a><em>, Site Reliability Engineer \u0432 Malwarebytes.<\/em><\/p>\n<\/blockquote>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/caf\/a61\/bcd\/cafa61bcdaed0ec69882be99f6635653.png\" alt=\"https:\/\/xkcd.com\/303\/\" title=\"https:\/\/xkcd.com\/303\/\" width=\"413\" height=\"360\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/caf\/a61\/bcd\/cafa61bcdaed0ec69882be99f6635653.png\"\/><figcaption>https:\/\/xkcd.com\/303\/<\/figcaption><\/figure>\n<h2>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/h2>\n<h4>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 Terraform \u0432 Terragrunt<\/h4>\n<p>\u0414\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 Terragrunt \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u044b\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 Terraform, \u043d\u043e \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043d\u0430\u0447\u0430\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Terraform:<\/p>\n<pre><code class=\"bash\">$ tree . \u251c\u2500\u2500 dev \u2502   \u251c\u2500\u2500 efs.tf \u2502   \u251c\u2500\u2500 eks.tf ...omitted for brevity... \u2502   \u251c\u2500\u2500 vpc.tf \u251c\u2500\u2500 mgmt \u2502   \u251c\u2500\u2500 eks.tf \u2502   \u251c\u2500\u2500 mgmt.tf \u2502   \u251c\u2500\u2500 outputs.tf \u251c\u2500\u2500 modules \u2502   \u251c\u2500\u2500 efs \u2502   \u2502   \u251c\u2500\u2500 main.tf \u2502   \u2502   \u251c\u2500\u2500 output.tf \u2502   \u2502   \u2514\u2500\u2500 variables.tf \u2502   \u251c\u2500\u2500 eks \u2502   \u2502   \u251c\u2500\u2500 main.tf \u2502   \u2502   \u251c\u2500\u2500 output.tf \u2502   \u2502   \u2514\u2500\u2500 variables.tf ...omitted for brevity... \u2502   \u251c\u2500\u2500 vpc \u2502   \u2502   \u251c\u2500\u2500 main.tf \u2502   \u2502   \u251c\u2500\u2500 output.tf \u2502   \u2502   \u2514\u2500\u2500 variables.tf \u251c\u2500\u2500 prod \u2502   \u251c\u2500\u2500 efs.tf \u2502   \u251c\u2500\u2500 eks.tf ...omitted for brevity... \u2502   \u251c\u2500\u2500 vpc.tf \u251c\u2500\u2500 staging \u2502   \u251c\u2500\u2500 efs.tf \u2502   \u251c\u2500\u2500 eks.tf ...omitted for brevity... \u2502   \u251c\u2500\u2500 vpc.tf<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043c\u044b \u0434\u043e\u043b\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b AWS.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 Terragrunt \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\">$ tree . \u251c\u2500\u2500 README.md \u251c\u2500\u2500 atlantis.yaml \u251c\u2500\u2500 live \u2502   \u251c\u2500\u2500 account.hcl \u2502   \u2514\u2500\u2500 us-east-1 \u2502       \u251c\u2500\u2500 dev \u2502       \u2502   \u251c\u2500\u2500 efs \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u2502   \u251c\u2500\u2500 eks \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u2502   \u251c\u2500\u2500 env.hcl ...omitted for brevity... \u2502       \u2502   \u251c\u2500\u2500 vpc \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u251c\u2500\u2500 mgmt \u2502       \u2502   \u251c\u2500\u2500 env.hcl \u2502       \u2502   \u251c\u2500\u2500 vpc \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u251c\u2500\u2500 prod \u2502       \u2502   \u251c\u2500\u2500 efs \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u2502   \u251c\u2500\u2500 eks \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u2502   \u251c\u2500\u2500 env.hcl ...omitted for brevity... \u2502       \u2502   \u251c\u2500\u2500 vpc \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u251c\u2500\u2500 region.hcl \u2502       \u2514\u2500\u2500 staging \u2502       \u2502   \u251c\u2500\u2500 efs \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u2502   \u251c\u2500\u2500 eks \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u2502   \u251c\u2500\u2500 env.hcl ...omitted for brevity... \u2502       \u2502   \u251c\u2500\u2500 vpc \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2514\u2500\u2500 terragrunt.hcl<\/code><\/pre>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 Terragrunt  <\/h4>\n<p>\u041c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b VPC (\u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 AWS) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Terragrunt. \u041e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439: \u043c\u043e\u0434\u0443\u043b\u044c Terraform \u0438 \u043a\u043e\u0434 Terragrunt.<\/p>\n<p>\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c Terraform \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/terraform-aws-modules\/terraform-aws-vpc\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>. \u041d\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c.\u00a0<\/p>\n<p>\u041a\u043e\u0434 Terragrunt \u0442\u043e\u0436\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<pre><code class=\"bash\">.\/terragrunt.hcl .\/live\/account.hcl .\/live\/us-east-1\/region.hcl .\/live\/us-east-1\/dev\/env.hcl .\/live\/us-east-1\/prod\/env.hcl<\/code><\/pre>\n<p>\u0413\u0434\u0435 <code>.\/live\/us-east-1\/dev\/dev.hcl<\/code> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\"># Set common variables for the environment. # This is automatically pulled in in the root terragrunt.hcl configuration to # feed forward to the child modules. locals {   dev_region_vars = read_terragrunt_config(find_in_parent_folders(\"region.hcl\"))   # VPC VARIABLES   vpc_private_subnets_range = local.dev_region_vars.locals.dev_vpc_private_subnets_range   vpc_public_subnets_range  = local.dev_region_vars.locals.dev_vpc_public_subnets_range   vpc_azs                   = local.dev_region_vars.locals.dev_vpc_azs   vpc_cidr                  = local.dev_region_vars.locals.dev_vpc_cidr ...ommited for brevity... }<\/code><\/pre>\n<p>\u0410 <code>.\/live\/us-east-1\/region.hcl<\/code> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\"># Set common variables for the region. # This is automatically pulled in in the root terragrunt.hcl configuration to # configure the remote state bucket and pass forward to the child modules as inputs. locals {   aws_region = \"us-east-1\"      # DEV VPC   dev_vpc_private_subnets_range = [\"10.10.1.0\/24\", \"10.10.2.0\/24\",  \"10.10.3.0\/24\"]   dev_vpc_public_subnets_range  = [\"10.10.101.0\/24\",  \"10.10.102.0\/24\", \"10.10.103.0\/24\"]   dev_vpc_azs                   = [\"us-east-1a\", \"us-east-1b\", \"us-east-1c\"]   dev_vpc_cidr                  = \"10.10.0.0\/16\" ...ommited for brevity... }<\/code><\/pre>\n<p>\u0421\u0430\u043c \u043a\u043e\u0434 Terragrunt, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <code>.\/live\/us-east-1\/dev\/vpc\/terragrunt.hcl<\/code>:  <\/p>\n<pre><code class=\"bash\">locals {   # Load environment-wide variables   environment_vars = read_terragrunt_config(find_in_parent_folders(\"env.hcl\"))      # Extract needed variables for reuse   env = local.environment_vars.locals.environment   private_subnets_range = local.environment_vars.locals.vpc_private_subnets_range   public_subnets_range  = local.environment_vars.locals.vpc_public_subnets_range   azs                   = local.environment_vars.locals.vpc_azs   cidr                  = local.environment_vars.locals.vpc_cidr } # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the # working directory, into a temporary folder, and execute your Terraform commands in that folder. # If the terraform module is in the root directory make sure to set the `\/\/` before the branch or version. terraform {   source = \"git::git@your_git_repo.com:your_team\/terragrunt-module-vpc.git\/\/?ref=v1.0\" } # Include all settings from the root terragrunt.hcl file include {   path = find_in_parent_folders() } # These are the variables we have to pass in to use the module specified in the terragrunt configuration above inputs = {   env                   = \"${local.env}\"   private_subnets_range = \"${local.private_subnets_range}\"   public_subnets_range  = \"${local.public_subnets_range}\"   azs                   = \"${local.azs}\"   cidr                  = \"${local.cidr}\" }<\/code><\/pre>\n<h4>\u0418\u043c\u043f\u043e\u0440\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\u0437 Terraform \u0432 Terragrunt<\/h4>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0438\u0437 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u0442\u0435\u0439\u0442\u0430 Terraform \u0432 \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u0439\u0442 Terragrunt \u043d\u0443\u0436\u043d\u043e \u0432 \u0434\u0432\u0430 \u044d\u0442\u0430\u043f\u0430:<\/p>\n<p>\u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u0442\u0435\u0439\u0442 Terraform:<\/p>\n<pre><code class=\"bash\">$ terraform state list | grep vpc ...ommited for brevity... module.dev_vpc.module.vpc.aws_vpc.this[0] ...ommited for brevity...  $ terraform state show module.dev_vpc.module.vpc.aws_vpc.this\\[0\\] # module.dev_vpc.module.vpc.aws_vpc.this[0]: resource \"aws_vpc\" \"this\" {     arn                              = \"arn:aws:ec2:us-east- 1:YOUR_ACCOUNT_ID:vpc\/vpc-0123456789\" ...ommited for brevity...         id                               = \"vpc-0123456789\" ...ommited for brevity...     }<\/code><\/pre>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0435\u0439\u0442 \u0432 Terragrunt:<\/p>\n<pre><code class=\"bash\">$ terragrunt import module.vpc.aws_vpc.this\\[0\\] vpc-0123456789<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c VPC ID, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441 VPC \u0432 Terragrunt. \u0423 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 AWS \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u043e\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0433\u0440\u0443\u043f\u043f\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 <a href=\"https:\/\/registry.terraform.io\/providers\/hashicorp\/aws\/latest\/docs\/resources\/security_group_rule#examples\"><u>\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c<\/u><\/a>.<\/p>\n<h2>\u0420\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 Atlantis  <\/h2>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/www.runatlantis.io\/\"><u>Atlantis<\/u><\/a> \u0434\u043b\u044f <strong>\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0443\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u0432<\/strong>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u043f\u0443\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043b\u0430\u043d Terraform \u0432 \u0441\u0430\u043c\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u0438 \u044d\u0442\u043e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u042d\u0442\u043e, \u043a\u0441\u0442\u0430\u0442\u0438, \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435 <a href=\"https:\/\/www.runatlantis.io\/\"><u>\u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 Atlantis<\/u><\/a>.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Atlantis \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Terraform \u0438 Terragrunt \u043c\u043e\u0436\u043d\u043e \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e, \u043d\u043e \u043e\u043d \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u043d\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u043e \u043d\u0435\u043c.<\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Atlantis \u0434\u043b\u044f Terragrunt \u043c\u043e\u0436\u043d\u043e \u0432 \u0442\u0440\u0438 \u044d\u0442\u0430\u043f\u0430.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Terragrunt \u0441 Atlantis<\/h2>\n<h4>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437 Docker \u0441 \u043f\u0430\u043a\u0435\u0442\u043e\u043c Terragrunt<\/h4>\n<pre><code class=\"bash\">FROM runatlantis\/atlantis:latest  # Terragrunt version ARG TERRAGRUNT  ADD https:\/\/github.com\/gruntwork-io\/terragrunt\/releases\/download\/${TERRAGRUNT}\/terragrunt_linux_amd64  \/usr\/local\/bin\/terragrunt  RUN chmod +x \/usr\/local\/bin\/terragrunt<\/code><\/pre>\n<h4>\u0414\u0435\u043f\u043b\u043e\u0438\u043c Atlantis <\/h4>\n<p>\u041d\u0443\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0434\u0435\u043f\u043b\u043e\u0435 Atlantis. \u041c\u044b \u0434\u0435\u043f\u043b\u043e\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0441 <a href=\"https:\/\/helm.sh\/\"><u>Helm<\/u><\/a>.  <\/p>\n<pre><code class=\"bash\">$ helm inspect values stable\/atlantis > atlantis-values.yaml ... edit your file with the proper values ... $ helm install -f atlantis-values.yaml atlantis<\/code><\/pre>\n<h4>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c atlantis.yaml \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Terragrunt \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 Atlantis  <\/h4>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/github.com\/transcend-io\/terragrunt-atlantis-config\"><u>\u044d\u0442\u043e\u0442 \u0447\u0443\u0434\u0435\u0441\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442<\/u><\/a>, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e Atlantis \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438:<\/p>\n<pre><code class=\"bash\">$ terragrunt-atlantis-config generate --autoplan --parallel=false -- workflow terragrunt --root .\/ --output .\/atlantis.yaml  $ cat atlantis.yaml version: 3 automerge: false parallel_apply: false parallel_plan: false projects: - autoplan:     enabled: true     when_modified:     - '*.hcl'     - '*.tf*'   dir: .\/live\/us-east-1\/dev\/vpc   workflow: terragrunt workflows:   terragrunt:     plan:       steps:       - run: \/usr\/local\/bin\/terragrunt plan -no-color -out $PLANFILE     apply:       steps:       - run: \/usr\/local\/bin\/terragrunt apply -no-color $PLANFILE<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430 <code>atlantis.yaml<\/code>, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0447\u0442\u043e\u0431\u044b Atlantis \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u044b Terragrunt. \u041c\u044b \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438. \u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e Atlantis <a href=\"https:\/\/www.runatlantis.io\/docs\/custom-workflows.html#terragrunt\"><u>\u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b<\/u><\/a>.<\/p>\n<h4>\u0420\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 Atlantis  <\/h4>\n<h4>\u0420\u0430\u043d\u044c\u0448\u0435\u2026  <\/h4>\n<p>\u041c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b Terraform plan \u0438 apply \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e. \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u043d\u0435 \u0432\u0438\u0434\u0435\u043b\u0438, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u041a\u0440\u043e\u043c\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0443\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0430. \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u0435 \u0438\u043b\u0438 \u0432 Slack, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u043c\u043e\u0433\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>\u042d\u0442\u043e \u0431\u044b\u043b\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438 \u043d\u0435\u043d\u0430\u0434\u0435\u0436\u043d\u043e.<\/p>\n<h4>\u0421\u0435\u0439\u0447\u0430\u0441\u2026  <\/h4>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043c\u0430\u0433\u0438\u044e Atlantis, \u043c\u044b \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043c\u0435\u0439\u043b\u043e\u0432 \u0441 \u0441\u043e\u0442\u043d\u044f\u043c\u0438 \u0441\u0442\u0440\u043e\u043a \u0438\u043b\u0438 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0441\u043d\u0438\u043f\u043f\u0435\u0442\u043e\u0432 \u0432 Slack.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435 \u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u0435\u0435.<\/p>\n<p>\u0421 Atlantis \u043a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 plan \u0438\u043b\u0438 apply \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0443\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0435. \u0412\u043e\u0442 \u043a\u0430\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0443 \u043d\u0430\u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ad4\/a38\/155\/ad4a3815598773c8212dda5319e31be4.png\" alt=\"https:\/\/miro.medium.com\/max\/700\/1*f5dHQD0avGNou_aT37WFUg.png\" title=\"https:\/\/miro.medium.com\/max\/700\/1*f5dHQD0avGNou_aT37WFUg.png\" width=\"700\" height=\"145\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ad4\/a38\/155\/ad4a3815598773c8212dda5319e31be4.png\"\/><figcaption>https:\/\/miro.medium.com\/max\/700\/1*f5dHQD0avGNou_aT37WFUg.png<\/figcaption><\/figure>\n<h2>\u0417\u0430\u043c\u0438\u043d\u043a\u0438 \u043f\u0440\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438  <\/h2>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442 \u0441\u0442\u0435\u0439\u0442\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0432 Terragrunt \u043d\u0435 \u043e\u0431\u043e\u0448\u0435\u043b\u0441\u044f \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443 Terragrunt \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0438\u0445 \u0440\u0435\u0448\u0438\u0442\u044c. \u041d\u0438\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c.  <\/p>\n<h4>\u0413\u0440\u0443\u043f\u043f\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438  <\/h4>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f <code>aws_security_group<\/code>, \u0438 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u043f\u0440\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0435. Terragrunt\/Terraform \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 <code>aws_security_group_rule<\/code>, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0435\u0449\u0435 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/registry.terraform.io\/providers\/hashicorp\/aws\/latest\/docs\/resources\/security_group_rule#example-usage\"><u>\u044d\u0442\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/u><\/a>. \u0427\u0442\u043e\u0431\u044b \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043f\u043e\u0441\u043b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0433\u0440\u0443\u043f\u043f\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043c\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0443\u0434\u0430\u043b\u0438\u043b\u0438 \u043a\u0430\u0436\u0434\u043e\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e <code>aws_security_group_rule<\/code>.  <\/p>\n<pre><code class=\"bash\">$ terragrunt state rm module.sg.aws_security_group_rule.workers-1\\[0\\] $ terragrunt state rm module.sg.aws_security_group_rule.workers-1\\[1\\] $ terragrunt state rm module.sg.aws_security_group_rule.workers-1\\[2\\] ...<\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u0433\u0440\u0443\u043f\u043f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u0441\u0442\u0430\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 <a href=\"https:\/\/registry.terraform.io\/modules\/terraform-aws-modules\/security-group\/aws\/2.4.0\/submodules\/ssh\"><u>\u043c\u043e\u0434\u0443\u043b\u044c Terraform<\/u><\/a>, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<h4>\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432  <\/h4>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, Terragrunt \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u043e\u0440\u043e\u0432\u0438\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0441\u043d\u043e\u0432\u0430, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0442\u0435\u0439\u0442\u0430 (Terragrunt \u0438 Terraform). \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0445:<\/p>\n<p>Terragrunt:<\/p>\n<pre><code class=\"bash\">$ cd \/src\/bestmile\/terragrunt\/live\/us-east-1\/dev\/some_module $ terragrunt state pull > state.json<\/code><\/pre>\n<p>Terraform:  <\/p>\n<pre><code class=\"bash\">$ cd \/src\/bestmile\/terraform\/some_module $ terraform state pull > state.json<\/code><\/pre>\n<p>\u041c\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438, \u0447\u0442\u043e \u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0435 \u0431\u044b\u043b \u0437\u0430\u0434\u0430\u043d <code>name_prefix<\/code> \u0432 \u0441\u0442\u0435\u0439\u0442\u0435 Terragrunt. <\/p>\n<blockquote>\n<p>\u0412\u0441\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e!<\/p>\n<\/blockquote>\n<p>\u0412\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>name_prefix<\/code> \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0441\u0442\u0435\u0439\u0442\u043e\u043c Terraform.<\/p>\n<p>\u041c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0435\u0439\u0442\u0435 Terragrunt, \u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0435\u0439\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0431\u044d\u043a\u0435\u043d\u0434 Terragrunt (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0431\u044b\u043b\u0438 \u0431\u0430\u043a\u0435\u0442\u044b S3), \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0438 \u0443\u0447\u0442\u0435\u043d\u044b \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b terragrunt plan.<\/p>\n<pre><code class=\"bash\">terragrunt state push state.json<\/code><\/pre>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u0442\u0435\u0439\u0442\u0430 Terragrunt \u043f\u0440\u0438\u0432\u0435\u043b\u0430 \u043a \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043a\u0435.  <\/p>\n<h4>\u041d\u0435 \u0443\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0435\u0439\u0442 Terragrunt <\/h4>\n<p>\u0412 \u0441\u0442\u0435\u0439\u0442\u0435 Terragrunt \u0435\u0441\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u044b\u0439 \u043d\u043e\u043c\u0435\u0440. \u0423\u0432\u0435\u043b\u0438\u0447\u044c\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 1, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0439 \u0441\u0442\u0435\u0439\u0442 Terragrunt. (<a href=\"https:\/\/www.terraform.io\/docs\/backends\/state.html#manual-state-pull-push\"><u>\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/u><\/a>)<\/p>\n<h4>\u0421\u043b\u043e\u0436\u043d\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u043d\u0435 \u043f\u043e ID<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0436\u0438\u0437\u043d\u044c, \u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Terraform.<\/p>\n<p>\u0412\u043e\u0442 \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438:<\/p>\n<pre><code class=\"bash\">$ python tg_import.py -e dev -r vpc terragrunt import module.vpc.aws_eip.nat[0] eip-nat-id-1234567890 terragrunt import module.vpc.aws_internet_gateway.this[0] igw-id-1234567890 terragrunt import module.vpc.aws_nat_gateway.this[0] nat-gw-1234567890 terragrunt import module.vpc.aws_route.private_nat_gateway[0] rt-pv-1234567890 terragrunt import module.vpc.aws_route.public_internet_gateway[0] rt-pub-1234567890 terragrunt import module.vpc.aws_route_table.private[0] rt-tb-pv-1234567890 terragrunt import module.vpc.aws_route_table.public[0] rt-tb-pub-1234567890 terragrunt import module.vpc.aws_route_table_association.private[0] tassoc-pv-1234567890 terragrunt import module.vpc.aws_route_table_association.public[0] tassoc-pub-1234567890 terragrunt import module.vpc.aws_subnet.private[0] subnet-1234567890 terragrunt import module.vpc.aws_subnet.public[0] subnet-9876543210 terragrunt import module.vpc.aws_vpc.this[0] vpc-1234567890<\/code><\/pre>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0414\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 Terragrunt \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u043c\u0430\u043b\u043e \u0441\u0438\u043b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0418\u0433\u0440\u0430 \u0441\u0442\u043e\u0438\u043b\u0430 \u0441\u0432\u0435\u0447?<\/p>\n<blockquote>\n<p><strong>\u0414\u0410!<\/strong><\/p>\n<\/blockquote>\n<p>\u041d\u0430\u0448\u0438 \u0443\u0441\u0438\u043b\u0438\u044f \u043f\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 Terraform \u0432 Terragrunt \u0431\u044b\u043b\u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0442\u0435\u0439\u0442\u0430 Terraform \u0432 \u0441\u0442\u0435\u0439\u0442 Terragrunt.<\/p>\n<p>\u041e\u0434\u043d\u043e \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u00a0\u2014 \u043c\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u0438, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043b\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u041a\u043e\u0434 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441 Terragrunt \u043c\u044b \u043f\u0440\u0438\u0447\u0435\u0441\u0430\u043b\u0438 \u0431\u0430\u0437\u0443 \u043a\u043e\u0434\u0430 \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c <a href=\"https:\/\/terragrunt.gruntwork.io\/docs\/features\/keep-your-terraform-code-dry\/\"><u>DRY<\/u><\/a>.<\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0448 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 git \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u043c \u0437\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0430\u043f\u043e\u043a. \u0421 \u0442\u0430\u043a\u0438\u043c \u043c\u043d\u043e\u0433\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u043c\u044b \u043d\u0430\u0432\u0435\u043b\u0438 \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a. \u041b\u044e\u0431\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435\u0437\u043d\u0430\u043a\u043e\u043c \u0441 Terragrunt, \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0432 \u0443\u0440\u043e\u0432\u043d\u044f\u0445 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b Bestmile.<\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u00a0\u2014 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438. \u041a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435, \u043c\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u043d\u0430\u043a\u0430\u0442\u0430. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e \u0432 \u0441\u0440\u0435\u0434\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0434\u0432\u0438\u0433\u0430\u0435\u043c \u0435\u0435 \u0434\u0430\u043b\u044c\u0448\u0435 \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/570406\/\"> https:\/\/habr.com\/ru\/articles\/570406\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption>https:\/\/miro.medium.com\/max\/700\/1*FnD69VqaPYSOaKzTUb_njw.jpeg<\/figcaption><\/figure>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 <a href=\"https:\/\/bestmile.com\/\"><u>Bestmile<\/u><\/a> \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/www.terraform.io\/\"><u>Terraform<\/u><\/a> \u0434\u043b\u044f AWS IaC. \u041d\u043e \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0430\u0448\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u0435\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043a\u043e\u0434 Terraform.<\/p>\n<p>\u041a\u043e\u0434 Terraform \u0441\u0442\u0430\u043b\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c. \u041e\u043d \u0442\u0435\u0440\u044f\u043b \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c.Terraform\u00a0\u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043d\u043e \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\u0445. \u0417\u0434\u0435\u0441\u044c-\u0442\u043e \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f Terragrunt.<\/p>\n<p>Terragrunt\u00a0\u2014 \u044d\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430 (wrapper) \u0434\u043b\u044f Terraform, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f.\u00a0<a href=\"https:\/\/terragrunt.gruntwork.io\/\"><u>Terragrunt<\/u><\/a> \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 Terraform \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0434\u0430 HCL (<a href=\"https:\/\/github.com\/hashicorp\/hcl\"><u>HashiCorp Configuration Language<\/u><\/a>), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 Terragrunt \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043e\u0434 Terraform \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435 \u043a\u043e\u0434 HCL. \u0418\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u0434\u0430\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0438\u0436\u0435, \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 Terragrunt \u0432 \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442.<\/p>\n<h4>\u0427\u0435\u0433\u043e \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c Terraform<\/h4>\n<p>\u0412 Terraform <strong>\u043d\u0435\u0442<\/strong> <strong>\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438<\/strong>: \u0434\u0432\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0412 Terragrunt \u0435\u0441\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>dependencies<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p><strong>\u041d\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a<\/strong> \u0434\u043b\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a: \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 Terraform \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c, \u043f\u0440\u043e\u0441\u0442\u043e \u0435\u0449\u0435 \u0440\u0430\u0437 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <em>apply<\/em>.<\/p>\n<p><strong>\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/strong> <strong>\u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u044e<\/strong> \u043c\u043e\u0434\u0443\u043b\u044f Terraform \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445, \u0435\u0441\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c VPC Terraform. \u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u0438 \u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u043c. Terragrunt \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0442\u043a\u0438 \u0438\u043b\u0438 \u0442\u0435\u0433\u0430 \u0434\u043b\u044f \u0434\u0435\u043f\u043b\u043e\u044f.<\/p>\n<p>\u0412 Terraform <strong>\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c<\/strong> <strong>\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445 \u043f\u0440\u0438\u043d\u0446\u0438\u043f DRY<\/strong> \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445 (\u0431\u0430\u043a\u0435\u0442 S3, \u0440\u0435\u0433\u0438\u043e\u043d, \u0442\u0430\u0431\u043b\u0438\u0446\u0430 DynamoDB \u0438 \u0442.\u00a0\u0434.)\u00a0\u2014 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b (EKS, S3, IAM, MSK&#8230;) \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0431\u044d\u043a\u0435\u043d\u0434-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e Terraform. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b SRE. Terragrunt \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>path_relative_to_include()<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043a\u043e\u0434\u0430 Terraform \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e, \u0435\u0433\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u043e \u043f\u0430\u043f\u043a\u0430\u043c. \u0412 Terraform \u043f\u0440\u043e\u0441\u0442\u043e <strong>\u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/strong> plan \u0438\u043b\u0438 apply \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0430\u043f\u043e\u043a. \u0412 Terragrunt \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c plan-all \u0438 apply-all.<\/p>\n<blockquote>\n<p>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0443.<br \/>\u041c\u043d\u0435 \u043d\u0435 \u0440\u0430\u0437 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043b\u044e\u0434\u044f\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0422\u0435\u0440\u0440\u0430\u0444\u043e\u0440\u043c \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0418 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0440\u0435\u0447\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e \u0434\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043e\u0431\u0430 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0435: \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430 \u043f\u0430\u043f\u043a\u0438 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0432 \u0434\u0435\u043f\u043b\u043e\u0435. \u0422\u0435\u0440\u0440\u0430\u0433\u0440\u0430\u043d\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043e\u0431\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0422\u0435\u0440\u0440\u0430\u0444\u043e\u0440\u043c\u0430 \u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. <em>\u041f\u0430\u0432\u0435\u043b \u0417\u0430\u043c\u043e\u0448\u0438\u043d, \u0430\u0432\u0442\u043e\u0440 <\/em><a href=\"https:\/\/slurm.club\/2Vugw1E\"><em>\u043a\u0443\u0440\u0441\u043e\u0432 \u0421\u043b\u0451\u0440\u043c \u043f\u043e Terraform<\/em><\/a><em>, Site Reliability Engineer \u0432 Malwarebytes.<\/em><\/p>\n<\/blockquote>\n<figure class=\"\"><figcaption>https:\/\/xkcd.com\/303\/<\/figcaption><\/figure>\n<h2>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/h2>\n<h4>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 Terraform \u0432 Terragrunt<\/h4>\n<p>\u0414\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 Terragrunt \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u044b\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 Terraform, \u043d\u043e \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043d\u0430\u0447\u0430\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Terraform:<\/p>\n<pre><code class=\"bash\">$ tree . \u251c\u2500\u2500 dev \u2502   \u251c\u2500\u2500 efs.tf \u2502   \u251c\u2500\u2500 eks.tf ...omitted for brevity... \u2502   \u251c\u2500\u2500 vpc.tf \u251c\u2500\u2500 mgmt \u2502   \u251c\u2500\u2500 eks.tf \u2502   \u251c\u2500\u2500 mgmt.tf \u2502   \u251c\u2500\u2500 outputs.tf \u251c\u2500\u2500 modules \u2502   \u251c\u2500\u2500 efs \u2502   \u2502   \u251c\u2500\u2500 main.tf \u2502   \u2502   \u251c\u2500\u2500 output.tf \u2502   \u2502   \u2514\u2500\u2500 variables.tf \u2502   \u251c\u2500\u2500 eks \u2502   \u2502   \u251c\u2500\u2500 main.tf \u2502   \u2502   \u251c\u2500\u2500 output.tf \u2502   \u2502   \u2514\u2500\u2500 variables.tf ...omitted for brevity... \u2502   \u251c\u2500\u2500 vpc \u2502   \u2502   \u251c\u2500\u2500 main.tf \u2502   \u2502   \u251c\u2500\u2500 output.tf \u2502   \u2502   \u2514\u2500\u2500 variables.tf \u251c\u2500\u2500 prod \u2502   \u251c\u2500\u2500 efs.tf \u2502   \u251c\u2500\u2500 eks.tf ...omitted for brevity... \u2502   \u251c\u2500\u2500 vpc.tf \u251c\u2500\u2500 staging \u2502   \u251c\u2500\u2500 efs.tf \u2502   \u251c\u2500\u2500 eks.tf ...omitted for brevity... \u2502   \u251c\u2500\u2500 vpc.tf<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043c\u044b \u0434\u043e\u043b\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b AWS.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 Terragrunt \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\">$ tree . \u251c\u2500\u2500 README.md \u251c\u2500\u2500 atlantis.yaml \u251c\u2500\u2500 live \u2502   \u251c\u2500\u2500 account.hcl \u2502   \u2514\u2500\u2500 us-east-1 \u2502       \u251c\u2500\u2500 dev \u2502       \u2502   \u251c\u2500\u2500 efs \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u2502   \u251c\u2500\u2500 eks \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u2502   \u251c\u2500\u2500 env.hcl ...omitted for brevity... \u2502       \u2502   \u251c\u2500\u2500 vpc \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u251c\u2500\u2500 mgmt \u2502       \u2502   \u251c\u2500\u2500 env.hcl \u2502       \u2502   \u251c\u2500\u2500 vpc \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u251c\u2500\u2500 prod \u2502       \u2502   \u251c\u2500\u2500 efs \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u2502   \u251c\u2500\u2500 eks \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u2502   \u251c\u2500\u2500 env.hcl ...omitted for brevity... \u2502       \u2502   \u251c\u2500\u2500 vpc \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u251c\u2500\u2500 region.hcl \u2502       \u2514\u2500\u2500 staging \u2502       \u2502   \u251c\u2500\u2500 efs \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u2502   \u251c\u2500\u2500 eks \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2502       \u2502   \u251c\u2500\u2500 env.hcl ...omitted for brevity... \u2502       \u2502   \u251c\u2500\u2500 vpc \u2502       \u2502   \u2502   \u2514\u2500\u2500 terragrunt.hcl \u2514\u2500\u2500 terragrunt.hcl<\/code><\/pre>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 Terragrunt  <\/h4>\n<p>\u041c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b VPC (\u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 AWS) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Terragrunt. \u041e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439: \u043c\u043e\u0434\u0443\u043b\u044c Terraform \u0438 \u043a\u043e\u0434 Terragrunt.<\/p>\n<p>\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c Terraform \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/terraform-aws-modules\/terraform-aws-vpc\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>. \u041d\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c.\u00a0<\/p>\n<p>\u041a\u043e\u0434 Terragrunt \u0442\u043e\u0436\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<pre><code class=\"bash\">.\/terragrunt.hcl .\/live\/account.hcl .\/live\/us-east-1\/region.hcl .\/live\/us-east-1\/dev\/env.hcl .\/live\/us-east-1\/prod\/env.hcl<\/code><\/pre>\n<p>\u0413\u0434\u0435 <code>.\/live\/us-east-1\/dev\/dev.hcl<\/code> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\"># Set common variables for the environment. # This is automatically pulled in in the root terragrunt.hcl configuration to # feed forward to the child modules. locals {   dev_region_vars = read_terragrunt_config(find_in_parent_folders(\"region.hcl\"))   # VPC VARIABLES   vpc_private_subnets_range = local.dev_region_vars.locals.dev_vpc_private_subnets_range   vpc_public_subnets_range  = local.dev_region_vars.locals.dev_vpc_public_subnets_range   vpc_azs                   = local.dev_region_vars.locals.dev_vpc_azs   vpc_cidr                  = local.dev_region_vars.locals.dev_vpc_cidr ...ommited for brevity... }<\/code><\/pre>\n<p>\u0410 <code>.\/live\/us-east-1\/region.hcl<\/code> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\"># Set common variables for the region. # This is automatically pulled in in the root terragrunt.hcl configuration to # configure the remote state bucket and pass forward to the child modules as inputs. locals {   aws_region = \"us-east-1\"      # DEV VPC   dev_vpc_private_subnets_range = [\"10.10.1.0\/24\", \"10.10.2.0\/24\",  \"10.10.3.0\/24\"]   dev_vpc_public_subnets_range  = [\"10.10.101.0\/24\",  \"10.10.102.0\/24\", \"10.10.103.0\/24\"]   dev_vpc_azs                   = [\"us-east-1a\", \"us-east-1b\", \"us-east-1c\"]   dev_vpc_cidr                  = \"10.10.0.0\/16\" ...ommited for brevity... }<\/code><\/pre>\n<p>\u0421\u0430\u043c \u043a\u043e\u0434 Terragrunt, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <code>.\/live\/us-east-1\/dev\/vpc\/terragrunt.hcl<\/code>:  <\/p>\n<pre><code class=\"bash\">locals {   # Load environment-wide variables   environment_vars = read_terragrunt_config(find_in_parent_folders(\"env.hcl\"))      # Extract needed variables for reuse   env = local.environment_vars.locals.environment   private_subnets_range = local.environment_vars.locals.vpc_private_subnets_range   public_subnets_range  = local.environment_vars.locals.vpc_public_subnets_range   azs                   = local.environment_vars.locals.vpc_azs   cidr                  = local.environment_vars.locals.vpc_cidr } # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the # working directory, into a temporary folder, and execute your Terraform commands in that folder. # If the terraform module is in the root directory make sure to set the `\/\/` before the branch or version. terraform {   source = \"git::git@your_git_repo.com:your_team\/terragrunt-module-vpc.git\/\/?ref=v1.0\" } # Include all settings from the root terragrunt.hcl file include {   path = find_in_parent_folders() } # These are the variables we have to pass in to use the module specified in the terragrunt configuration above inputs = {   env                   = \"${local.env}\"   private_subnets_range = \"${local.private_subnets_range}\"   public_subnets_range  = \"${local.public_subnets_range}\"   azs                   = \"${local.azs}\"   cidr                  = \"${local.cidr}\" }<\/code><\/pre>\n<h4>\u0418\u043c\u043f\u043e\u0440\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\u0437 Terraform \u0432 Terragrunt<\/h4>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0438\u0437 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u0442\u0435\u0439\u0442\u0430 Terraform \u0432 \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u0439\u0442 Terragrunt \u043d\u0443\u0436\u043d\u043e \u0432 \u0434\u0432\u0430 \u044d\u0442\u0430\u043f\u0430:<\/p>\n<p>\u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u0442\u0435\u0439\u0442 Terraform:<\/p>\n<pre><code class=\"bash\">$ terraform state list | grep vpc ...ommited for brevity... module.dev_vpc.module.vpc.aws_vpc.this[0] ...ommited for brevity...  $ terraform state show module.dev_vpc.module.vpc.aws_vpc.this\\[0\\] # module.dev_vpc.module.vpc.aws_vpc.this[0]: resource \"aws_vpc\" \"this\" {     arn                              = \"arn:aws:ec2:us-east- 1:YOUR_ACCOUNT_ID:vpc\/vpc-0123456789\" ...ommited for brevity...         id                               = \"vpc-0123456789\" ...ommited for brevity...     }<\/code><\/pre>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0435\u0439\u0442 \u0432 Terragrunt:<\/p>\n<pre><code class=\"bash\">$ terragrunt import module.vpc.aws_vpc.this\\[0\\] vpc-0123456789<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c VPC ID, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441 VPC \u0432 Terragrunt. \u0423 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 AWS \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u043e\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0433\u0440\u0443\u043f\u043f\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 <a href=\"https:\/\/registry.terraform.io\/providers\/hashicorp\/aws\/latest\/docs\/resources\/security_group_rule#examples\"><u>\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c<\/u><\/a>.<\/p>\n<h2>\u0420\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 Atlantis  <\/h2>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/www.runatlantis.io\/\"><u>Atlantis<\/u><\/a> \u0434\u043b\u044f <strong>\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0443\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u0432<\/strong>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u043f\u0443\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043b\u0430\u043d Terraform \u0432 \u0441\u0430\u043c\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u0438 \u044d\u0442\u043e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u042d\u0442\u043e, \u043a\u0441\u0442\u0430\u0442\u0438, \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435 <a href=\"https:\/\/www.runatlantis.io\/\"><u>\u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 Atlantis<\/u><\/a>.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Atlantis \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Terraform \u0438 Terragrunt \u043c\u043e\u0436\u043d\u043e \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e, \u043d\u043e \u043e\u043d \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u043d\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u043e \u043d\u0435\u043c.<\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Atlantis \u0434\u043b\u044f Terragrunt \u043c\u043e\u0436\u043d\u043e \u0432 \u0442\u0440\u0438 \u044d\u0442\u0430\u043f\u0430.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Terragrunt \u0441 Atlantis<\/h2>\n<h4>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437 Docker \u0441 \u043f\u0430\u043a\u0435\u0442\u043e\u043c Terragrunt<\/h4>\n<pre><code class=\"bash\">FROM runatlantis\/atlantis:latest  # Terragrunt version ARG TERRAGRUNT  ADD https:\/\/github.com\/gruntwork-io\/terragrunt\/releases\/download\/${TERRAGRUNT}\/terragrunt_linux_amd64  \/usr\/local\/bin\/terragrunt  RUN chmod +x \/usr\/local\/bin\/terragrunt<\/code><\/pre>\n<h4>\u0414\u0435\u043f\u043b\u043e\u0438\u043c Atlantis <\/h4>\n<p>\u041d\u0443\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0434\u0435\u043f\u043b\u043e\u0435 Atlantis. \u041c\u044b \u0434\u0435\u043f\u043b\u043e\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0441 <a href=\"https:\/\/helm.sh\/\"><u>Helm<\/u><\/a>.  <\/p>\n<pre><code class=\"bash\">$ helm inspect values stable\/atlantis > atlantis-values.yaml ... edit your file with the proper values ... $ helm install -f atlantis-values.yaml atlantis<\/code><\/pre>\n<h4>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c atlantis.yaml \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Terragrunt \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 Atlantis  <\/h4>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/github.com\/transcend-io\/terragrunt-atlantis-config\"><u>\u044d\u0442\u043e\u0442 \u0447\u0443\u0434\u0435\u0441\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442<\/u><\/a>, \u0447\u0442\u043e\u0431\u044b<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-405420","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/405420","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=405420"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/405420\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=405420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=405420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=405420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}