From 594621698e837c125245f9217564c220b43069d9 Mon Sep 17 00:00:00 2001 From: Viktor Bukharov Date: Tue, 19 Nov 2024 12:47:02 +0800 Subject: [PATCH] Add v6 migration guide --- .../upgrading_to_version_6.html.markdown | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 website/docs/guides/upgrading_to_version_6.html.markdown diff --git a/website/docs/guides/upgrading_to_version_6.html.markdown b/website/docs/guides/upgrading_to_version_6.html.markdown new file mode 100644 index 00000000..0d09dfa2 --- /dev/null +++ b/website/docs/guides/upgrading_to_version_6.html.markdown @@ -0,0 +1,90 @@ +--- +layout: "selectel" +page_title: "Upgrading Terraform Selectel Provider to version 6.0.0" +sidebar_current: "docs-selectel-guide-iam-migrating-guide" +description: |- + How to upgrade Terraform Selectel Provider to version 6.0.0. +--- + +# Upgrading Terraform Selectel Provider to version 6.0.0 + +In version 6.0.0, Terraform Selectel Provider introduces deprecated API resources removal +and some setup changes. + +Removed resources: + +- selectel_vpc_role_v2 +- selectel_vpc_token_v2 +- selectel_vpc_user_v2 +- selectel_vpc_vrrp_subnet_v2 +- selectel_vpc_crossregion_subnet_v2 + +Before upgrading to version 6.0.0, [upgrade to the most recent 5.X version of the provider](https://registry.terraform.io/providers/selectel/selectel/latest/docs/guides/upgrading_to_version_5) and ensure that your environment successfully runs `terraform plan`. You should not see changes you do not expect or deprecation notices. + +## Required changes + +1. In the Terraform configuration(`.tf` files), update the version constraints: + + ```hcl + terraform { + required_providers { + selectel = { + source = "selectel/selectel" + version = "~> 6.0" + } + openstack = { + source = "terraform-provider-openstack/openstack" + version = "1.54.0" + } + } + } + ``` + +2. Add required authentification parameters `auth_region` and `auth_url` to configuration if they don't exist: + +```hcl + +provider "selectel" { + domain_name = "123456" + username = "user" + password = "password" + auth_region = "pool" + auth_url = "https://cloud.api.selcloud.ru/identity/v3/" +} + +``` + +3. If you use environment variables `SEL_PROJECT_ID` or `SEL_REGION` you must rename them as `INFRA_PROJECT_ID` and `INFRA_REGION` respectively. +4. To download the new version, initialize the Terraform configuration. + + ```bash + terraform init -upgrade + ``` + +## Optional changes (if you using deprecated resources) + +1. Backup the `.tfstate` file. +2. Remove the `selectel_vpc_vrrp_subnet_v2` resource from the `.tfstate` file: + + ```bash + terraform state rm $(terraform state list | grep selectel_vpc_vrrp_subnet_v2) + ``` + +3. Remove the `selectel_vpc_crossregion_subnet_v2` resource from the `.tfstate` file: + + ```bash + terraform state rm $(terraform state list | grep selectel_vpc_crossregion_subnet_v2) + ``` + +4. In the configuration files, remove `selectel_vpc_vrrp_subnet_v2` and `selectel_vpc_crossregion_subnet_v2` resources. +5. To ensure that Terraform has no unwanted changes: + + ```bash + terraform plan + ``` + +6. Apply the changes: + + ```bash + terraform apply + ```