{"id":348125,"date":"2023-05-30T21:00:57","date_gmt":"2023-05-30T21:00:57","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=348125"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=348125","title":{"rendered":"<span>Infrastructure as a Code: \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div class=\"persona\" persona=\"true\"><img decoding=\"async\" persona=\"true\" class=\"image persona__image\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/410\/c95\/7bf\/410c957bf422743e4b0ae4f6c5b3ec55.png\"><\/p>\n<h5 class=\"persona__heading\" persona=\"true\">\u0418\u0433\u043e\u0440\u044c \u0422\u0438\u0443\u043d\u043e\u0432<\/h5>\n<p>SRE \u0432 Yandex \u0438 \u0430\u0432\u0442\u043e\u0440 \u043d\u0430 \u043a\u0443\u0440\u0441\u0435 <a href=\"https:\/\/practicum.yandex.ru\/devops\/?utm_source=pr&amp;utm_medium=content&amp;utm_campaign=pr_content_devops-course_habr&amp;utm_content=30_05_23\">\u00abDevOps \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00bb<\/a>.<\/p>\n<\/div>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/169\/437\/368\/169437368d9694594f49019b22725038.png\" width=\"2800\" height=\"1714\"><\/figure>\n<p>\u0415\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0440\u0435\u0431\u044f\u0442\u0430 \u2014 SRE (\u0441 \u0430\u043d\u0433\u043b. Site Reliability Engineering), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0440\u043e\u0441\u043b\u0438 \u0438\u0437 \u0441\u0442\u0430\u0440\u044b\u0445 \u0434\u043e\u0431\u0440\u044b\u0445 \u0438 \u0431\u043e\u0440\u043e\u0434\u0430\u0442\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u041d\u043e \u043e\u043d\u0438 \u0443\u0441\u0442\u0430\u043b\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0439 \u0440\u0443\u0442\u0438\u043d\u043e\u0439 \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u0432\u0441\u0451 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 50% \u0432\u0440\u0435\u043c\u0435\u043d\u0438 SRE \u043f\u0438\u0448\u0443\u0442 \u043a\u043e\u0434.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d78\/6fd\/b23\/d786fdb23693bdcd3f5cd739c67a6f62.png\" width=\"2800\" height=\"1458\"><\/figure>\n<p>\u041d\u0435 \u0441\u043f\u0435\u0448\u0438\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043a\u043e \u0432\u0441\u0435\u043c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c SRE, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043e\u043d\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u044b, \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u044f\u0442 Kubernetes \u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442 JSON \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043e\u043d\u0438 \u0441\u0442\u0440\u0435\u043c\u044f\u0442\u0441\u044f \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u0434\u0430: \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u0443\u0442\u0438\u043b\u0438\u0442, \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u043e\u0432 \u0438 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u043e\u0432.  <\/p>\n<p>\u0410 \u0432\u0435\u0434\u044c \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043a\u043e\u0434\u0430 \u0441\u0442\u0430\u043d\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e, \u0438 \u0435\u0433\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0447\u0438\u0442\u0430\u0442\u044c, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c. \u041c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0435\u0451 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f. \u0417\u0430\u0442\u043e \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0443\u0442!<\/p>\n<blockquote>\n<p><strong>\u0420\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c<\/strong> \u2014 \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043a\u043e\u0434\u0430 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c.<\/p>\n<\/blockquote>\n<p>\u0423 \u0440\u0435\u0431\u044f\u0442 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b SRE \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043e\u0431\u044a\u0451\u043c \u043a\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u044b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0418 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u2014 \u044d\u0442\u043e Terraform. \u0416\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e T\u0435rraform-\u043a\u043e\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0438 \u0442\u0443\u0442 \u043d\u0435\u0442 \u00ab\u0432\u043e\u043b\u0448\u0435\u0431\u043d\u043e\u0439 \u043f\u0438\u043b\u044e\u043b\u0438\u00bb \u0438 \u0441\u0442\u0440\u043e\u0433\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b.<\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 IaaC-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f (Infrastructure as a Code) \u0434\u043b\u044f Terraform \u0438 \u043d\u0430\u0447\u043d\u0451\u043c \u0441 \u0432\u0440\u0435\u0434\u043d\u044b\u0445 \u0441\u043e\u0432\u0435\u0442\u043e\u0432.<\/p>\n<h3>\u041d\u0438\u0447\u0442\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u0432\u0435\u0449\u0430\u043b\u043e \u0431\u0435\u0434\u044b  <\/h3>\n<p>\u041d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0435 \u0441\u0432\u043e\u044e \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u0432 Terraform-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430. <\/p>\n<blockquote>\n<p><strong>\u0420\u0435\u0441\u0443\u0440\u0441\u043e\u043c \u0432 Terraform<\/strong> \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u043b\u043e\u043a, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435: \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430, \u0441\u0435\u0442\u044c \u0438\u043b\u0438 DNS-\u0437\u0430\u043f\u0438\u0441\u044c.<\/p>\n<\/blockquote>\n<p>\u0417\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Terraform-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0434\u043b\u044f Yandex Cloud.<\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432 \u0444\u0430\u0439\u043b\u0435-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 <code>compute.tf<\/code> \u0443 \u0432\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<\/p>\n<h4>compute.tf  <\/h4>\n<pre><code class=\"javascript\">resource \"yandex_compute_instance\" \"default\" {   name        = \"test\"   platform_id = \"standard-v1\"   zone        = \"ru-central1-a\"    resources {     cores  = 2     memory = 4   }    boot_disk {     initialize_params {       image_id = \"image_id\"     }   }    network_interface {     subnet_id = \"${yandex_vpc_subnet.foo.id}\"   }    metadata = {     foo      = \"bar\"     ssh-keys = \"ubuntu:${file(\"~\/.ssh\/id_rsa.pub\")}\"   } }<\/code><\/pre>\n<p>\u0425\u043e\u0442\u044f \u043d\u0435\u0442. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c VPC \u0438 \u043f\u043e\u0434\u0441\u0435\u0442\u044c: \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u044d\u0442\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0432 \u0444\u0430\u0439\u043b\u0435 <code>network.tf<\/code>.<\/p>\n<h4>network.tf  <\/h4>\n<pre><code class=\"javascript\">resource \"yandex_vpc_network\" \"foo\" {}  resource \"yandex_vpc_subnet\" \"foo\" {   zone           = \"ru-central1-a\"   network_id     = \"${yandex_vpc_network.foo.id}\"   v4_cidr_blocks = [\"10.5.0.0\/24\"] }<\/code><\/pre>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Kubernetes-\u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>k8s.tf<\/code>:  <\/p>\n<h4>k8s.tf  <\/h4>\n<pre><code class=\"javascript\">resource \"yandex_kubernetes_cluster\" \"my_cluster\" {   name        = \"name\"   description = \"description\"    network_id = \"${yandex_vpc_network.network_resource_name.id}\"    master {     version = \"1.17\"     zonal {       zone      = \"${yandex_vpc_subnet.foo.zone}\"       subnet_id = \"${yandex_vpc_subnet.foo.id}\"     }      public_ip = true      security_group_ids = [\"${yandex_vpc_security_group.security_group_name.id}\"]      maintenance_policy {       auto_upgrade = true        maintenance_window {         start_time = \"15:00\"         duration   = \"3h\"       }     }      master_logging {       enabled = true       log_group_id = \"${yandex_logging_group.log_group_resoruce_name.id}\"       kube_apiserver_enabled = true       cluster_autoscaler_enabled = true       events_enabled = true     }   }    service_account_id      = \"${yandex_iam_service_account.service_account_resource_name.id}\"   node_service_account_id = \"${yandex_iam_service_account.node_service_account_resource_name.id}\"    labels = {     my_key       = \"my_value\"     my_other_key = \"my_other_value\"   }    release_channel = \"RAPID\"   network_policy_provider = \"CALICO\"    kms_provider {     key_id = \"${yandex_kms_symmetric_key.kms_key_resource_name.id}\"   } }<\/code><\/pre>\n<p> \u0418 \u0441\u044e\u0434\u0430 \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u043e\u0434-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. \u0418\u043b\u0438 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0434\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>k8s-nodes.tf<\/code>, \u0432\u0435\u0434\u044c \u0431\u044b\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0433\u0440\u0443\u043f\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0439\u0442\u0438:<\/p>\n<h4>k8s-nodes.tf<\/h4>\n<pre><code class=\"javascript\">resource \"yandex_kubernetes_node_group\" \"my_node_group\" {   cluster_id  = \"${yandex_kubernetes_cluster.my_cluster.id}\"   name        = \"name\"   description = \"description\"   version     = \"1.22\"    labels = {     \"key\" = \"value\"   }    instance_template {     platform_id = \"standard-v2\"      network_interface {       nat                = true       subnet_ids         = [\"${yandex_vpc_subnet.foo.id}\"]     }      resources {       memory = 2       cores  = 2     }      boot_disk {       type = \"network-hdd\"       size = 64     }      scheduling_policy {       preemptible = false     }      container_runtime {       type = \"containerd\"     }   }    scale_policy {     fixed_scale {       size = 1     }   }    allocation_policy {     location {       zone = \"ru-central1-a\"     }   }    maintenance_policy {     auto_upgrade = true     auto_repair  = true      maintenance_window {       day        = \"monday\"       start_time = \"15:00\"       duration   = \"3h\"     }      maintenance_window {       day        = \"friday\"       start_time = \"10:00\"       duration   = \"4h30m\"     }   } }<\/code><\/pre>\n<p>\u041d\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d \u0443 \u043d\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0433\u043e, \u0434\u0430 \u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432 K8s \u0442\u043e\u0436\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0438\u0445 \u043d\u0435 \u043f\u043e \u0442\u0438\u043f\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u0430, \u0430 \u043f\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c. \u0422\u0430\u043a \u043f\u0440\u043e\u0449\u0435 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>project1.tf<\/code>.<\/p>\n<h2>\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438  <\/h2>\n<p>\u0420\u0435\u0441\u0443\u0440\u0441\u044b \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430\u0445 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u2014 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u043e\u0434\u043d\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u0445.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <strong>\u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 (security groups)<\/strong> \u2014 <code>sg.tf<\/code>.<\/p>\n<p>\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0430\u0448\u0438\u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f \u0432 Kubernetes, \u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c \u0432 Kubernetes \u2014 \u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0430\u0448\u0438\u043d\u0430\u043c. \u0410 \u0435\u0449\u0451 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u00ab\u0440\u043e\u0432\u043d\u0435\u0435 \u0434\u0440\u0443\u0433\u0438\u0445\u00bb, \u0438 \u0438\u043c \u043d\u0443\u0436\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 (\u043d\u043e \u043d\u0435 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442).<\/p>\n<p>\u0412 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043b\u0435\u0433\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f. \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0441\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445:<\/p>\n<pre><code class=\"javascript\">resource \"yandex_vpc_security_group\" \"group1\" {   name        = \"My security group 1\"   description = \"description for my security group\"   network_id  = yandex_vpc_network.foo.id    # \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043a \u0445\u043e\u0441\u0442\u0430\u043c group2   egress {     protocol          = \"UDP\"     description       = \"rule3 description\"     security_group_id = yandex_vpc_security_group.group2.id     port              = 8080   } }  resource \"yandex_vpc_security_group\" \"group2\" {   name        = \"My security group 2\"   description = \"description for my security group\"   network_id  = yandex_vpc_network.foo.id    # \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043e\u0442 \u0445\u043e\u0441\u0442\u0430\u043c group1   ingress {     protocol          = \"TCP\"     description       = \"rule1 description\"     security_group_id = yandex_vpc_security_group.group1.id     port              = 8080   } }<\/code><\/pre>\n<p> \u041d\u043e \u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435, \u0443 \u043d\u0430\u0441 \u0442\u0443\u0442 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u0432\u0443\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e \u0434\u0432\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u041e\u0434\u043d\u0443 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u043e\u0439 \u0438 \u0431\u0443\u0434\u0435\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0451 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0433\u0440\u0443\u043f\u043f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445:  <\/p>\n<pre><code class=\"javascript\"># \u041f\u0443\u0441\u0442\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0434\u043b\u044f \u0445\u043e\u0441\u0442\u043e\u0432 group1 resource \"yandex_vpc_security_group\" \"group1-initial\" {   name        = \"My initial security group 1\"   description = \"description for my security group\"   network_id  = yandex_vpc_network.foo.id }  resource \"yandex_vpc_security_group\" \"group1\" {   name        = \"My security group 1\"   description = \"description for my security group\"   network_id  = yandex_vpc_network.foo.id  # \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u0443\u044e group2-initial   egress {     protocol          = \"UDP\"     description       = \"rule3 description\"     security_group_id = yandex_vpc_security_group.group2-initial.id     port              = 8080   } }  resource \"yandex_vpc_security_group\" \"group2-initial\" {   name        = \"My security group 2\"   description = \"description for my security group\"   network_id  = yandex_vpc_network.foo.id }  resource \"yandex_vpc_security_group\" \"group2\" {   name        = \"My security group 2\"   description = \"description for my security group\"   network_id  = yandex_vpc_network.foo.id    ingress {     protocol          = \"TCP\"     description       = \"rule1 description\"     security_group_id = yandex_vpc_security_group.group1-initial.id     port              = 8080   } }<\/code><\/pre>\n<p> \u0417\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e, \u0442\u0443\u0442 \u0443 \u043d\u0430\u0441 \u0437\u0430\u0440\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0430\u043b\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u043c\u0430\u043a\u0430\u0440\u043e\u043d\u0438\u043d\u044b, \u043d\u043e \u0437\u0430\u0442\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043d\u0430\u0448\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u0446\u0438\u043a\u043b\u043e\u043c. \u0410 \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0433\u043e\u043b\u043e\u0432\u0435: \u043a\u043e\u0433\u0434\u0430 \u0434\u0436\u0443\u043d \u043f\u0440\u0438\u0434\u0451\u0442 \u0437\u0430 \u043f\u043e\u043c\u043e\u0449\u044c\u044e, \u0432\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u0443\u043a\u0430\u0436\u0435\u0442\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e. <\/p>\n<h3>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u043f\u0443\u0441\u0442\u044f  <\/h3>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442\u0441\u044f, \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0443 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0439, \u0430 \u043f\u043e\u0442\u043e\u043c \u0442\u0440\u0435\u0442\u0438\u0439, \u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">. \u251c\u2500\u2500 project1.tf \u251c\u2500\u2500 project1-xyz.tf \u251c\u2500\u2500 project1-db-master.tf \u251c\u2500\u2500 project1-s3-project2-copy1.tf \u251c\u2500\u2500 project1-s3-project3-copy1.tf \u251c\u2500\u2500 project1-s3-project3.tf \u251c\u2500\u2500 project1-s3-project4.tf \u251c\u2500\u2500 project1-subnets.tf \u251c\u2500\u2500 project1-secrets.tf \u251c\u2500\u2500 project-6.tf \u251c\u2500\u2500 project2-test.tf \u251c\u2500\u2500 project2-test2.tf \u251c\u2500\u2500 project2-integrations.tf \u251c\u2500\u2500 project2-from-company.tf \u251c\u2500\u2500 project2-dev.tf \u251c\u2500\u2500 project2-ci.tf \u251c\u2500\u2500 project2-to-company-sg.tf \u251c\u2500\u2500 project2-to-company.tf \u251c\u2500\u2500 jump-host.tf \u251c\u2500\u2500 monitoring.tf \u251c\u2500\u2500 cdn-internal.tf \u251c\u2500\u2500 cdn-external.tf \u251c\u2500\u2500 cicd.tf \u251c\u2500\u2500 siem-dev-compute.tf \u251c\u2500\u2500 cloud-init \u2502     \u251c\u2500\u2500 de-keys \u2502     \u251c\u2500\u2500 de-devops-keys \u2502     \u251c\u2500\u2500 de-admin-keys \u2502     \u251c\u2500\u2500 de-whoami-keys \u2502     \u251c\u2500\u2500 devops-keys \u2502     \u251c\u2500\u2500 ipv4-router.yaml \u2502     \u251c\u2500\u2500 ipv6-router.yaml \u2502     \u251c\u2500\u2500 scripts.yaml \u2502     \u251c\u2500\u2500 k8s-keys \u2502     \u251c\u2500\u2500 super-super-users.yaml \u2502     \u2514\u2500\u2500 super-users.yaml \u251c\u2500\u2500 cloud.tf \u251c\u2500\u2500 cloud_company_test.tf \u251c\u2500\u2500 compute-non-production.tf \u251c\u2500\u2500 compute.tf \u251c\u2500\u2500 control.tf \u251c\u2500\u2500 servers.tf \u251c\u2500\u2500 dev-project1-integrations-kafka-topics.tf \u251c\u2500\u2500 dev-project1-integrations-kafka.tf \u251c\u2500\u2500 dev-project1-integrations.tf \u251c\u2500\u2500 dev-project1-db.tf \u251c\u2500\u2500 my-vm.tf \u251c\u2500\u2500 dns-microservices.tf \u251c\u2500\u2500 dns-macroservices.tf \u251c\u2500\u2500 inokentiy.tf \u251c\u2500\u2500 accounting-1c.tf \u251c\u2500\u2500 accounting-1c-enterprise.tf \u251c\u2500\u2500 accounting-backups.tf \u251c\u2500\u2500 accounting-db.tf \u251c\u2500\u2500 accounting-analytics.tf \u251c\u2500\u2500 accounting-project8-s3.tf \u251c\u2500\u2500 accounting-containers.tf \u251c\u2500\u2500 accounting-s3.tf \u251c\u2500\u2500 accounting-subnets.tf \u251c\u2500\u2500 accounting.tf \u251c\u2500\u2500 express-all.tf \u251c\u2500\u2500 security-rules-s3.tf \u251c\u2500\u2500 security-rules.tf \u251c\u2500\u2500 ci-project1-sec.tf \u251c\u2500\u2500 ci-ansible.tf \u251c\u2500\u2500 ci-autotests.tf \u251c\u2500\u2500 ci-common.tf \u251c\u2500\u2500 ci-deploy.tf \u251c\u2500\u2500 ci-accounting.tf \u251c\u2500\u2500 ci-infra.tf \u251c\u2500\u2500 ci-here.tf \u251c\u2500\u2500 ci-project8.tf \u251c\u2500\u2500 ci-build.tf \u251c\u2500\u2500 ci-tf.tf \u251c\u2500\u2500 cicd2.tf \u251c\u2500\u2500 mons.tf \u251c\u2500\u2500 iam.tf \u251c\u2500\u2500 proxy-nonsecure.tf \u251c\u2500\u2500 proxy-secure.tf \u251c\u2500\u2500 ipsec.tf \u251c\u2500\u2500 k8s-sib.tf \u251c\u2500\u2500 k8s-common.tf \u251c\u2500\u2500 k8s-dev-common-nodes.tf \u251c\u2500\u2500 k8s-dev-ingress.tf \u251c\u2500\u2500 k8s-dev-nodes.tf \u251c\u2500\u2500 k8s-dev-sa.tf \u251c\u2500\u2500 k8s-dev-vm-nodes.tf \u251c\u2500\u2500 k8s-dev.tf \u251c\u2500\u2500 k8s-secure-dev-common-nodes.tf \u251c\u2500\u2500 k8s-secure-dev-ingress.tf \u251c\u2500\u2500 k8s-secure-dev-nodes.tf \u251c\u2500\u2500 k8s-secure-dev-vm-nodes.tf \u251c\u2500\u2500 k8s-secure-dev.tf \u251c\u2500\u2500 k8s-test-common-nodes.tf \u251c\u2500\u2500 k8s-test-ingress.tf \u251c\u2500\u2500 k8s-test-nodes.tf \u251c\u2500\u2500 k8s-test-secure-common-nodes.tf \u251c\u2500\u2500 k8s-test-secure-ingress.tf \u251c\u2500\u2500 k8s-test-secure-nodes.tf \u251c\u2500\u2500 k8s-test-secure-sql-nodes.tf \u251c\u2500\u2500 k8s-test-secure-vm-nodes.tf \u251c\u2500\u2500 k8s-test-secure.tf \u251c\u2500\u2500 k8s-test-sa.tf \u251c\u2500\u2500 k8s-test-vm-nodes.tf \u251c\u2500\u2500 k8s-test.tf \u251c\u2500\u2500 keys.tf \u251c\u2500\u2500 lb.tf \u251c\u2500\u2500 test-dev-compute.tf \u251c\u2500\u2500 adapter.tf \u251c\u2500\u2500 connector.tf \u251c\u2500\u2500 db-backend-baza.tf \u251c\u2500\u2500 db-backend.tf \u251c\u2500\u2500 db.tf \u251c\u2500\u2500 midnight-computer.tf \u251c\u2500\u2500 nat.tf \u251c\u2500\u2500 network.tf \u251c\u2500\u2500 cache.tf \u251c\u2500\u2500 outputs.tf \u251c\u2500\u2500 secure-dmz.tf \u251c\u2500\u2500 backups.tf \u251c\u2500\u2500 project8-stand-folder.tf \u251c\u2500\u2500 project8-stand-sg.tf \u251c\u2500\u2500 project8-stands.tf \u251c\u2500\u2500 project8-proxy.tf \u251c\u2500\u2500 project8-new-left.tf \u251c\u2500\u2500 project8-new.tf \u251c\u2500\u2500 project8-new-vars.tf \u251c\u2500\u2500 project8-folder.tf \u251c\u2500\u2500 project8-some-tests.tf \u251c\u2500\u2500 project8-lb.tf \u251c\u2500\u2500 project8-proxy-compute.tf \u251c\u2500\u2500 project8-proxy-sg.tf \u251c\u2500\u2500 project8-proxy-variables.tf \u251c\u2500\u2500 project8-smoke-compute.tf \u251c\u2500\u2500 project8-smoke-dns.tf \u251c\u2500\u2500 project8-smoke-db.tf \u251c\u2500\u2500 project8-smoke-network.tf \u251c\u2500\u2500 project8-smoke-s3.tf \u251c\u2500\u2500 project8-smoke-sg.tf \u251c\u2500\u2500 project8-smoke-variables.tf \u251c\u2500\u2500 project8-test-compute.tf \u251c\u2500\u2500 project8-test-dns.tf \u251c\u2500\u2500 project8-test-folder.tf \u251c\u2500\u2500 project8-test-lb.tf \u251c\u2500\u2500 project8-test-lockbox.tf \u251c\u2500\u2500 project8-test-db.tf \u251c\u2500\u2500 project8-test-network.tf \u251c\u2500\u2500 project8-test-copies.tf \u251c\u2500\u2500 project8-test-sg.tf \u251c\u2500\u2500 project8-test-variables.tf \u251c\u2500\u2500 project8-testlab-compute.tf \u251c\u2500\u2500 project8-to-internet.tf \u251c\u2500\u2500 project8-test-folder.tf \u251c\u2500\u2500 project8-test.tf \u251c\u2500\u2500 proxy-to-partners.tf \u251c\u2500\u2500 qa.tf \u251c\u2500\u2500 containers.tf \u251c\u2500\u2500 s3.tf \u251c\u2500\u2500 s3_project8_project1.tf \u251c\u2500\u2500 s3_project8_project2.tf \u251c\u2500\u2500 external-to-project8.tf \u251c\u2500\u2500 scripts \u2502     \u251c\u2500\u2500 manage.sh \u2502     \u2514\u2500\u2500 unmanage.sh \u251c\u2500\u2500 project7-test.tf \u251c\u2500\u2500 project7.tf \u251c\u2500\u2500 sg-for-servers.tf \u251c\u2500\u2500 sg.tf \u251c\u2500\u2500 sg-nikolay.tf \u251c\u2500\u2500 work-in-progress.tf \u251c\u2500\u2500 ver1-work-in-progress.tf \u251c\u2500\u2500 sib-compute.tf \u251c\u2500\u2500 sib-lb.tf \u251c\u2500\u2500 sib-db.tf \u251c\u2500\u2500 sib-other.tf \u251c\u2500\u2500 sib-sg.tf \u251c\u2500\u2500 wtf.tf \u251c\u2500\u2500 analyze-compute.tf \u251c\u2500\u2500 analyze-lb.tf \u251c\u2500\u2500 analyze-db-proxy.tf \u251c\u2500\u2500 analyze-other.tf \u251c\u2500\u2500 analyze-sg.tf \u251c\u2500\u2500 templates \u2502     \u251c\u2500\u2500 script.yaml \u2502     \u251c\u2500\u2500 open.yaml \u2502     \u251c\u2500\u2500 forwarder.yaml \u2502     \u251c\u2500\u2500 logs.yaml \u2502     \u2514\u2500\u2500 logs-forwarder.yaml \u251c\u2500\u2500 test-project1-integrations-kafka-topics.tf \u251c\u2500\u2500 test-project1-integrations-kafka.tf \u251c\u2500\u2500 test-project1-integrations.tf \u251c\u2500\u2500 test-project1-db-int.tf \u251c\u2500\u2500 test-project1-db.tf \u251c\u2500\u2500 test-project1-s3-exchange.tf \u251c\u2500\u2500 test-project1-s3-project8.tf \u251c\u2500\u2500 test-project1-s3-wtf.tf \u251c\u2500\u2500 test-project1-subnets.tf \u251c\u2500\u2500 test-dns-microservices.tf \u251c\u2500\u2500 test-dns-macroservices.tf \u251c\u2500\u2500 test-backend-kafka.tf \u251c\u2500\u2500 test-backend-redis.tf \u251c\u2500\u2500 test-backend-db.tf \u251c\u2500\u2500 secrets-test-dev-compute.tf \u251c\u2500\u2500 secrets.tf \u251c\u2500\u2500 playground.tf \u251c\u2500\u2500 manager.tf \u251c\u2500\u2500 s3-share.tf \u2514\u2500\u2500 sa.tf<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u2014 \u0432\u043e\u0442 \u043e\u043d \u0432\u044b\u0448\u0435.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0438 \u043f\u0440\u043e\u0434\u043e\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0438 \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u043b\u0433\u043e\u0439 \u043f\u043b\u043e\u0434\u043e\u0442\u0432\u043e\u0440\u043d\u043e\u0439 \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0438 \u043c\u044b \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0440\u0435\u0448\u0430\u0435\u043c \u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u044d\u0442\u043e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <code>terraform plan<\/code> \u0432 \u0442\u0430\u043a\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0442\u043e \u043c\u043e\u0436\u0435\u043c \u0436\u0434\u0430\u0442\u044c \u043e\u0442 10 \u0434\u043e 40 \u043c\u0438\u043d\u0443\u0442, \u0438 \u043d\u0430\u0448 <strong>state<\/strong> \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0441\u0451 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p><code>plan<\/code> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 Terraform \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c.<\/p>\n<p><code>terraform state<\/code>  \u2014 \u044d\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0422\u0430\u043a\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043a\u043e\u0434\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430\u0445 \u0438 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0449\u0435\u0439 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u041f\u043e\u0441\u043b\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f Terraform \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u0421\u0442\u0435\u0439\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u044d\u043a\u0435\u043d\u0434\u044b \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.<\/p>\n<\/blockquote>\n<p>\u041a\u0430\u043a \u0440\u0430\u0437 \u0443\u0441\u043f\u0435\u0435\u0442\u0435 \u0440\u0430\u0441\u043f\u0438\u0442\u044c \u0446\u0438\u043a\u043e\u0440\u0438\u0439 \u0432\u0441\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439.<\/p>\n<p>\u0425\u043e\u0442\u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0438\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0439\u043c\u0451\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438: \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043a\u043b\u0443\u0431\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0432 \u043d\u0443\u0436\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0438 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 <code>terraform plan<\/code> \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041e\u0434\u043d\u0430 \u0438 \u0442\u0430 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445, \u0438 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437, \u043f\u0440\u043e\u0449\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0437\u0430\u043d\u043e\u0432\u043e.<\/p>\n<blockquote>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0432\u044b \u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u044b! \u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438 \u0432\u043e\u0432\u0441\u0435 \u0441\u0442\u0430\u043d\u0435\u0442\u0435 \u043c\u0430\u0442\u0451\u0440\u044b\u043c\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u0430\u043c\u0438: \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u043a\u0440\u0438\u0441\u0442\u0430\u043b\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0430 \u0443 \u043c\u043e\u043b\u043e\u0434\u043e\u0433\u043e \u0438 \u043d\u0435\u043e\u043f\u044b\u0442\u043d\u043e\u0433\u043e \u0434\u0436\u0443\u043d\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0430\u0432\u043d\u0438\u043a.<\/p>\n<\/blockquote>\n<p>\u0412\u0430\u043c \u0436\u0435 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0434\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u00ab\u0441\u0438\u0434\u044f\u0442\u00bb \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0441\u0435\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<h3>\u0410 \u0447\u0442\u043e \u0442\u0443\u0442 \u043f\u043b\u043e\u0445\u043e\u0433\u043e?  <\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u044b\u043f\u0438\u0448\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0445 \u0433\u0440\u0435\u0445\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u0412 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0445\u043e\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u2014 \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u0430\u043c \u0447\u0451\u0440\u0442 \u043d\u043e\u0433\u0443 \u0441\u043b\u043e\u043c\u0438\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0435\u0439\u0442\u0430 \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b: \u043a\u0442\u043e-\u0442\u043e \u043a\u0430\u0442\u0438\u0442 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0430 \u0432\u044b \u0436\u0434\u0451\u0442\u0435, \u043f\u043e\u043a\u0430 \u043e\u043d\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445. \u0422\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u044e \u0441 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438: \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0442\u0438\u043f\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u043e\u0437\u0434\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u0443\u0436\u0435 \u043d\u0430\u043d\u0435\u0441\u043b\u0438 \u0432\u0440\u0435\u0434 \u043f\u0440\u043e\u0434\u043e\u0432\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041c\u043d\u043e\u0433\u043e \u00ab\u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u044b\u00bb \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041a \u0442\u0430\u043a\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u043c\u0430\u043b\u043e \u0434\u043e\u0432\u0435\u0440\u0438\u044f: \u043d\u043e\u0432\u0438\u0447\u043a\u0443 \u0441\u043b\u043e\u0436\u043d\u043e \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u0427\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u044f \u0437\u0430\u043f\u0443\u0449\u0443 <code>terraform apply<\/code>?\u00bb.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0451 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432 CI?<\/p>\n<\/li>\n<\/ol>\n<h3>\u0410 \u043a\u0430\u043a \u043d\u0430\u0434\u043e?  <\/h3>\n<h4>\u041c\u043e\u0434\u0443\u043b\u0438  <\/h4>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0441 Terraform-\u043c\u043e\u0434\u0443\u043b\u0435\u0439. Terraform-\u043c\u043e\u0434\u0443\u043b\u044c \u2014 \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u043e\u0432, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0432\u043c\u0435\u0441\u0442\u0435 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u041c\u043e\u0434\u0443\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u043e\u0431\u0449\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e git-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 <strong>Terraform Registry<\/strong>. \u0422\u0438\u043f\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443: <\/p>\n<pre><code class=\"bash\">\u251c\u2500\u2500 main.tf \u251c\u2500\u2500 outputs.tf \u251c\u2500\u2500 variables.tf \u251c\u2500\u2500 README.md<\/code><\/pre>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u043e\u0434\u0443\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438, \u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"322\" width=\"322\">\n<p align=\"center\"><strong>\u0421\u043b\u0435\u0432\u0430<\/strong>  <\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>\u0421\u043f\u0440\u0430\u0432\u0430<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"322\" width=\"322\">\n<p align=\"center\">\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0440\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u043e\u043d\u0430\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438, \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445  <\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441 API-\u043f\u0440\u043e\u043a\u0441\u0438 \u0434\u043b\u044f \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u0431\u044d\u043a\u0435\u043d\u0434\u0430  <\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p> \u0418 \u043a\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f? <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c1b\/451\/ec6\/c1b451ec6219bd06003a35dd54d48e8d.png\" width=\"2800\" height=\"1458\"><\/figure>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043c\u043e\u0434\u0443\u043b\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0441\u0442\u0440\u043e\u0433\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u0442\u0435 <strong>\u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 (outputs)<\/strong> \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f c <strong>\u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 (variables)<\/strong> \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0430 \u0441\u0442\u0440\u043e\u0433\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u044b\u0445 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0451 \u0442\u0438\u043f\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">variable \"network_interfaces\" {   description = \"Instance network interfaces\"   # optional \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0432 Terraform \u2265 1.3   type = map(object({     subnet_id          = string     ip_address         = optional(string)     security_group_ids = optional(set(string))     ipv6               = optional(bool)     nat                = optional(bool)     nat_ip             = optional(string)     dns_record = optional(object({       dns_zone_id = string       ttl         = optional(number, 300)       ptr         = optional(bool, true)     }))     nat_dns_record = optional(object({       dns_zone_id = string       ttl         = optional(number, 300)       ptr         = optional(bool, true)     }))   }))   default = {} }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u0434\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u0432 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 <code>subnet_id<\/code>, \u0442\u043e Terraform \u0441\u043e\u043e\u0431\u0449\u0438\u0442 \u043d\u0430\u043c \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u043d\u0430 \u0440\u0430\u043d\u043d\u0435\u0439 \u0441\u0442\u0430\u0434\u0438\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b.<\/p>\n<h3>\u0422\u0435\u0441\u0442\u044b<\/h3>\n<p>\u0422\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0435 \u0434\u043e\u0432\u0435\u0440\u0438\u0435 \u043a \u044d\u0442\u043e\u0439 \u0441\u0430\u043c\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438: \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u044e\u0442 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445, \u0430 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>\u0422\u0435\u0441\u0442\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0432 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u044f\u0445, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0431\u043b\u043e\u043a\u0438, \u0446\u0438\u043a\u043b\u044b \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0435 <strong>\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 (locals)<\/strong>: \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0442\u0430\u044f \u043a\u043e\u0434.<\/p>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u2014 \u044d\u0442\u043e <a href=\"https:\/\/terratest.gruntwork.io\/\">Terratest<\/a> \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f Go, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u0430\u043a <strong>\u043f\u0440\u043e\u0441\u0442\u044b\u0435 test-\u043a\u0435\u0439\u0441\u044b (\u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 output)<\/strong>, \u0442\u0430\u043a \u0438 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438.<\/p>\n<pre><code class=\"javascript\">package test  import ( \"testing\"  \"github.com\/gruntwork-io\/terratest\/modules\/terraform\" \"github.com\/stretchr\/testify\/assert\" )  func TestTerraformModule(t *testing.T) { terraformOptions := terraform.WithDefaultRetryableErrors(t, &amp;terraform.Options{ TerraformDir: \".\/tests\", })  \/\/ \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 defer terraform.Destroy(t, terraformOptions)  \/\/ \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c apply \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 terraform.InitAndApply(t, terraformOptions)  output := terraform.Output(t, terraformOptions, \"hello_world\")  \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c - \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c, \u0447\u0442\u043e output \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c assert.Equal(t, \"Hello, World!\", output) }<\/code><\/pre>\n<blockquote>\n<p>\u041f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 Terraform-\u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u0422\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0435 \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 Unit-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c mock-\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u043b\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432 \u043f\u043e\u043a\u0430 \u043d\u0435\u0442. \u0425\u043e\u0442\u044f \u0447\u0442\u043e-\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0432\u043e\u0434 <code>terraform plan<\/code>.  <\/p>\n<\/blockquote>\n<h4>\u0420\u0430\u0437\u0431\u0438\u0432\u043a\u0430 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 \u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443  <\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0443\u043c\u0430\u0435\u043c, \u043a\u0430\u043a \u043d\u0430\u043c \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0412 \u043b\u044e\u0431\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442 \u0432 \u0432\u0438\u0434\u0435 VPC, \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 \u0438 DNS-\u0437\u043e\u043d\u044b. \u041d\u0430\u0437\u043e\u0432\u0451\u043c \u044d\u0442\u043e\u0442 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442 <code>infra<\/code>: <\/p>\n<pre><code class=\"javascript\">. \u2514\u2500\u2500 terraform     \u2514\u2500\u2500 infra         \u251c\u2500\u2500 dns         \u2502    \u2514\u2500\u2500 main.tf         \u251c\u2500\u2500 sa         \u2514\u2500\u2500 vpc<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0435\u0434\u0451\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e:  <\/p>\n<pre><code class=\"javascript\">. \u2514\u2500\u2500 terraform     \u251c\u2500\u2500 envs     \u2502&nbsp;&nbsp; \u251c\u2500\u2500 dev     \u2502&nbsp;&nbsp; \u251c\u2500\u2500 prod     \u2502&nbsp;&nbsp; \u2514\u2500\u2500 test     \u2514\u2500\u2500 infra         \u251c\u2500\u2500 dns         \u251c\u2500\u2500 sa         \u2514\u2500\u2500 vpc<\/code><\/pre>\n<p>\u041d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0439\u0442\u0438 \u0432 \u043a\u0430\u0436\u0434\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c <code>terraform apply<\/code>, \u0430 \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>terraform_remote_state<\/code> \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 (data source).<\/p>\n<h4>Terragrunt  <\/h4>\n<p> \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432 \u043b\u044e\u0431\u043e\u0439 CI-\u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u0414\u043b\u044f \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e Terraform-\u043a\u043e\u0434\u0430 \u0432 \u0441\u043b\u043e\u0436\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u0430\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b \u0441\u0435\u0431\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442-\u0432\u0440\u0430\u043f\u043f\u0435\u0440 <strong>Terragrunt<\/strong>. \u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0447\u0438\u0441\u0442\u044b\u043c Terraform, \u0432\u044b \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0435 \u043a\u043e\u0434 \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u0438, \u043d\u043e \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u044d\u0442\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b <code>terragrunt.hcl<\/code>:  <\/p>\n<pre><code class=\"javascript\">. \u2514\u2500\u2500 terraform     \u251c\u2500\u2500 envs     \u2502&nbsp;&nbsp; \u251c\u2500\u2500 dev     \u2502   \u2502    \u2514\u2500\u2500 compute \u2502   \u2502         \u2514\u2500\u2500 terragrunt.hcl     \u2502   \u2502        k8s     \u2502   \u2502         \u2514\u2500\u2500 terragrunt.hcl     \u2502&nbsp;&nbsp; \u251c\u2500\u2500 prod     \u2502&nbsp;&nbsp; \u2514\u2500\u2500 test     \u2514\u2500\u2500 infra         \u251c\u2500\u2500 dns         \u251c\u2500\u2500 sa         \u2514\u2500\u2500 vpc<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>terragrunt run-all apply<\/code> \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0439\u0434\u0451\u0442\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432 <code>terragrunt.hcl<\/code>.<\/p>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Terragrunt \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 state-\u0444\u0430\u0439\u043b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>envs\/dev\/compute\/terraform.tfstate<\/code> \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u043c \u0431\u044d\u043a\u0435\u043d\u0434\u0435, \u0430 \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0441\u0442\u0435\u0439\u0442\u0430\u043c\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <code>dependency<\/code>:<\/p>\n<pre><code class=\"javascript\">dependency \"vpc\" {   config_path = \"..\/..\/..\/infra\/vpc\" }  inputs = {   vpc_id = dependency.vpc.outputs.vpc_id }<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044f <code>compute<\/code> \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044f <code>vpc<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0432\u0445\u043e\u0434\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>vpc_id<\/code> \u0432 \u043c\u043e\u0434\u0443\u043b\u044c <code>compute<\/code>.  <\/p>\n<h3>\u0412\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u0432\u0441\u0451 \u0438 \u043f\u043e\u0434\u0432\u0435\u0434\u0451\u043c \u0438\u0442\u043e\u0433\u0438  <\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0438 \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435, \u0438 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438:<\/p>\n<ol>\n<li>\n<p>\u0412 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430: \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 Terragrunt \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u0438 \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c, \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044f \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0441\u0432\u043e\u0439 state-\u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0432 \u0432\u0438\u0434\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u041a \u043a\u043e\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043e\u0432\u0435\u0440\u0438\u044f \u0437\u0430 \u0441\u0447\u0451\u0442 \u0442\u0435\u0441\u0442\u043e\u0432: \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>CI \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0433\u0438\u0431\u043a\u043e: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ol>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435  <\/h2>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 Terraform-\u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u041c\u044b \u0440\u0430\u0437\u0431\u0438\u043b\u0438 \u043a\u043e\u0434 \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u0438, \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0438 \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Terragrunt.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u0435\u043b\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u044d\u0442\u0430\u043f\u0443 \u2014 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CI-\u0441\u0438\u0441\u0442\u0435\u043c. \u041a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0439 \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c\u0441\u044f \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f SRE-\u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0430 \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0430 \u0442\u0430\u043a\u0438\u0445 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f CI-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c.<\/p>\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Terratest \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u0448\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438 \u043a\u043e\u0434 \u0442\u0430\u043a, \u043a\u0430\u043a \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0438 \u0432\u044b\u044f\u0432\u043b\u044f\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043d\u0438 \u0441\u0442\u0430\u043d\u0443\u0442 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432\u0430\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0430\u0448\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a, \u043a\u0430\u043a \u0432\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0435, \u0438 \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<\/p>\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\/companies\/yandex_praktikum\/articles\/738682\/\"> https:\/\/habr.com\/ru\/companies\/yandex_praktikum\/articles\/738682\/<\/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 class=\"persona\" persona=\"true\">\n<h5 class=\"persona__heading\" persona=\"true\">\u0418\u0433\u043e\u0440\u044c \u0422\u0438\u0443\u043d\u043e\u0432<\/h5>\n<p>SRE \u0432 Yandex \u0438 \u0430\u0432\u0442\u043e\u0440 \u043d\u0430 \u043a\u0443\u0440\u0441\u0435 <a href=\"https:\/\/practicum.yandex.ru\/devops\/?utm_source=pr&amp;utm_medium=content&amp;utm_campaign=pr_content_devops-course_habr&amp;utm_content=30_05_23\">\u00abDevOps \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00bb<\/a>.<\/p>\n<\/div>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0440\u0435\u0431\u044f\u0442\u0430 \u2014 SRE (\u0441 \u0430\u043d\u0433\u043b. Site Reliability Engineering), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0440\u043e\u0441\u043b\u0438 \u0438\u0437 \u0441\u0442\u0430\u0440\u044b\u0445 \u0434\u043e\u0431\u0440\u044b\u0445 \u0438 \u0431\u043e\u0440\u043e\u0434\u0430\u0442\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u041d\u043e \u043e\u043d\u0438 \u0443\u0441\u0442\u0430\u043b\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0439 \u0440\u0443\u0442\u0438\u043d\u043e\u0439 \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u0432\u0441\u0451 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 50% \u0432\u0440\u0435\u043c\u0435\u043d\u0438 SRE \u043f\u0438\u0448\u0443\u0442 \u043a\u043e\u0434.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0435 \u0441\u043f\u0435\u0448\u0438\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043a\u043e \u0432\u0441\u0435\u043c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c SRE, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043e\u043d\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u044b, \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u044f\u0442 Kubernetes \u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442 JSON \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043e\u043d\u0438 \u0441\u0442\u0440\u0435\u043c\u044f\u0442\u0441\u044f \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u0434\u0430: \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u0443\u0442\u0438\u043b\u0438\u0442, \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u043e\u0432 \u0438 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u043e\u0432.  <\/p>\n<p>\u0410 \u0432\u0435\u0434\u044c \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043a\u043e\u0434\u0430 \u0441\u0442\u0430\u043d\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e, \u0438 \u0435\u0433\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0447\u0438\u0442\u0430\u0442\u044c, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c. \u041c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0435\u0451 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f. \u0417\u0430\u0442\u043e \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0443\u0442!<\/p>\n<blockquote>\n<p><strong>\u0420\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c<\/strong> \u2014 \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043a\u043e\u0434\u0430 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c.<\/p>\n<\/blockquote>\n<p>\u0423 \u0440\u0435\u0431\u044f\u0442 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b SRE \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043e\u0431\u044a\u0451\u043c \u043a\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u044b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0418 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u2014 \u044d\u0442\u043e Terraform. \u0416\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e T\u0435rraform-\u043a\u043e\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0438 \u0442\u0443\u0442 \u043d\u0435\u0442 \u00ab\u0432\u043e\u043b\u0448\u0435\u0431\u043d\u043e\u0439 \u043f\u0438\u043b\u044e\u043b\u0438\u00bb \u0438 \u0441\u0442\u0440\u043e\u0433\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b.<\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 IaaC-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f (Infrastructure as a Code) \u0434\u043b\u044f Terraform \u0438 \u043d\u0430\u0447\u043d\u0451\u043c \u0441 \u0432\u0440\u0435\u0434\u043d\u044b\u0445 \u0441\u043e\u0432\u0435\u0442\u043e\u0432.<\/p>\n<h3>\u041d\u0438\u0447\u0442\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u0432\u0435\u0449\u0430\u043b\u043e \u0431\u0435\u0434\u044b  <\/h3>\n<p>\u041d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0435 \u0441\u0432\u043e\u044e \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u0432 Terraform-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430. <\/p>\n<blockquote>\n<p><strong>\u0420\u0435\u0441\u0443\u0440\u0441\u043e\u043c \u0432 Terraform<\/strong> \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u043b\u043e\u043a, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435: \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430, \u0441\u0435\u0442\u044c \u0438\u043b\u0438 DNS-\u0437\u0430\u043f\u0438\u0441\u044c.<\/p>\n<\/blockquote>\n<p>\u0417\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Terraform-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0434\u043b\u044f Yandex Cloud.<\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432 \u0444\u0430\u0439\u043b\u0435-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 <code>compute.tf<\/code> \u0443 \u0432\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<\/p>\n<h4>compute.tf  <\/h4>\n<pre><code class=\"javascript\">resource \"yandex_compute_instance\" \"default\" {   name        = \"test\"   platform_id = \"standard-v1\"   zone        = \"ru-central1-a\"    resources {     cores  = 2     memory = 4   }    boot_disk {     initialize_params {       image_id = \"image_id\"     }   }    network_interface {     subnet_id = \"${yandex_vpc_subnet.foo.id}\"   }    metadata = {     foo      = \"bar\"     ssh-keys = \"ubuntu:${file(\"~\/.ssh\/id_rsa.pub\")}\"   } }<\/code><\/pre>\n<p>\u0425\u043e\u0442\u044f \u043d\u0435\u0442. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c VPC \u0438 \u043f\u043e\u0434\u0441\u0435\u0442\u044c: \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u044d\u0442\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0432 \u0444\u0430\u0439\u043b\u0435 <code>network.tf<\/code>.<\/p>\n<h4>network.tf  <\/h4>\n<pre><code class=\"javascript\">resource \"yandex_vpc_network\" \"foo\" {}  resource \"yandex_vpc_subnet\" \"foo\" {   zone           = \"ru-central1-a\"   network_id     = \"${yandex_vpc_network.foo.id}\"   v4_cidr_blocks = [\"10.5.0.0\/24\"] }<\/code><\/pre>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Kubernetes-\u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>k8s.tf<\/code>:  <\/p>\n<h4>k8s.tf  <\/h4>\n<pre><code class=\"javascript\">resource \"yandex_kubernetes_cluster\" \"my_cluster\" {   name        = \"name\"   description = \"description\"    network_id = \"${yandex_vpc_network.network_resource_name.id}\"    master {     version = \"1.17\"     zonal {       zone      = \"${yandex_vpc_subnet.foo.zone}\"       subnet_id = \"${yandex_vpc_subnet.foo.id}\"     }      public_ip = true      security_group_ids = [\"${yandex_vpc_security_group.security_group_name.id}\"]      maintenance_policy {       auto_upgrade = true        maintenance_window {         start_time = \"15:00\"         duration   = \"3h\"       }     }      master_logging {       enabled = true       log_group_id = \"${yandex_logging_group.log_group_resoruce_name.id}\"       kube_apiserver_enabled = true       cluster_autoscaler_enabled = true       events_enabled = true     }   }    service_account_id      = \"${yandex_iam_service_account.service_account_resource_name.id}\"   node_service_account_id = \"${yandex_iam_service_account.node_service_account_resource_name.id}\"    labels = {     my_key       = \"my_value\"     my_other_key = \"my_other_value\"   }    release_channel = \"RAPID\"   network_policy_provider = \"CALICO\"    kms_provider {     key_id = \"${yandex_kms_symmetric_key.kms_key_resource_name.id}\"   } }<\/code><\/pre>\n<p> \u0418 \u0441\u044e\u0434\u0430 \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u043e\u0434-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. \u0418\u043b\u0438 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0434\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>k8s-nodes.tf<\/code>, \u0432\u0435\u0434\u044c \u0431\u044b\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0433\u0440\u0443\u043f\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0439\u0442\u0438:<\/p>\n<h4>k8s-nodes.tf<\/h4>\n<pre><code class=\"javascript\">resource \"yandex_kubernetes_node_group\" \"my_node_group\" {   cluster_id  = \"${yandex_kubernetes_cluster.my_cluster.id}\"   name        = \"name\"   description = \"description\"   version     = \"1.22\"    labels = {     \"key\" = \"value\"   }    instance_template {     platform_id = \"standard-v2\"      network_interface {       nat                = true       subnet_ids         = [\"${yandex_vpc_subnet.foo.id}\"]     }      resources {       memory = 2       cores  = 2     }      boot_disk {       type = \"network-hdd\"       size = 64     }      scheduling_policy {       preemptible = false     }      container_runtime {       type = \"containerd\"     }   }    scale_policy {     fixed_scale {       size = 1     }   }    allocation_policy {     location {       zone = \"ru-central1-a\"     }   }    maintenance_policy {     auto_upgrade = true     auto_repair  = true      maintenance_window {       day        = \"monday\"       start_time = \"15:00\"       duration   = \"3h\"     }      maintenance_window {       day        = \"friday\"       start_time = \"10:00\"       duration   = \"4h30m\"     }   } }<\/code><\/pre>\n<p>\u041d\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d \u0443 \u043d\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0433\u043e, \u0434\u0430 \u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432 K8s \u0442\u043e\u0436\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0438\u0445 \u043d\u0435 \u043f\u043e \u0442\u0438\u043f\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u0430, \u0430 \u043f\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c. \u0422\u0430\u043a \u043f\u0440\u043e\u0449\u0435 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>project1.tf<\/code>.<\/p>\n<h2>\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438  <\/h2>\n<p>\u0420\u0435\u0441\u0443\u0440\u0441\u044b \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430\u0445 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u2014 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u043e\u0434\u043d\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u0445.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <strong>\u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 (security groups)<\/strong> \u2014 <code>sg.tf<\/code>.<\/p>\n<p>\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0430\u0448\u0438\u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f \u0432 Kubernetes, \u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c \u0432 Kubernetes \u2014 \u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0430\u0448\u0438\u043d\u0430\u043c. \u0410 \u0435\u0449\u0451 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u00ab\u0440\u043e\u0432\u043d\u0435\u0435 \u0434\u0440\u0443\u0433\u0438\u0445\u00bb, \u0438 \u0438\u043c \u043d\u0443\u0436\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 (\u043d\u043e \u043d\u0435 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442).<\/p>\n<p>\u0412 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043b\u0435\u0433\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f. \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0441\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445:<\/p>\n<pre><code class=\"javascript\">resource \"yandex_vpc_security_group\" \"group1\" {   name        = \"My security group 1\"   description = \"description for my security group\"   network_id  = yandex_vpc_network.foo.id    # \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043a \u0445\u043e\u0441\u0442\u0430\u043c group2   egress {     protocol          = \"UDP\"     description       = \"rule3 description\"     security_group_id = yandex_vpc_security_group.group2.id     port              = 8080   } }  resource \"yandex_vpc_security_group\" \"group2\" {   name        = \"My security group 2\"   description = \"description for my security group\"   network_id  = yandex_vpc_network.foo.id    # \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043e\u0442 \u0445\u043e\u0441\u0442\u0430\u043c group1   ingress {     protocol          = \"TCP\"     description       = \"rule1 description\"     security_group_id = yandex_vpc_security_group.group1.id     port              = 8080   } }<\/code><\/pre>\n<p> \u041d\u043e \u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435, \u0443 \u043d\u0430\u0441 \u0442\u0443\u0442 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u0432\u0443\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e \u0434\u0432\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u041e\u0434\u043d\u0443 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u043e\u0439 \u0438 \u0431\u0443\u0434\u0435\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0451 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0433\u0440\u0443\u043f\u043f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445:  <\/p>\n<pre><code class=\"javascript\"># \u041f\u0443\u0441\u0442\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0434\u043b\u044f \u0445\u043e\u0441\u0442\u043e\u0432 group1 resource \"yandex_vpc_security_group\" \"group1-initial\" {   name        = \"My initial security group 1\"   description = \"description for my security group\"   network_id  = yandex_vpc_network.foo.id }  resource \"yandex_vpc_security_group\" \"group1\" {   name        = \"My security group 1\"   description = \"description for my security group\"   network_id  = yandex_vpc_network.foo.id  # \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u0443\u044e group2-initial   egress {     protocol          = \"UDP\"     description       = \"rule3 description\"     security_group_id = yandex_vpc_security_group.group2-initial.id     port              = 8080   } }  resource \"yandex_vpc_security_group\" \"group2-initial\" {   name        = \"My security group 2\"   description = \"description for my security group\"   network_id  = yandex_vpc_network.foo.id }  resource \"yandex_vpc_security_group\" \"group2\" {   name        = \"My security group 2\"   description = \"description for my security group\"   network_id  = yandex_vpc_network.foo.id    ingress {     protocol          = \"TCP\"     description       = \"rule1 description\"     security_group_id = yandex_vpc_security_group.group1-initial.id     port              = 8080   } }<\/code><\/pre>\n<p> \u0417\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e, \u0442\u0443\u0442 \u0443 \u043d\u0430\u0441 \u0437\u0430\u0440\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0430\u043b\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u043c\u0430\u043a\u0430\u0440\u043e\u043d\u0438\u043d\u044b, \u043d\u043e \u0437\u0430\u0442\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043d\u0430\u0448\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u0446\u0438\u043a\u043b\u043e\u043c. \u0410 \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0433\u043e\u043b\u043e\u0432\u0435: \u043a\u043e\u0433\u0434\u0430 \u0434\u0436\u0443\u043d \u043f\u0440\u0438\u0434\u0451\u0442 \u0437\u0430 \u043f\u043e\u043c\u043e\u0449\u044c\u044e, \u0432\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u0443\u043a\u0430\u0436\u0435\u0442\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e. <\/p>\n<h3>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u043f\u0443\u0441\u0442\u044f  <\/h3>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442\u0441\u044f, \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0443 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0439, \u0430 \u043f\u043e\u0442\u043e\u043c \u0442\u0440\u0435\u0442\u0438\u0439, \u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">. \u251c\u2500\u2500 project1.tf \u251c\u2500\u2500 project1-xyz.tf \u251c\u2500\u2500 project1-db-master.tf \u251c\u2500\u2500 project1-s3-project2-copy1.tf \u251c\u2500\u2500 project1-s3-project3-copy1.tf \u251c\u2500\u2500 project1-s3-project3.tf \u251c\u2500\u2500 project1-s3-project4.tf \u251c\u2500\u2500 project1-subnets.tf \u251c\u2500\u2500 project1-secrets.tf \u251c\u2500\u2500 project-6.tf \u251c\u2500\u2500 project2-test.tf \u251c\u2500\u2500 project2-test2.tf \u251c\u2500\u2500 project2-integrations.tf \u251c\u2500\u2500 project2-from-company.tf \u251c\u2500\u2500 project2-dev.tf \u251c\u2500\u2500 project2-ci.tf \u251c\u2500\u2500 project2-to-company-sg.tf \u251c\u2500\u2500 project2-to-company.tf \u251c\u2500\u2500 jump-host.tf \u251c\u2500\u2500 monitoring.tf \u251c\u2500\u2500 cdn-internal.tf \u251c\u2500\u2500 cdn-external.tf \u251c\u2500\u2500 cicd.tf \u251c\u2500\u2500 siem-dev-compute.tf \u251c\u2500\u2500 cloud-init \u2502     \u251c\u2500\u2500 de-keys \u2502     \u251c\u2500\u2500 de-devops-keys \u2502     \u251c\u2500\u2500 de-admin-keys \u2502     \u251c\u2500\u2500 de-whoami-keys \u2502     \u251c\u2500\u2500 devops-keys \u2502     \u251c\u2500\u2500 ipv4-router.yaml \u2502     \u251c\u2500\u2500 ipv6-router.yaml \u2502     \u251c\u2500\u2500 scripts.yaml \u2502     \u251c\u2500\u2500 k8s-keys \u2502     \u251c\u2500\u2500 super-super-users.yaml \u2502     \u2514\u2500\u2500 super-users.yaml \u251c\u2500\u2500 cloud.tf \u251c\u2500\u2500 cloud_company_test.tf \u251c\u2500\u2500 compute-non-production.tf \u251c\u2500\u2500 compute.tf \u251c\u2500\u2500 control.tf \u251c\u2500\u2500 servers.tf \u251c\u2500\u2500<\/code><\/pre>\n<\/div>\n<\/details>\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-348125","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/348125","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=348125"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/348125\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=348125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=348125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=348125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}