Skip to content

Commit

Permalink
Add v6 migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
sel-bukharov committed Nov 21, 2024
1 parent a8af1fe commit 5946216
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions website/docs/guides/upgrading_to_version_6.html.markdown
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
```

0 comments on commit 5946216

Please sign in to comment.