{"id":379815,"date":"2024-06-25T04:00:00","date_gmt":"2024-06-25T04:00:00","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=379815"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=379815","title":{"rendered":"<span>\u041e\u0431\u0437\u043e\u0440 OpenTofu 1.7.0: \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430, \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Terraform, \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/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 xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041d\u0430 \u0441\u0432\u044f\u0437\u0438 \u0414\u043c\u0438\u0442\u0440\u0438\u0439 \u0421\u0438\u043b\u043a\u0438\u043d, DevOps-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u00ab\u0424\u043b\u0430\u043d\u0442\u00bb. 30\u00a0\u0430\u043f\u0440\u0435\u043b\u044f \u0438\u0437 \u0431\u0435\u0442\u0430-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0448\u0435\u043b <a href=\"https:\/\/opentofu.org\/blog\/opentofu-1-7-0\/\"><u>OpenTofu 1.7.0<\/u><\/a>. \u042d\u0442\u043e Open Source-\u0444\u043e\u0440\u043a Terraform, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c <a href=\"https:\/\/www.linuxfoundation.org\/\"><u>Linux Foundation<\/u><\/a>. \u0420\u0430\u043d\u0435\u0435 \u043c\u044b \u0443\u0436\u0435 <a href=\"https:\/\/habr.com\/ru\/companies\/flant\/news\/762356\/\"><u>\u043f\u0438\u0441\u0430\u043b\u0438<\/u><\/a> \u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 OpenTofu, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 HashiCorp \u0432 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432. \u0412 \u044d\u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u0434\u0435\u043b\u0430\u044e \u043e\u0431\u0437\u043e\u0440 \u0432\u0435\u0440\u0441\u0438\u0438 1.7.0: \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e OpenTofu, \u0432\u044b\u043f\u043e\u043b\u043d\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441 Terraform, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/28e\/b24\/9ff\/28eb249ff02559bc73531be01d7e048e.png\" width=\"1600\" height=\"920\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/28e\/b24\/9ff\/28eb249ff02559bc73531be01d7e048e.png\"\/><\/figure>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 OpenTofu<\/h3>\n<p>\u0414\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 OpenTofu \u0443\u0436\u0435 <a href=\"https:\/\/opentofu.org\/docs\/intro\/install\/\"><u>\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d<\/u><\/a> \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c OpenTofu \u043d\u0430 macOS \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 Homebrew:<\/p>\n<pre><code class=\"bash\">brew update brew install opentofu<\/code><\/pre>\n<p>\u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e OpenTofu \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d:<\/p>\n<pre><code class=\"bash\">\u276f tofu -version OpenTofu v1.7.0 on darwin_arm64<\/code><\/pre>\n<h3>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Terraform<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 Terraform. \u0412 \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 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 Yandex Cloud, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e VPC, \u0434\u0432\u0443\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d \u0438 DNS-\u0437\u043e\u043d\u044b \u0441 \u0434\u0432\u0443\u043c\u044f A-\u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fee\/d50\/223\/feed50223cde63b2d3e8af1534c2367b.png\" width=\"1600\" height=\"923\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fee\/d50\/223\/feed50223cde63b2d3e8af1534c2367b.png\"\/><\/figure>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f:<\/p>\n<pre><code class=\"bash\">terraform {   required_providers {     yandex = {       source  = \"yandex-cloud\/yandex\"     }   }   required_version = \">= 0.13\" }  provider \"yandex\" {   zone      = \"ru-central1-a\" }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Terraform \u043f\u043e\u0447\u0442\u0438 <a href=\"https:\/\/opentofu.org\/docs\/intro\/migration\/\"><u>\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430<\/u><\/a>. \u0423 \u043d\u0430\u0441 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0440\u0430\u0437\u0432\u0451\u0440\u043d\u0443\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Terraform 1.8.3, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 OpenTofu 1.7.0.<\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b Terraform, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 Terraform-state \u043d\u0430\u0448\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">\u276f terraform plan data.yandex_compute_image.vm_2_image: Reading... data.yandex_compute_image.vm_1_image: Reading... yandex_vpc_address.vm_1_public_ip: Refreshing state... [id=e9b2ef4mkpojsu6lkba2] yandex_vpc_network.infra_network: Refreshing state... [id=enpr0clfntcn6k1ljc3l] yandex_vpc_address.vm_2_public_ip: Refreshing state... [id=e9bvv8ep3ick80l7t4td] data.yandex_compute_image.vm_1_image: Read complete after 0s [id=fd80bca9kcrb3ubq7eaf] data.yandex_compute_image.vm_2_image: Read complete after 0s [id=fd80bca9kcrb3ubq7eaf] yandex_dns_zone.dns_zone: Refreshing state... [id=dnsdv83jlsms5ckpea79] yandex_vpc_subnet.infra_subnet[2]: Refreshing state... [id=fl84b0cauja9rnf97mt3] yandex_vpc_subnet.infra_subnet[0]: Refreshing state... [id=e9b9o5fg8f8qfi9rsi5v] yandex_vpc_subnet.infra_subnet[1]: Refreshing state... [id=e2lfp68t0gj5d3te7fea] yandex_compute_instance.vm_1: Refreshing state... [id=fhmmv8hlqn52b1jcaj78] yandex_compute_instance.vm_2: Refreshing state... [id=fhmqqq3jrl1ertu5snq2] yandex_dns_recordset.vm_1_dns: Refreshing state... [id=dnsdv83jlsms5ckpea79\/vm-1.example.com.\/A] yandex_dns_recordset.vm_2_dns: Refreshing state... [id=dnsdv83jlsms5ckpea79\/vm-2.example.com.\/A]  No changes. Your infrastructure matches the configuration.  Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e <em>terraform apply<\/em>.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0431\u044d\u043a\u0430\u043f \u0444\u0430\u0439\u043b\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f Terraform-state.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u043b\u0430\u043d\u0443 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432\u044b\u0448\u0435 \u0432\u043d\u0435\u0441\u0451\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434 Terraform, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p>S3 Backend:<\/p>\n<ul>\n<li>\n<p>OpenTofu \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>skip_s3_checksum<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u0446\u0438\u044f <code>endpoints \u2192 sso<\/code> \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>AWS_ENDPOINT_URL<\/code><strong>, <\/strong>\u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Removed Blocks:<\/p>\n<ul>\n<li>\n<p>Removed-\u0431\u043b\u043e\u043a\u0438 \u0432 OpenTofu \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u043d\u0430\u0447\u0435, \u0447\u0435\u043c \u0432 Terraform. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u041d\u043e \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e <a href=\"https:\/\/opentofu.org\/docs\/intro\/migration\/terraform-1.8\/#removed-block\"><u>\u0443\u0434\u0430\u043b\u0438\u0442\u044c<\/u><\/a> \u0431\u043b\u043e\u043a lifecycle \u043b\u0438\u0431\u043e, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u0446\u0438\u044f <code>lifecycle \u2192 destroy = true<\/code>, \u0432\u0435\u0441\u044c removed-\u0431\u043b\u043e\u043a.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Testing Changes:<\/p>\n<ul>\n<li>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 <em>mock provider<\/em><a href=\"https:\/\/github.com\/opentofu\/opentofu\/issues\/1155\"><u>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442<\/u><\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 <em>terraform test <\/em>\u0438 <em>mock provider<\/em>, \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043d\u0443\u0436\u043d\u043e <a href=\"https:\/\/github.com\/opentofu\/opentofu\/issues\/1204\"><u>\u0441\u0434\u0435\u043b\u0430\u0442\u044c<\/u><\/a> \u0434\u043b\u044f <code>override_resource<\/code>, <code>override_data<\/code>, <code>override_module<\/code>.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e OpenTofu:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">\u276f tofu init  Initializing the backend...  Initializing provider plugins... - Finding latest version of yandex-cloud\/yandex... - Installing yandex-cloud\/yandex v0.118.0... - Installed yandex-cloud\/yandex v0.118.0. Signature validation was skipped due to the registry not containing GPG keys for this provider  OpenTofu has made some changes to the provider dependency selections recorded in the .terraform.lock.hcl file. Review those changes and commit them to your version control system if they represent changes you intended to make.  OpenTofu has been successfully initialized!  You may now begin working with OpenTofu. Try running \"tofu plan\" to see any changes that are required for your infrastructure. All OpenTofu commands should now work.  If you ever set or change modules or backend configuration for OpenTofu, rerun this command to reinitialize your working directory. If you forget, other commands will detect it and remind you to do so if necessary.<\/code><\/pre>\n<ol start=\"6\">\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">\u276f tofu plan yandex_vpc_network.infra_network: Refreshing state... [id=enpr0clfntcn6k1ljc3l] yandex_vpc_address.vm_2_public_ip: Refreshing state... [id=e9bvv8ep3ick80l7t4td] yandex_vpc_address.vm_1_public_ip: Refreshing state... [id=e9b2ef4mkpojsu6lkba2] data.yandex_compute_image.vm_2_image: Reading... data.yandex_compute_image.vm_1_image: Reading... data.yandex_compute_image.vm_2_image: Read complete after 1s [id=fd80bca9kcrb3ubq7eaf] data.yandex_compute_image.vm_1_image: Read complete after 1s [id=fd80bca9kcrb3ubq7eaf] yandex_dns_zone.dns_zone: Refreshing state... [id=dnsdv83jlsms5ckpea79] yandex_vpc_subnet.infra_subnet[2]: Refreshing state... [id=fl84b0cauja9rnf97mt3] yandex_vpc_subnet.infra_subnet[1]: Refreshing state... [id=e2lfp68t0gj5d3te7fea] yandex_vpc_subnet.infra_subnet[0]: Refreshing state... [id=e9b9o5fg8f8qfi9rsi5v] yandex_compute_instance.vm_1: Refreshing state... [id=fhmmv8hlqn52b1jcaj78] yandex_compute_instance.vm_2: Refreshing state... [id=fhmqqq3jrl1ertu5snq2] yandex_dns_recordset.vm_1_dns: Refreshing state... [id=dnsdv83jlsms5ckpea79\/vm-1.example.com.\/A] yandex_dns_recordset.vm_2_dns: Refreshing state... [id=dnsdv83jlsms5ckpea79\/vm-2.example.com.\/A]  No changes. Your infrastructure matches the configuration.  OpenTofu has compared your real infrastructure against your configuration and found no differences, so no changes are needed.<\/code><\/pre>\n<ol start=\"7\">\n<li>\n<p>OpenTofu \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">\u276f tofu apply data.yandex_compute_image.vm_1_image: Reading... yandex_vpc_address.vm_2_public_ip: Refreshing state... [id=e9bvv8ep3ick80l7t4td] data.yandex_compute_image.vm_2_image: Reading... yandex_vpc_network.infra_network: Refreshing state... [id=enpr0clfntcn6k1ljc3l] yandex_vpc_address.vm_1_public_ip: Refreshing state... [id=e9b2ef4mkpojsu6lkba2] data.yandex_compute_image.vm_2_image: Read complete after 1s [id=fd80bca9kcrb3ubq7eaf] data.yandex_compute_image.vm_1_image: Read complete after 1s [id=fd80bca9kcrb3ubq7eaf] yandex_dns_zone.dns_zone: Refreshing state... [id=dnsdv83jlsms5ckpea79] yandex_vpc_subnet.infra_subnet[0]: Refreshing state... [id=e9b9o5fg8f8qfi9rsi5v] yandex_vpc_subnet.infra_subnet[2]: Refreshing state... [id=fl84b0cauja9rnf97mt3] yandex_vpc_subnet.infra_subnet[1]: Refreshing state... [id=e2lfp68t0gj5d3te7fea] yandex_compute_instance.vm_2: Refreshing state... [id=fhmqqq3jrl1ertu5snq2] yandex_compute_instance.vm_1: Refreshing state... [id=fhmmv8hlqn52b1jcaj78] yandex_dns_recordset.vm_2_dns: Refreshing state... [id=dnsdv83jlsms5ckpea79\/vm-2.example.com.\/A] yandex_dns_recordset.vm_1_dns: Refreshing state... [id=dnsdv83jlsms5ckpea79\/vm-1.example.com.\/A]  No changes. Your infrastructure matches the configuration.  OpenTofu has compared your real infrastructure against your configuration and found no differences, so no changes are needed.  Apply complete! Resources: 0 added, 0 changed, 0 destroyed.  Outputs:  vm_1_address = \"&lt;ip 1>\" vm_1_name = \"vm-1\" vm_2_address = \"&lt;ip 2>\" vm_2_name = \"vm-2\"<\/code><\/pre>\n<ol start=\"8\">\n<li>\n<p>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c OpenTofu. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0432 \u0447\u0451\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0431\u044d\u043a\u0430\u043f\u043e\u043c Terraform-state \u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u043c:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">\u276f diff state tofu_state 3,4c3,4 &lt;   \"terraform_version\": \"1.8.3\", &lt;   \"serial\": 4, --- >   \"terraform_version\": \"1.7.0\", >   \"serial\": 5, 29c29 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 59c59 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 89c89 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 205c205 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 321c321 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 350c350 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 379c379 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 410c410 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 444c444 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 478c478 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 506c506 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\",<\/code><\/pre>\n<p>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0432 <code>terraform_version<\/code> \u0438 \u0430\u0434\u0440\u0435\u0441\u0430\u0445 registry \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a OpenTofu \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 <a href=\"https:\/\/github.com\/opentofu\/registry\/tree\/main\/providers\"><u>registry<\/u><\/a>.<\/p>\n<h3>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0432 OpenTofu 1.7.0.<\/p>\n<h4>\u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 Terraform-state\u00a0<\/h4>\n<p><a href=\"https:\/\/opentofu.org\/docs\/intro\/whats-new\/#state-encryption\"><u>\u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/u><\/a> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>passphrase<\/code>, \u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449: AWS KMS, GCP KMS, OpenBao \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 Terraform-state, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <code>passphrase<\/code>:<\/p>\n<pre><code class=\"bash\">terraform {   required_providers {     yandex = {       source  = \"yandex-cloud\/yandex\"     }   }   required_version = \">= 0.13\"   encryption {     method \"unencrypted\" \"migrate\" {}      key_provider \"pbkdf2\" \"mykey\" {       passphrase = \"passphrasepassphrase123!\"     }      method \"aes_gcm\" \"new_method\" {       keys = key_provider.pbkdf2.mykey     }      state {       method = method.aes_gcm.new_method        fallback {         method = method.unencrypted.migrate       }     }   } } provider \"yandex\" {   zone      = \"ru-central1-a\" }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0435\u0451 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 Terraform-state:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c8f\/ff2\/872\/c8fff2872d378c71567d214b542fd69b.png\" width=\"1302\" height=\"658\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c8f\/ff2\/872\/c8fff2872d378c71567d214b542fd69b.png\"\/><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b, \u0432\u043d\u0435\u0441\u0451\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u0443\u043a\u0430\u0437\u0430\u0432 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <code>fallback<\/code> \u043c\u0435\u0442\u043e\u0434 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0432 <code>state<\/code> \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c unencrypted-\u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"bash\">terraform {   required_providers {     yandex = {       source  = \"yandex-cloud\/yandex\"     }   }   required_version = \">= 0.13\"   encryption {     method \"unencrypted\" \"migrate\" {}      key_provider \"pbkdf2\" \"mykey\" {       passphrase = \"passphrasepassphrase123!\"     }      method \"aes_gcm\" \"new_method\" {       keys = key_provider.pbkdf2.mykey     }      state {       method = method.unencrypted.migrate        fallback {         method = method.aes_gcm.new_method       }        enforced = false           }   } } provider \"yandex\" {   zone      = \"ru-central1-a\" }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0444\u0430\u0439\u043b Terraform-state \u0432\u043d\u043e\u0432\u044c \u0441\u0442\u0430\u043b \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n<h4>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 provider-defined-\u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/h4>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 provider-defined-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 OpentTofu \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b Lua \u0438 Go. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0438\u043c \u043f\u0440\u044f\u043c\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Terraform \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u044d\u0442\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.\u00a0<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 IPv4\/IPv6- \u0438 MAC-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Go \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Terraform:<\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 Go \u0432 <code>required_providers<\/code>:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">required_providers {     yandex = {       source  = \"yandex-cloud\/yandex\"     }     go = {       source = \"registry.opentofu.org\/opentofu\/go\"       version = \"0.0.3\"     }   }<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u041f\u043e\u043b\u043e\u0436\u0438\u043c \u0440\u044f\u0434\u043e\u043c \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0444\u0430\u0439\u043b <code>network.go<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">package lib  import ( \"bytes\" \"net\" \"sort\" )  func Sort_IP(ips []string) []string { parsed := make([]net.IP, len(ips))  for i, ip := range ips { parsed[i] = net.ParseIP(ip) }  sort.Slice(parsed, func(i, j int) bool { return bytes.Compare(parsed[i], parsed[j]) &lt; 0 })  result := make([]string, len(ips))  for i, ip := range parsed { result[i] = ip.String() }  return result }  func Sort_Mac(macs []string) ([]string, error) { parsed := make([]net.HardwareAddr, len(macs))  var err error  for i, mac := range macs { parsed[i], err = net.ParseMAC(mac) if err != nil { return nil, err } }  sort.Slice(parsed, func(i, j int) bool { return bytes.Compare(parsed[i], parsed[j]) &lt; 0 })  result := make([]string, len(macs))  for i, mac := range parsed { result[i] = mac.String() }  return result, nil }<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u041e\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 <code>provider-defined<\/code>-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 <code>network.tf<\/code>:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">provider \"go\" {     alias = \"net\"     go = file(\".\/network.go\") }  locals {     target_ips = [     \"192.168.1.5\",     \"69.52.220.44\",     \"10.152.16.23\",     \"2001:0db8:85a3:0000:0000:8a2e:0370:7334\",     \"192.168.3.10\",     \"192.168.1.4\",     \"192.168.1.41\",     ]     target_macs = [     \"00:00:5e:00:53:01\",     \"02-00-5e-10-00-00-00-01\",     \"0000.0000.fe80.0000.0000.0000.0200.5e10.0000.0001\",     ]      sorted_ips = provider::go::net::sort_ip(local.target_ips)     sorted_macs = provider::go::net::sort_mac(local.target_macs) }  resource \"local_file\" \"ip_configs\" {     filename = \".\/ip_addresses.txt\"     content = join(\"\\n\", local.sorted_ips) }   resource \"local_file\" \"mac_configs\" {     filename = \".\/mac_addresses.txt\"     content = join(\"\\n\", local.sorted_macs) }<\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c tofu plan:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d34\/225\/c09\/d34225c096b3bf12a5d3fcc76cdf36cb.png\" width=\"1180\" height=\"1110\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d34\/225\/c09\/d34225c096b3bf12a5d3fcc76cdf36cb.png\"\/><\/figure>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 Go, \u043f\u0440\u044f\u043c\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Terraform. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043e provider-defined-\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u0432 \u0432\u0438\u0434\u0435\u043e <a href=\"https:\/\/www.youtube.com\/watch?v=6OXBv0MYalY\"><u>\u00abNative Lua (+more) in OpenTofu 1.7.0\u00bb<\/u><\/a>.<\/p>\n<h4>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 removed-\u0431\u043b\u043e\u043a\u043e\u0432\u00a0<\/h4>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 <a href=\"https:\/\/opentofu.org\/docs\/language\/resources\/syntax\/#removing-resources\"><u>\u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0438\u0437 state-\u0444\u0430\u0439\u043b\u0430 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/u><\/a>, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044f \u0438\u0445 \u0432 \u0440\u0430\u0437\u0432\u0451\u0440\u043d\u0443\u0442\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0443\u0434\u0430\u043b\u0438\u043c \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441 <code>yandex_compute_instance.vm_2<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0431\u043b\u043e\u043a <code>removed<\/code>:<\/p>\n<pre><code class=\"bash\">removed {   from = yandex_compute_instance.vm_2 }<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 OpenTofu \u043f\u043e\u043c\u0435\u0442\u0438\u0442 \u0440\u0435\u0441\u0443\u0440\u0441 \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044e \u0438\u0437 Terraform-state, \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u044f \u0435\u0433\u043e \u0438\u0437 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dd6\/cf1\/534\/dd6cf1534840c185695ad4cedb8e7c43.png\" width=\"1600\" height=\"252\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dd6\/cf1\/534\/dd6cf1534840c185695ad4cedb8e7c43.png\"\/><\/figure>\n<blockquote>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/strong><\/p>\n<p>\u041a\u0430\u043a \u0440\u0430\u0437 \u0438\u0437-\u0437\u0430 \u043a\u043e\u0434\u0430 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 HashiCorp <a href=\"https:\/\/habr.com\/ru\/companies\/flant\/articles\/807817\/\"><u>\u043e\u0431\u0432\u0438\u043d\u0438\u043b\u0430<\/u><\/a> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 OpenTofu \u0432 \u043f\u043b\u0430\u0433\u0438\u0430\u0442\u0435.<\/p>\n<\/blockquote>\n<h4>Loopable import blocks\u00a0<\/h4>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e <code>for_each<\/code> \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0432 Terraform. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"bash\">variable \"server_ids\" {   type = list(string) }  resource \"random_id\" \"test_id\" {   byte_length = 8   count = 2 }  import {   to = random_id.test_id[tonumber(each.key)]   id = each.value   for_each = {     for idx, item in var.server_ids: idx => item   } }  output \"id\" {   value = random_id.test_id.*.b64_url }<\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c ID:<\/p>\n<pre><code class=\"bash\">Outputs:  id = [   \"5bKi8T9ii1s\",   \"ztf4QbiyiRo\", ]<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <code>for_each<\/code> \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u043b\u0430\u0433\u0430 <code>-generate-config-out<\/code>:<\/p>\n<pre><code class=\"bash\">\u276f tofu plan -generate-config-out=gen.tf var.vm_ids   Enter a value: [\"fhm4itmi6agp8qmru1t9\", \"fhmehq41fusfbaet5e1p\"]  \u2577 \u2502 Error: Configuration generation for count and for_each resources not supported<\/code><\/pre>\n<h3>\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>\u041f\u043e \u0441\u043b\u043e\u0432\u0430\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, OpenTofu \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u0443\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 Terraform. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Terraform \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 <a href=\"https:\/\/opentofu.org\/faq\/#opentofu-compatibility\"><u>\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430<\/u><\/a>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, OpenTofu \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 Terraform. \u0424\u0438\u0447\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/github.com\/opentofu\/opentofu\/milestones\"><u>\u0434\u043e\u0440\u043e\u0436\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u0435<\/u><\/a>.<\/p>\n<p>\u0422\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0443\u0436\u0435 \u043d\u0430\u0447\u0430\u043b\u0438 \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c OpenTofu. \u0422\u0430\u043a, Oracle <a href=\"https:\/\/blogs.oracle.com\/ebsandoraclecloud\/post\/ebs-cloud-manager-24111-now-available\"><u>\u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0430<\/u><\/a> \u0441\u0432\u043e\u0439 EBS Cloud Manager \u0441 Terraform \u043d\u0430 OpenTofu. GitOps-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 FluxCD \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e <a href=\"https:\/\/fluxcd.io\/blog\/2024\/05\/flux-v2.3.0\/#terraform-provider-improvements\"><u>\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c<\/u><\/a> \u0441 OpenTofu. \u0410 \u0432 Grafana Labs <a href=\"https:\/\/github.com\/grafana\/opentofu-grafana-example\"><u>\u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442<\/u><\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 datasource OpenTofu, \u0430 \u043d\u0435 Terraform.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u0436\u043a\u0443 \u0434\u0451\u0433\u0442\u044f: \u043a\u0440\u043e\u043c\u0435 \u043e\u0431\u0432\u0438\u043d\u0435\u043d\u0438\u0439 \u043e\u0442 HashiCorp \u0432 \u043f\u043b\u0430\u0433\u0438\u0430\u0442\u0435 \u043a\u043e\u0434\u0430, OpenTofu, \u043f\u043e \u043c\u043d\u0435\u043d\u0438\u044e \u0447\u0430\u0441\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430, \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0435\u043c Terraform. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a Cristian M\u0103gheru\u0219an-Stanciu <a href=\"https:\/\/leanercloud.beehiiv.com\/p\/current-opentofu-contributors-vs-pledged-ftes\"><u>\u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b<\/u><\/a> \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445 OpenTofu \u0438 Terraform \u0438 \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u0437\u0430 \u043f\u043e\u043b\u0442\u043e\u0440\u0430 \u0433\u043e\u0434\u0430 \u0431\u043e\u0301\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043b\u0438\u0448\u044c \u0448\u0435\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u0445 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0448\u043b\u0430\u0441\u044c \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0430\u043d\u043e\u043d\u0441\u0430 OpenTofu.<\/p>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u044d\u0442\u043e, OpenTofu \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u0430\u044f Open Source-\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 Terraform. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0432\u043e \u00ab\u0424\u043b\u0430\u043d\u0442\u0435\u00bb \u0442\u043e\u0436\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c.<\/p>\n<h3>P. S.<\/h3>\n<p>\u0427\u0438\u0442\u0430\u0439\u0442\u0435 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043d\u0430\u0448 \u0431\u043b\u043e\u0433\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/flant\/news\/762356\/\"><u>\u041e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0444\u043e\u0440\u043a Terraform OpenTofu \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u043b \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c Linux Foundation<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/flant\/articles\/807817\/\"><u>HashiCorp \u043e\u0431\u0432\u0438\u043d\u0438\u043b\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e OpenTofu \u0432 \u043a\u0440\u0430\u0436\u0435 \u043a\u043e\u0434\u0430 Terraform, \u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/flant\/articles\/550974\/\"><u>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Terraformer \u0434\u043b\u044f \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432 AWS \u0434\u043b\u044f \u0434\u0435\u043f\u043b\u043e\u0435\u0432 \u0441 Terraform<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/820037\/\"> https:\/\/habr.com\/ru\/articles\/820037\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041d\u0430 \u0441\u0432\u044f\u0437\u0438 \u0414\u043c\u0438\u0442\u0440\u0438\u0439 \u0421\u0438\u043b\u043a\u0438\u043d, DevOps-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u00ab\u0424\u043b\u0430\u043d\u0442\u00bb. 30\u00a0\u0430\u043f\u0440\u0435\u043b\u044f \u0438\u0437 \u0431\u0435\u0442\u0430-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0448\u0435\u043b <a href=\"https:\/\/opentofu.org\/blog\/opentofu-1-7-0\/\"><u>OpenTofu 1.7.0<\/u><\/a>. \u042d\u0442\u043e Open Source-\u0444\u043e\u0440\u043a Terraform, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c <a href=\"https:\/\/www.linuxfoundation.org\/\"><u>Linux Foundation<\/u><\/a>. \u0420\u0430\u043d\u0435\u0435 \u043c\u044b \u0443\u0436\u0435 <a href=\"https:\/\/habr.com\/ru\/companies\/flant\/news\/762356\/\"><u>\u043f\u0438\u0441\u0430\u043b\u0438<\/u><\/a> \u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 OpenTofu, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 HashiCorp \u0432 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432. \u0412 \u044d\u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u0434\u0435\u043b\u0430\u044e \u043e\u0431\u0437\u043e\u0440 \u0432\u0435\u0440\u0441\u0438\u0438 1.7.0: \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e OpenTofu, \u0432\u044b\u043f\u043e\u043b\u043d\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441 Terraform, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 OpenTofu<\/h3>\n<p>\u0414\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 OpenTofu \u0443\u0436\u0435 <a href=\"https:\/\/opentofu.org\/docs\/intro\/install\/\"><u>\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d<\/u><\/a> \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c OpenTofu \u043d\u0430 macOS \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 Homebrew:<\/p>\n<pre><code class=\"bash\">brew update brew install opentofu<\/code><\/pre>\n<p>\u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e OpenTofu \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d:<\/p>\n<pre><code class=\"bash\">\u276f tofu -version OpenTofu v1.7.0 on darwin_arm64<\/code><\/pre>\n<h3>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Terraform<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 Terraform. \u0412 \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 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 Yandex Cloud, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e VPC, \u0434\u0432\u0443\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d \u0438 DNS-\u0437\u043e\u043d\u044b \u0441 \u0434\u0432\u0443\u043c\u044f A-\u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f:<\/p>\n<pre><code class=\"bash\">terraform {   required_providers {     yandex = {       source  = \"yandex-cloud\/yandex\"     }   }   required_version = \">= 0.13\" }  provider \"yandex\" {   zone      = \"ru-central1-a\" }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Terraform \u043f\u043e\u0447\u0442\u0438 <a href=\"https:\/\/opentofu.org\/docs\/intro\/migration\/\"><u>\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430<\/u><\/a>. \u0423 \u043d\u0430\u0441 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0440\u0430\u0437\u0432\u0451\u0440\u043d\u0443\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Terraform 1.8.3, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 OpenTofu 1.7.0.<\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b Terraform, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 Terraform-state \u043d\u0430\u0448\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">\u276f terraform plan data.yandex_compute_image.vm_2_image: Reading... data.yandex_compute_image.vm_1_image: Reading... yandex_vpc_address.vm_1_public_ip: Refreshing state... [id=e9b2ef4mkpojsu6lkba2] yandex_vpc_network.infra_network: Refreshing state... [id=enpr0clfntcn6k1ljc3l] yandex_vpc_address.vm_2_public_ip: Refreshing state... [id=e9bvv8ep3ick80l7t4td] data.yandex_compute_image.vm_1_image: Read complete after 0s [id=fd80bca9kcrb3ubq7eaf] data.yandex_compute_image.vm_2_image: Read complete after 0s [id=fd80bca9kcrb3ubq7eaf] yandex_dns_zone.dns_zone: Refreshing state... [id=dnsdv83jlsms5ckpea79] yandex_vpc_subnet.infra_subnet[2]: Refreshing state... [id=fl84b0cauja9rnf97mt3] yandex_vpc_subnet.infra_subnet[0]: Refreshing state... [id=e9b9o5fg8f8qfi9rsi5v] yandex_vpc_subnet.infra_subnet[1]: Refreshing state... [id=e2lfp68t0gj5d3te7fea] yandex_compute_instance.vm_1: Refreshing state... [id=fhmmv8hlqn52b1jcaj78] yandex_compute_instance.vm_2: Refreshing state... [id=fhmqqq3jrl1ertu5snq2] yandex_dns_recordset.vm_1_dns: Refreshing state... [id=dnsdv83jlsms5ckpea79\/vm-1.example.com.\/A] yandex_dns_recordset.vm_2_dns: Refreshing state... [id=dnsdv83jlsms5ckpea79\/vm-2.example.com.\/A]  No changes. Your infrastructure matches the configuration.  Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e <em>terraform apply<\/em>.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0431\u044d\u043a\u0430\u043f \u0444\u0430\u0439\u043b\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f Terraform-state.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u043b\u0430\u043d\u0443 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432\u044b\u0448\u0435 \u0432\u043d\u0435\u0441\u0451\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434 Terraform, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p>S3 Backend:<\/p>\n<ul>\n<li>\n<p>OpenTofu \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>skip_s3_checksum<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u0446\u0438\u044f <code>endpoints \u2192 sso<\/code> \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>AWS_ENDPOINT_URL<\/code><strong>, <\/strong>\u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Removed Blocks:<\/p>\n<ul>\n<li>\n<p>Removed-\u0431\u043b\u043e\u043a\u0438 \u0432 OpenTofu \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u043d\u0430\u0447\u0435, \u0447\u0435\u043c \u0432 Terraform. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u041d\u043e \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e <a href=\"https:\/\/opentofu.org\/docs\/intro\/migration\/terraform-1.8\/#removed-block\"><u>\u0443\u0434\u0430\u043b\u0438\u0442\u044c<\/u><\/a> \u0431\u043b\u043e\u043a lifecycle \u043b\u0438\u0431\u043e, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u0446\u0438\u044f <code>lifecycle \u2192 destroy = true<\/code>, \u0432\u0435\u0441\u044c removed-\u0431\u043b\u043e\u043a.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Testing Changes:<\/p>\n<ul>\n<li>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 <em>mock provider<\/em><a href=\"https:\/\/github.com\/opentofu\/opentofu\/issues\/1155\"><u>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442<\/u><\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 <em>terraform test <\/em>\u0438 <em>mock provider<\/em>, \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043d\u0443\u0436\u043d\u043e <a href=\"https:\/\/github.com\/opentofu\/opentofu\/issues\/1204\"><u>\u0441\u0434\u0435\u043b\u0430\u0442\u044c<\/u><\/a> \u0434\u043b\u044f <code>override_resource<\/code>, <code>override_data<\/code>, <code>override_module<\/code>.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e OpenTofu:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">\u276f tofu init  Initializing the backend...  Initializing provider plugins... - Finding latest version of yandex-cloud\/yandex... - Installing yandex-cloud\/yandex v0.118.0... - Installed yandex-cloud\/yandex v0.118.0. Signature validation was skipped due to the registry not containing GPG keys for this provider  OpenTofu has made some changes to the provider dependency selections recorded in the .terraform.lock.hcl file. Review those changes and commit them to your version control system if they represent changes you intended to make.  OpenTofu has been successfully initialized!  You may now begin working with OpenTofu. Try running \"tofu plan\" to see any changes that are required for your infrastructure. All OpenTofu commands should now work.  If you ever set or change modules or backend configuration for OpenTofu, rerun this command to reinitialize your working directory. If you forget, other commands will detect it and remind you to do so if necessary.<\/code><\/pre>\n<ol start=\"6\">\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">\u276f tofu plan yandex_vpc_network.infra_network: Refreshing state... [id=enpr0clfntcn6k1ljc3l] yandex_vpc_address.vm_2_public_ip: Refreshing state... [id=e9bvv8ep3ick80l7t4td] yandex_vpc_address.vm_1_public_ip: Refreshing state... [id=e9b2ef4mkpojsu6lkba2] data.yandex_compute_image.vm_2_image: Reading... data.yandex_compute_image.vm_1_image: Reading... data.yandex_compute_image.vm_2_image: Read complete after 1s [id=fd80bca9kcrb3ubq7eaf] data.yandex_compute_image.vm_1_image: Read complete after 1s [id=fd80bca9kcrb3ubq7eaf] yandex_dns_zone.dns_zone: Refreshing state... [id=dnsdv83jlsms5ckpea79] yandex_vpc_subnet.infra_subnet[2]: Refreshing state... [id=fl84b0cauja9rnf97mt3] yandex_vpc_subnet.infra_subnet[1]: Refreshing state... [id=e2lfp68t0gj5d3te7fea] yandex_vpc_subnet.infra_subnet[0]: Refreshing state... [id=e9b9o5fg8f8qfi9rsi5v] yandex_compute_instance.vm_1: Refreshing state... [id=fhmmv8hlqn52b1jcaj78] yandex_compute_instance.vm_2: Refreshing state... [id=fhmqqq3jrl1ertu5snq2] yandex_dns_recordset.vm_1_dns: Refreshing state... [id=dnsdv83jlsms5ckpea79\/vm-1.example.com.\/A] yandex_dns_recordset.vm_2_dns: Refreshing state... [id=dnsdv83jlsms5ckpea79\/vm-2.example.com.\/A]  No changes. Your infrastructure matches the configuration.  OpenTofu has compared your real infrastructure against your configuration and found no differences, so no changes are needed.<\/code><\/pre>\n<ol start=\"7\">\n<li>\n<p>OpenTofu \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">\u276f tofu apply data.yandex_compute_image.vm_1_image: Reading... yandex_vpc_address.vm_2_public_ip: Refreshing state... [id=e9bvv8ep3ick80l7t4td] data.yandex_compute_image.vm_2_image: Reading... yandex_vpc_network.infra_network: Refreshing state... [id=enpr0clfntcn6k1ljc3l] yandex_vpc_address.vm_1_public_ip: Refreshing state... [id=e9b2ef4mkpojsu6lkba2] data.yandex_compute_image.vm_2_image: Read complete after 1s [id=fd80bca9kcrb3ubq7eaf] data.yandex_compute_image.vm_1_image: Read complete after 1s [id=fd80bca9kcrb3ubq7eaf] yandex_dns_zone.dns_zone: Refreshing state... [id=dnsdv83jlsms5ckpea79] yandex_vpc_subnet.infra_subnet[0]: Refreshing state... [id=e9b9o5fg8f8qfi9rsi5v] yandex_vpc_subnet.infra_subnet[2]: Refreshing state... [id=fl84b0cauja9rnf97mt3] yandex_vpc_subnet.infra_subnet[1]: Refreshing state... [id=e2lfp68t0gj5d3te7fea] yandex_compute_instance.vm_2: Refreshing state... [id=fhmqqq3jrl1ertu5snq2] yandex_compute_instance.vm_1: Refreshing state... [id=fhmmv8hlqn52b1jcaj78] yandex_dns_recordset.vm_2_dns: Refreshing state... [id=dnsdv83jlsms5ckpea79\/vm-2.example.com.\/A] yandex_dns_recordset.vm_1_dns: Refreshing state... [id=dnsdv83jlsms5ckpea79\/vm-1.example.com.\/A]  No changes. Your infrastructure matches the configuration.  OpenTofu has compared your real infrastructure against your configuration and found no differences, so no changes are needed.  Apply complete! Resources: 0 added, 0 changed, 0 destroyed.  Outputs:  vm_1_address = \"&lt;ip 1>\" vm_1_name = \"vm-1\" vm_2_address = \"&lt;ip 2>\" vm_2_name = \"vm-2\"<\/code><\/pre>\n<ol start=\"8\">\n<li>\n<p>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c OpenTofu. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0432 \u0447\u0451\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0431\u044d\u043a\u0430\u043f\u043e\u043c Terraform-state \u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u043c:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">\u276f diff state tofu_state 3,4c3,4 &lt;   \"terraform_version\": \"1.8.3\", &lt;   \"serial\": 4, --- >   \"terraform_version\": \"1.7.0\", >   \"serial\": 5, 29c29 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 59c59 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 89c89 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 205c205 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 321c321 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 350c350 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 379c379 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 410c410 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 444c444 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 478c478 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\", 506c506 &lt;       \"provider\": \"provider[\\\"registry.terraform.io\/yandex-cloud\/yandex\\\"]\", --- >       \"provider\": \"provider[\\\"registry.opentofu.org\/yandex-cloud\/yandex\\\"]\",<\/code><\/pre>\n<p>\u0420\u0430<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-379815","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/379815","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=379815"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/379815\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=379815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=379815"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=379815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}