-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8af1fe
commit 5946216
Showing
1 changed file
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |