diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index 407804f8..96064533 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -4,7 +4,7 @@ on: branches: - master schedule: - - cron: '0 0 * * *' + - cron: "0 0 * * *" jobs: acceptance-test: @@ -19,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.22.7' + go-version: "1.23" - name: Set up Terraform uses: hashicorp/setup-terraform@v2 @@ -30,5 +30,5 @@ jobs: run: make testacc env: OS_DOMAIN_NAME: ${{ secrets.OS_DOMAIN_NAME }} - OS_USERNAME: ${{ secrets.OS_USERNAME }} - OS_PASSWORD: ${{ secrets.OS_PASSWORD }} + OS_USERNAME: ${{ secrets.OS_USERNAME }} + OS_PASSWORD: ${{ secrets.OS_PASSWORD }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c763157d..737c4813 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ name: Release on: push: tags: - - 'v*' + - "v*" jobs: goreleaser: @@ -23,7 +23,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.22.7' + go-version: "1.23" - name: Import GPG key id: import_gpg diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 0eaa0bce..325e7739 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.22.7' + go-version: "1.23" - run: make test golangci-lint: @@ -22,10 +22,10 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.22.7' + go-version: "1.23" - uses: golangci/golangci-lint-action@v6 with: - version: v1.56.2 + version: v1.62.0 tidy: runs-on: ubuntu-24.04 @@ -33,6 +33,6 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.22.7' + go-version: "1.23" - run: go mod tidy -v - run: git diff --exit-code diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d87aa52..c5a796b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +## 6.0.0 (Dec 2, 2024) + +BREAKING CHANGES: + +* Configuration parameters `auth_region` and `auth_url` are made mandatory + for the provider configuration ([#313](https://github.com/selectel/terraform-provider-selectel/pull/313)) +* Renamed environment variables for resources: + * `SEL_PROJECT_ID` -> `INFRA_PROJECT_ID` + * `SEL_REGION` -> `INFRA_REGION` +* Removed deprecated resources ([#313](https://github.com/selectel/terraform-provider-selectel/pull/313)): + * `selectel_vpc_role_v2` + * `selectel_vpc_token_v2` + * `selectel_vpc_user_v2` + * `selectel_vpc_vrrp_subnet_v2` + * `selectel_vpc_crossregion_subnet_v2` + +IMPROVEMENTS: + +* Added migration guide to upgrade to new major v6 version ([#313](https://github.com/selectel/terraform-provider-selectel/pull/313)) +* Updated docs ([#313](https://github.com/selectel/terraform-provider-selectel/pull/313)) + ## 5.5.0 (Dec 2, 2024) FEATURES: diff --git a/README.md b/README.md index 37c34e1d..ca57e8c0 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,12 @@ -Terraform Selectel Provider -========================= +# Terraform Selectel Provider -- Website: https://www.terraform.io -- [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby) -- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool) +* Website: +* [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby) +* Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool) Terraform Selectel Provider -Maintainers ------------ +## Maintainers This provider plugin is maintained by: @@ -17,63 +15,58 @@ This provider plugin is maintained by: * Ilya Kulakov ([@TawR1024](https://github.com/TawR1024)) * Tatyana Voloshina ([@T-Sh](https://github.com/T-Sh)) -Requirements ------------- +## Requirements -- [Terraform](https://www.terraform.io/downloads.html) 0.12.x -- [Go](https://golang.org/doc/install) 1.22 (to build the provider plugin) +* [Terraform](https://www.terraform.io/downloads.html) 0.12.x +* [Go](https://golang.org/doc/install) 1.23 (to build the provider plugin) -Building The Provider ---------------------- +## Building The Provider Clone the repository ```sh -$ git clone git@github.com:selectel/terraform-provider-selectel.git +git clone git@github.com:selectel/terraform-provider-selectel.git ``` Enter the provider directory and build the provider ```sh -$ cd terraform-provider-selectel -$ make build +cd terraform-provider-selectel +make build ``` -Using the provider ----------------------- +## Using the provider Getting Started with Terraform at Selectel: [kb.selectel.com](https://kb.selectel.com/docs/selectel-cloud-platform/main-services/instructions/how_to_use_terraform/). Documentation is available at: [docs/providers/selectel](https://www.terraform.io/docs/providers/selectel/index.html). You can find examples in this repository: [examples](https://github.com/terraform-providers/terraform-provider-selectel/tree/master/examples). Also there are lots of examples in the [selectel/terraform-examples](https://github.com/selectel/terraform-examples). -Developing the Provider ---------------------------- +## Developing the Provider -If you wish to work on the provider, you'll first need [Go](https://golang.org) installed on your machine (version 1.17+ is *required*). +If you wish to work on the provider, you'll first need [Go](https://golang.org) installed on your machine (version 1.17+ is _required_). To compile the provider, run `make build`. This will build the provider and put the provider binary in the current directory. ```sh -$ make build +make build ``` In order to test the provider, you can simply run `make test`. ```sh -$ make test +make test ``` In order to run the full suite of Acceptance tests, run `make testacc`. -*Note:* Acceptance tests create real resources, and often cost money to run. +_Note:_ Acceptance tests create real resources, and often cost money to run. ```sh -$ make testacc +make testacc ``` -Releasing the Provider ----------------------- +## Releasing the Provider This repository contains a GitHub Action configured to automatically build and publish assets for release when a tag is pushed that matches the pattern `v*` diff --git a/go.mod b/go.mod index 96c524a7..b1425933 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,14 @@ module github.com/terraform-providers/terraform-provider-selectel -go 1.22.7 +go 1.23 require ( - github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-retryablehttp v0.7.7 github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 github.com/selectel/craas-go v0.3.0 github.com/selectel/dbaas-go v0.12.1 github.com/selectel/domains-go v1.0.2 - github.com/selectel/go-selvpcclient/v3 v3.2.1 + github.com/selectel/go-selvpcclient/v4 v4.0.0 github.com/selectel/iam-go v0.4.1 github.com/selectel/mks-go v0.17.0 github.com/selectel/secretsmanager-go v0.2.1 @@ -29,6 +28,7 @@ require ( github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-plugin v1.4.6 // indirect diff --git a/go.sum b/go.sum index 8f372fec..3322838e 100644 --- a/go.sum +++ b/go.sum @@ -168,8 +168,8 @@ github.com/selectel/dbaas-go v0.12.1 h1:u3mBMoHP/FnHucLqd1QBeBHjQ2WV4S88ewP97gCE github.com/selectel/dbaas-go v0.12.1/go.mod h1:Ffq6RQ4PmgZX8eL9oXsaKDc0lzbCK9wadyDV6AHaz/k= github.com/selectel/domains-go v1.0.2 h1:Si6iGaMnTFJxwiJVI50DOdZnwcxc87kqaWrVQYW0a4U= github.com/selectel/domains-go v1.0.2/go.mod h1:SugRKfq4sTpnOHquslCpzda72wV8u0cMBHx0C0l+bzA= -github.com/selectel/go-selvpcclient/v3 v3.2.1 h1:ny6WIAMiHzKxOgOEnwcWE79wIQij1AHHylzPA41MXCw= -github.com/selectel/go-selvpcclient/v3 v3.2.1/go.mod h1:3EfSf8aEWyhspOGbvZ6mvnFg7JN5uckxNyBFPGWsXNQ= +github.com/selectel/go-selvpcclient/v4 v4.0.0 h1:5HorF8n6u/4BUh2+cJEysmXhMOB9epGgrKluLonPlM0= +github.com/selectel/go-selvpcclient/v4 v4.0.0/go.mod h1:eFhL1KUW159KOJVeGO7k/Uxl0TYd/sBkWXjuF5WxmYk= github.com/selectel/iam-go v0.4.1 h1:grncCGkPVCM6nwqSTk+q15M5ZO6S/Pe0AIbbmKtm6gU= github.com/selectel/iam-go v0.4.1/go.mod h1:OIAkW7MZK97YUm+uvUgYbgDhkI9SdzTCxwd4yZoOR1o= github.com/selectel/mks-go v0.17.0 h1:fYyIuB/K+TJJDy50Bl7z52SrogYCdekpKPaRc0pDi+M= diff --git a/selectel/config.go b/selectel/config.go index fc586921..7bfb2d91 100644 --- a/selectel/config.go +++ b/selectel/config.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/selectel/go-selvpcclient/v3/selvpcclient" + "github.com/selectel/go-selvpcclient/v4/selvpcclient" ) var ( @@ -37,12 +37,8 @@ func getConfig(d *schema.ResourceData) (*Config, diag.Diagnostics) { Username: d.Get("username").(string), Password: d.Get("password").(string), DomainName: d.Get("domain_name").(string), - } - if v, ok := d.GetOk("auth_url"); ok { - cfgSingletone.AuthURL = v.(string) - } - if v, ok := d.GetOk("auth_region"); ok { - cfgSingletone.AuthRegion = v.(string) + AuthURL: d.Get("auth_url").(string), + AuthRegion: d.Get("auth_region").(string), } if v, ok := d.GetOk("user_domain_name"); ok { cfgSingletone.UserDomainName = v.(string) diff --git a/selectel/craas.go b/selectel/craas.go index a7cdccd6..be765157 100644 --- a/selectel/craas.go +++ b/selectel/craas.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" v1 "github.com/selectel/craas-go/pkg" "github.com/selectel/craas-go/pkg/v1/registry" - "github.com/selectel/go-selvpcclient/v3/selvpcclient" + "github.com/selectel/go-selvpcclient/v4/selvpcclient" ) const ( diff --git a/selectel/data_source_selectel_dbaas_available_extension_v1_test.go b/selectel/data_source_selectel_dbaas_available_extension_v1_test.go index 937c956b..9bbf30cc 100644 --- a/selectel/data_source_selectel_dbaas_available_extension_v1_test.go +++ b/selectel/data_source_selectel_dbaas_available_extension_v1_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSAvailableExtensionsV1Basic(t *testing.T) { diff --git a/selectel/data_source_selectel_dbaas_configuration_parameter_v1_test.go b/selectel/data_source_selectel_dbaas_configuration_parameter_v1_test.go index fd74c395..3e6da3dd 100644 --- a/selectel/data_source_selectel_dbaas_configuration_parameter_v1_test.go +++ b/selectel/data_source_selectel_dbaas_configuration_parameter_v1_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSConfigurationParametersV1Basic(t *testing.T) { diff --git a/selectel/data_source_selectel_dbaas_datastore_type_v1_test.go b/selectel/data_source_selectel_dbaas_datastore_type_v1_test.go index b181a4d9..c5816b45 100644 --- a/selectel/data_source_selectel_dbaas_datastore_type_v1_test.go +++ b/selectel/data_source_selectel_dbaas_datastore_type_v1_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSDatastoreTypesV1Basic(t *testing.T) { diff --git a/selectel/data_source_selectel_dbaas_flavor_v1_test.go b/selectel/data_source_selectel_dbaas_flavor_v1_test.go index 5000f4c7..aa6f1f0b 100644 --- a/selectel/data_source_selectel_dbaas_flavor_v1_test.go +++ b/selectel/data_source_selectel_dbaas_flavor_v1_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSFlavorsV1Basic(t *testing.T) { diff --git a/selectel/data_source_selectel_dbaas_prometheus_metric_token_v1_test.go b/selectel/data_source_selectel_dbaas_prometheus_metric_token_v1_test.go index 49051da0..85b1eddd 100644 --- a/selectel/data_source_selectel_dbaas_prometheus_metric_token_v1_test.go +++ b/selectel/data_source_selectel_dbaas_prometheus_metric_token_v1_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSDataSourcePrometheusMetricTokenV1Basic(t *testing.T) { diff --git a/selectel/data_source_selectel_mks_kube_options_test.go b/selectel/data_source_selectel_mks_kube_options_test.go index d4052dec..a0a8f6bf 100644 --- a/selectel/data_source_selectel_mks_kube_options_test.go +++ b/selectel/data_source_selectel_mks_kube_options_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) const ( diff --git a/selectel/domains_v2.go b/selectel/domains_v2.go index 062055c8..2b0bc37b 100644 --- a/selectel/domains_v2.go +++ b/selectel/domains_v2.go @@ -14,7 +14,7 @@ import ( domainsV2 "github.com/selectel/domains-go/pkg/v2" ) -var ErrProjectIDNotSetupForDNSV2 = errors.New("env variable SEL_PROJECT_ID or variable project_id must be set for the dns v2") +var ErrProjectIDNotSetupForDNSV2 = errors.New("env variable INFRA_PROJECT_ID or variable project_id must be set for the dns v2") func getDomainsV2Client(d *schema.ResourceData, meta interface{}) (domainsV2.DNSClient[domainsV2.Zone, domainsV2.RRSet], error) { config := meta.(*Config) diff --git a/selectel/iam.go b/selectel/iam.go index fcd00400..021f0a97 100644 --- a/selectel/iam.go +++ b/selectel/iam.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/selectel/go-selvpcclient/v3/selvpcclient" + "github.com/selectel/go-selvpcclient/v4/selvpcclient" "github.com/selectel/iam-go" "github.com/selectel/iam-go/service/roles" "github.com/selectel/iam-go/service/users" diff --git a/selectel/import_selectel_domains_rrset_v2_test.go b/selectel/import_selectel_domains_rrset_v2_test.go index ae7aecf8..0adc29d8 100644 --- a/selectel/import_selectel_domains_rrset_v2_test.go +++ b/selectel/import_selectel_domains_rrset_v2_test.go @@ -12,7 +12,7 @@ import ( ) func TestAccDomainsRRSetV2ImportBasic(t *testing.T) { - projectID := os.Getenv("SEL_PROJECT_ID") + projectID := os.Getenv("INFRA_PROJECT_ID") testZoneName := fmt.Sprintf("%s.xyz.", acctest.RandomWithPrefix("tf-acc")) testRRSetName := fmt.Sprintf("%[1]s.%[2]s", acctest.RandomWithPrefix("tf-acc"), testZoneName) testRRSetType := domainsV2.TXT diff --git a/selectel/import_selectel_domains_zone_v2_test.go b/selectel/import_selectel_domains_zone_v2_test.go index 1ee1695d..6ebda15e 100644 --- a/selectel/import_selectel_domains_zone_v2_test.go +++ b/selectel/import_selectel_domains_zone_v2_test.go @@ -11,7 +11,7 @@ import ( ) func TestAccDomainsZoneV2ImportBasic(t *testing.T) { - projectID := os.Getenv("SEL_PROJECT_ID") + projectID := os.Getenv("INFRA_PROJECT_ID") fullResourceName := fmt.Sprintf("selectel_domains_zone_v2.%[1]s", resourceZoneName) testZoneName := fmt.Sprintf("%s.xyz.", acctest.RandomWithPrefix("tf-acc")) resource.Test(t, resource.TestCase{ diff --git a/selectel/import_selectel_iam_user_v1_test.go b/selectel/import_selectel_iam_user_v1_test.go index d69d24ee..bf38d110 100644 --- a/selectel/import_selectel_iam_user_v1_test.go +++ b/selectel/import_selectel_iam_user_v1_test.go @@ -9,7 +9,6 @@ import ( func TestAccIAMV1UserImportBasic(t *testing.T) { resourceName := "selectel_iam_user_v1.user_tf_acc_test_1" - //nolint:goconst userEmail := acctest.RandomWithPrefix("tf-acc") + "@example.com" resource.Test(t, resource.TestCase{ diff --git a/selectel/import_selectel_secretsmanager_certificate_v1_test.go b/selectel/import_selectel_secretsmanager_certificate_v1_test.go index 8df3efde..4a8a87b2 100644 --- a/selectel/import_selectel_secretsmanager_certificate_v1_test.go +++ b/selectel/import_selectel_secretsmanager_certificate_v1_test.go @@ -14,7 +14,7 @@ import ( ) func TestAccSecretsManagerCertificateV1ImportBasic(t *testing.T) { - projectID := os.Getenv("SEL_PROJECT_ID") + projectID := os.Getenv("INFRA_PROJECT_ID") resourceName := "selectel_secretsmanager_certificate_v1.certificate_tf_acc_test_1" certificateName := acctest.RandomWithPrefix("tf-acc") diff --git a/selectel/import_selectel_secretsmanager_secret_v1_test.go b/selectel/import_selectel_secretsmanager_secret_v1_test.go index 9987969a..32e5c4e5 100644 --- a/selectel/import_selectel_secretsmanager_secret_v1_test.go +++ b/selectel/import_selectel_secretsmanager_secret_v1_test.go @@ -14,7 +14,7 @@ import ( ) func TestAccSecretsManagerSecretV1ImportBasic(t *testing.T) { - projectID := os.Getenv("SEL_PROJECT_ID") + projectID := os.Getenv("INFRA_PROJECT_ID") resourceName := "selectel_secretsmanager_secret_v1.secret_tf_acc_test_1" diff --git a/selectel/messages_test.go b/selectel/messages_test.go index 92c8c708..3fab7288 100644 --- a/selectel/messages_test.go +++ b/selectel/messages_test.go @@ -3,7 +3,7 @@ package selectel import ( "testing" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/keypairs" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/keypairs" "github.com/stretchr/testify/assert" ) diff --git a/selectel/mks.go b/selectel/mks.go index 43339196..bef2dada 100644 --- a/selectel/mks.go +++ b/selectel/mks.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/quotamanager/quotas" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/quotamanager/quotas" v1 "github.com/selectel/mks-go/pkg/v1" "github.com/selectel/mks-go/pkg/v1/cluster" "github.com/selectel/mks-go/pkg/v1/kubeoptions" @@ -68,20 +68,20 @@ func mksClusterV1StateRefreshFunc( } } -func mksClusterV1KubeVersionDiffSuppressFunc(_, old, new string, d *schema.ResourceData) bool { +func mksClusterV1KubeVersionDiffSuppressFunc(_, oldVersion, newVersion string, d *schema.ResourceData) bool { if d.Id() == "" { return false } - currentMajor, err := kubeVersionToMajor(old) + currentMajor, err := kubeVersionToMajor(oldVersion) if err != nil { - log.Printf("[DEBUG] error getting a major part of the current kube version %s: %s", old, err) + log.Printf("[DEBUG] error getting a major part of the current kube version %s: %s", oldVersion, err) return false } - desiredMajor, err := kubeVersionToMajor(new) + desiredMajor, err := kubeVersionToMajor(newVersion) if err != nil { - log.Printf("[DEBUG] error getting a major part of the desired kube version %s: %s", new, err) + log.Printf("[DEBUG] error getting a major part of the desired kube version %s: %s", newVersion, err) return false } @@ -96,15 +96,15 @@ func mksClusterV1KubeVersionDiffSuppressFunc(_, old, new string, d *schema.Resou return true } - currentMinor, err := kubeVersionToMinor(old) + currentMinor, err := kubeVersionToMinor(oldVersion) if err != nil { - log.Printf("[DEBUG] error getting a minor part of the current kube version %s: %s", old, err) + log.Printf("[DEBUG] error getting a minor part of the current kube version %s: %s", oldVersion, err) return false } - desiredMinor, err := kubeVersionToMinor(new) + desiredMinor, err := kubeVersionToMinor(newVersion) if err != nil { - log.Printf("[DEBUG] error getting a minor part of the desired kube version %s: %s", new, err) + log.Printf("[DEBUG] error getting a minor part of the desired kube version %s: %s", newVersion, err) return false } @@ -119,15 +119,15 @@ func mksClusterV1KubeVersionDiffSuppressFunc(_, old, new string, d *schema.Resou return true } - currentPatch, err := kubeVersionToPatch(old) + currentPatch, err := kubeVersionToPatch(oldVersion) if err != nil { - log.Printf("[DEBUG] error getting a patch part of the current kube version %s: %s", old, err) + log.Printf("[DEBUG] error getting a patch part of the current kube version %s: %s", oldVersion, err) return false } - desiredPatch, err := kubeVersionToPatch(new) + desiredPatch, err := kubeVersionToPatch(newVersion) if err != nil { - log.Printf("[DEBUG] error getting a patch part of the desired kube version %s: %s", new, err) + log.Printf("[DEBUG] error getting a patch part of the desired kube version %s: %s", newVersion, err) return true } diff --git a/selectel/mks_test.go b/selectel/mks_test.go index 6a5f9e67..2a023b2d 100644 --- a/selectel/mks_test.go +++ b/selectel/mks_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/quotamanager/quotas" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/quotamanager/quotas" v1 "github.com/selectel/mks-go/pkg/v1" "github.com/selectel/mks-go/pkg/v1/kubeversion" "github.com/selectel/mks-go/pkg/v1/node" diff --git a/selectel/networking.go b/selectel/networking.go index 6607e582..c535934f 100644 --- a/selectel/networking.go +++ b/selectel/networking.go @@ -5,9 +5,8 @@ import ( "strconv" "strings" - "github.com/selectel/go-selvpcclient/v3/selvpcclient" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/subnets" - "github.com/terraform-providers/terraform-provider-selectel/selectel/internal/hashcode" + "github.com/selectel/go-selvpcclient/v4/selvpcclient" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/subnets" ) func getPrefixLengthFromCIDR(cidr string) (int, error) { @@ -53,9 +52,3 @@ func subnetsMapsFromStructs(subnetsStructs []subnets.Subnet) []map[string]interf return associatedSubnets } - -// hashSubnets is a hash function to use with the "subnet" set. -func hashSubnets(v interface{}) int { - m := v.(map[string]interface{}) - return hashcode.String(fmt.Sprintf("%s-", m["network_id"].(string))) -} diff --git a/selectel/networking_test.go b/selectel/networking_test.go index a4ad9e14..37476585 100644 --- a/selectel/networking_test.go +++ b/selectel/networking_test.go @@ -3,8 +3,8 @@ package selectel import ( "testing" - "github.com/selectel/go-selvpcclient/v3/selvpcclient" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/subnets" + "github.com/selectel/go-selvpcclient/v4/selvpcclient" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/subnets" "github.com/stretchr/testify/assert" ) diff --git a/selectel/project.go b/selectel/project.go index 7399266a..d1873e3f 100644 --- a/selectel/project.go +++ b/selectel/project.go @@ -7,9 +7,9 @@ import ( "net/url" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/quotamanager/quotas" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" - resellQuotas "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/quotas" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/quotamanager/quotas" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" + resellQuotas "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/quotas" "github.com/terraform-providers/terraform-provider-selectel/selectel/internal/hashcode" ) diff --git a/selectel/project_test.go b/selectel/project_test.go index 8a7809ef..d5b361a4 100644 --- a/selectel/project_test.go +++ b/selectel/project_test.go @@ -3,7 +3,7 @@ package selectel import ( "testing" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" "github.com/stretchr/testify/assert" ) diff --git a/selectel/provider.go b/selectel/provider.go index e2de9e1a..a03d44aa 100644 --- a/selectel/provider.go +++ b/selectel/provider.go @@ -8,11 +8,6 @@ import ( "github.com/terraform-providers/terraform-provider-selectel/selectel/internal/mutexkv" ) -const ( - // Pool where the endpoint for Keystone API and Resell API is located. - DefaultAuthRegion = "ru-1" -) - const ( objectACL = "acl" objectFloatingIP = "floating IP" @@ -67,26 +62,26 @@ func Provider() *schema.Provider { "project_id": { Type: schema.TypeString, Optional: true, - DefaultFunc: schema.EnvDefaultFunc("SEL_PROJECT_ID", nil), + DefaultFunc: schema.EnvDefaultFunc("INFRA_PROJECT_ID", nil), Description: "VPC project ID to import resources that need the project scope auth token.", }, "region": { Type: schema.TypeString, Optional: true, - DefaultFunc: schema.EnvDefaultFunc("SEL_REGION", nil), + DefaultFunc: schema.EnvDefaultFunc("INFRA_REGION", nil), Description: "VPC region to import resources associated with the specific region.", }, "auth_url": { Type: schema.TypeString, - Optional: true, + Required: true, DefaultFunc: schema.EnvDefaultFunc("OS_AUTH_URL", nil), - Description: "Base url to work with auth API (Keystone URL). https://api.selvpc.ru/identity/v3/ used by default", + Description: "Base url to work with auth API (Keystone URL).", }, "auth_region": { Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("OS_REGION_NAME", DefaultAuthRegion), - Description: "Region for Keystone and Resell API URLs, 'ru-1' is used by default.", + Required: true, + DefaultFunc: schema.EnvDefaultFunc("OS_REGION_NAME", nil), + Description: "Region for Keystone and Resell API URLs.", }, "domain_name": { Type: schema.TypeString, @@ -132,10 +127,7 @@ func Provider() *schema.Provider { "selectel_vpc_keypair_v2": resourceVPCKeypairV2(), "selectel_vpc_license_v2": resourceVPCLicenseV2(), "selectel_vpc_project_v2": resourceVPCProjectV2(), - "selectel_vpc_role_v2": resourceVPCRoleV2(), // DEPRECATED "selectel_vpc_subnet_v2": resourceVPCSubnetV2(), - "selectel_vpc_token_v2": resourceVPCTokenV2(), // DEPRECATED - "selectel_vpc_user_v2": resourceVPCUserV2(), // DEPRECATED "selectel_iam_serviceuser_v1": resourceIAMServiceUserV1(), "selectel_iam_user_v1": resourceIAMUserV1(), "selectel_iam_s3_credentials_v1": resourceIAMS3CredentialsV1(), @@ -143,8 +135,6 @@ func Provider() *schema.Provider { "selectel_iam_saml_federation_certificate_v1": resourceIAMSAMLFederationCertificateV1(), "selectel_iam_group_v1": resourceIAMGroupV1(), "selectel_iam_group_membership_v1": resourceIAMGroupMembershipV1(), - "selectel_vpc_vrrp_subnet_v2": resourceVPCVRRPSubnetV2(), // DEPRECATED - "selectel_vpc_crossregion_subnet_v2": resourceVPCCrossRegionSubnetV2(), // DEPRECATED "selectel_mks_cluster_v1": resourceMKSClusterV1(), "selectel_mks_nodegroup_v1": resourceMKSNodegroupV1(), "selectel_domains_domain_v1": resourceDomainsDomainV1(), diff --git a/selectel/provider_test.go b/selectel/provider_test.go index 63ba8d82..510b34e4 100644 --- a/selectel/provider_test.go +++ b/selectel/provider_test.go @@ -47,8 +47,8 @@ func testAccSelectelPreCheck(t *testing.T) { func testAccSelectelPreCheckWithProjectID(t *testing.T) { testAccSelectelPreCheck(t) - if v := os.Getenv("SEL_PROJECT_ID"); v == "" { - t.Fatal("SEL_PROJECT_ID must be set for acceptance tests") + if v := os.Getenv("INFRA_PROJECT_ID"); v == "" { + t.Fatal("INFRA_PROJECT_ID must be set for acceptance tests") } } @@ -70,11 +70,11 @@ func testAccCheckSelectelImportEnv(resourceName string) resource.TestCheckFunc { region = v } - if err := os.Setenv("SEL_PROJECT_ID", projectID); err != nil { - return fmt.Errorf("error setting SEL_PROJECT_ID: %s", err) + if err := os.Setenv("INFRA_PROJECT_ID", projectID); err != nil { + return fmt.Errorf("error setting INFRA_PROJECT_ID: %s", err) } - if err := os.Setenv("SEL_REGION", region); err != nil { - return fmt.Errorf("error setting SEL_REGION: %s", err) + if err := os.Setenv("INFRA_REGION", region); err != nil { + return fmt.Errorf("error setting INFRA_REGION: %s", err) } return nil @@ -97,8 +97,8 @@ func testAccCheckSelectelCRaaSImportEnv(resourceName string) resource.TestCheckF projectID = v } - if err := os.Setenv("SEL_PROJECT_ID", projectID); err != nil { - return fmt.Errorf("error setting SEL_PROJECT_ID: %s", err) + if err := os.Setenv("INFRA_PROJECT_ID", projectID); err != nil { + return fmt.Errorf("error setting INFRA_PROJECT_ID: %s", err) } return nil diff --git a/selectel/regions.go b/selectel/regions.go index cd82f773..fc00376a 100644 --- a/selectel/regions.go +++ b/selectel/regions.go @@ -4,8 +4,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/selectel/go-selvpcclient/v3/selvpcclient" - "github.com/terraform-providers/terraform-provider-selectel/selectel/internal/hashcode" + "github.com/selectel/go-selvpcclient/v4/selvpcclient" ) func expandVPCV2Regions(rawRegions *schema.Set) []string { @@ -20,12 +19,6 @@ func expandVPCV2Regions(rawRegions *schema.Set) []string { return expandedRegions } -// hashRegions is a hash function to use with the "regions" set. -func hashRegions(v interface{}) int { - m := v.(map[string]interface{}) - return hashcode.String(fmt.Sprintf("%s-", m["region"].(string))) -} - func validateRegion(selvpcClient *selvpcclient.Client, serviceType string, region string) error { endpoints, err := selvpcClient.Catalog.GetEndpoints(serviceType) if err != nil { diff --git a/selectel/resource_selectel_craas_registry_v1.go b/selectel/resource_selectel_craas_registry_v1.go index 98ea205f..c2773620 100644 --- a/selectel/resource_selectel_craas_registry_v1.go +++ b/selectel/resource_selectel_craas_registry_v1.go @@ -151,7 +151,7 @@ func resourceCRaaSRegistryV1Delete(ctx context.Context, d *schema.ResourceData, func resourceCRaaSRegistryV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the CRaaS registry resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the CRaaS registry resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_craas_registry_v1_test.go b/selectel/resource_selectel_craas_registry_v1_test.go index b21605e7..beccf3c5 100644 --- a/selectel/resource_selectel_craas_registry_v1_test.go +++ b/selectel/resource_selectel_craas_registry_v1_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/craas-go/pkg/v1/registry" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) const craasV1RegistryHostName = "https://cr.selcloud.ru" diff --git a/selectel/resource_selectel_craas_token_v1_test.go b/selectel/resource_selectel_craas_token_v1_test.go index 4b0ea77a..7f51e22e 100644 --- a/selectel/resource_selectel_craas_token_v1_test.go +++ b/selectel/resource_selectel_craas_token_v1_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/craas-go/pkg/v1/token" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccCRaaSTokenV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_database_v1.go b/selectel/resource_selectel_dbaas_database_v1.go index d68a694c..280e2f9e 100644 --- a/selectel/resource_selectel_dbaas_database_v1.go +++ b/selectel/resource_selectel_dbaas_database_v1.go @@ -154,10 +154,10 @@ func resourceDBaaSDatabaseV1Delete(ctx context.Context, d *schema.ResourceData, func resourceDBaaSDatabaseV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_database_v1_test.go b/selectel/resource_selectel_dbaas_database_v1_test.go index c2f40acf..9f7edcfa 100644 --- a/selectel/resource_selectel_dbaas_database_v1_test.go +++ b/selectel/resource_selectel_dbaas_database_v1_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSDatabaseV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_datastore_v1.go b/selectel/resource_selectel_dbaas_datastore_v1.go index 89ec4ea6..27e71b16 100644 --- a/selectel/resource_selectel_dbaas_datastore_v1.go +++ b/selectel/resource_selectel_dbaas_datastore_v1.go @@ -259,10 +259,10 @@ func resourceDBaaSDatastoreV1Delete(ctx context.Context, d *schema.ResourceData, func resourceDBaaSDatastoreV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_datastore_v1_test.go b/selectel/resource_selectel_dbaas_datastore_v1_test.go index 36da86a2..9d062934 100644 --- a/selectel/resource_selectel_dbaas_datastore_v1_test.go +++ b/selectel/resource_selectel_dbaas_datastore_v1_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSDatastoreV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_extension_v1.go b/selectel/resource_selectel_dbaas_extension_v1.go index d6ce0db0..80f94ea0 100644 --- a/selectel/resource_selectel_dbaas_extension_v1.go +++ b/selectel/resource_selectel_dbaas_extension_v1.go @@ -115,10 +115,10 @@ func resourceDBaaSExtensionV1Delete(ctx context.Context, d *schema.ResourceData, func resourceDBaaSExtensionV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_extension_v1_test.go b/selectel/resource_selectel_dbaas_extension_v1_test.go index e2a63680..4526fc3f 100644 --- a/selectel/resource_selectel_dbaas_extension_v1_test.go +++ b/selectel/resource_selectel_dbaas_extension_v1_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSExtensionV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_firewall_v1.go b/selectel/resource_selectel_dbaas_firewall_v1.go index 564fd239..34938f43 100644 --- a/selectel/resource_selectel_dbaas_firewall_v1.go +++ b/selectel/resource_selectel_dbaas_firewall_v1.go @@ -113,10 +113,10 @@ func resourceDBaaSFirewallV1Delete(ctx context.Context, d *schema.ResourceData, func resourceDBaaSFirewallV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_firewall_v1_test.go b/selectel/resource_selectel_dbaas_firewall_v1_test.go index 67e69786..fb3a7eb5 100644 --- a/selectel/resource_selectel_dbaas_firewall_v1_test.go +++ b/selectel/resource_selectel_dbaas_firewall_v1_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSFirewallV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_grant_v1.go b/selectel/resource_selectel_dbaas_grant_v1.go index ea750c46..5fc24ad1 100644 --- a/selectel/resource_selectel_dbaas_grant_v1.go +++ b/selectel/resource_selectel_dbaas_grant_v1.go @@ -115,10 +115,10 @@ func resourceDBaaSGrantV1Delete(ctx context.Context, d *schema.ResourceData, met func resourceDBaaSGrantV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_grant_v1_test.go b/selectel/resource_selectel_dbaas_grant_v1_test.go index b69b2635..008e6080 100644 --- a/selectel/resource_selectel_dbaas_grant_v1_test.go +++ b/selectel/resource_selectel_dbaas_grant_v1_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSGrantV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_kafka_acl_v1.go b/selectel/resource_selectel_dbaas_kafka_acl_v1.go index bffda456..74baa851 100644 --- a/selectel/resource_selectel_dbaas_kafka_acl_v1.go +++ b/selectel/resource_selectel_dbaas_kafka_acl_v1.go @@ -152,10 +152,10 @@ func resourceDBaaSACLV1Delete(ctx context.Context, d *schema.ResourceData, meta func resourceDBaaSACLV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_kafka_acl_v1_test.go b/selectel/resource_selectel_dbaas_kafka_acl_v1_test.go index 77283e93..04768f77 100644 --- a/selectel/resource_selectel_dbaas_kafka_acl_v1_test.go +++ b/selectel/resource_selectel_dbaas_kafka_acl_v1_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSKafkaACLV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_kafka_datastore_v1.go b/selectel/resource_selectel_dbaas_kafka_datastore_v1.go index a4ac8978..918adf38 100644 --- a/selectel/resource_selectel_dbaas_kafka_datastore_v1.go +++ b/selectel/resource_selectel_dbaas_kafka_datastore_v1.go @@ -205,10 +205,10 @@ func resourceDBaaSKafkaDatastoreV1Delete(ctx context.Context, d *schema.Resource func resourceDBaaSKafkaDatastoreV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_kafka_datastore_v1_test.go b/selectel/resource_selectel_dbaas_kafka_datastore_v1_test.go index f0a73918..7eaeb87f 100644 --- a/selectel/resource_selectel_dbaas_kafka_datastore_v1_test.go +++ b/selectel/resource_selectel_dbaas_kafka_datastore_v1_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSKafkaDatastoreV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_kafka_topic_v1.go b/selectel/resource_selectel_dbaas_kafka_topic_v1.go index 75f0d224..7d66a382 100644 --- a/selectel/resource_selectel_dbaas_kafka_topic_v1.go +++ b/selectel/resource_selectel_dbaas_kafka_topic_v1.go @@ -43,7 +43,7 @@ func resourceDBaaSTopicV1Create(ctx context.Context, d *schema.ResourceData, met topicCreateOpts := dbaas.TopicCreateOpts{ DatastoreID: d.Get("datastore_id").(string), Name: d.Get("name").(string), - Partitions: uint16(d.Get("partitions").(int)), + Partitions: uint16(d.Get("partitions").(int)), //nolint:gosec } log.Print(msgCreate(objectTopic, topicCreateOpts)) @@ -90,7 +90,7 @@ func resourceDBaaSTopicV1Update(ctx context.Context, d *schema.ResourceData, met } if d.HasChange("partitions") { - partitions := uint16(d.Get("partitions").(int)) + partitions := uint16(d.Get("partitions").(int)) //nolint:gosec updateOpts := dbaas.TopicUpdateOpts{ Partitions: partitions, } @@ -145,10 +145,10 @@ func resourceDBaaSTopicV1Delete(ctx context.Context, d *schema.ResourceData, met func resourceDBaaSTopicV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_kafka_topic_v1_test.go b/selectel/resource_selectel_dbaas_kafka_topic_v1_test.go index b270a1df..4e8b8df4 100644 --- a/selectel/resource_selectel_dbaas_kafka_topic_v1_test.go +++ b/selectel/resource_selectel_dbaas_kafka_topic_v1_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSKafkaTopicV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_mysql_database_v1.go b/selectel/resource_selectel_dbaas_mysql_database_v1.go index 9d1e617e..e336b6eb 100644 --- a/selectel/resource_selectel_dbaas_mysql_database_v1.go +++ b/selectel/resource_selectel_dbaas_mysql_database_v1.go @@ -113,10 +113,10 @@ func resourceDBaaSMySQLDatabaseV1Delete(ctx context.Context, d *schema.ResourceD func resourceDBaaSMySQLDatabaseV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_mysql_database_v1_test.go b/selectel/resource_selectel_dbaas_mysql_database_v1_test.go index 410fabbe..336e65aa 100644 --- a/selectel/resource_selectel_dbaas_mysql_database_v1_test.go +++ b/selectel/resource_selectel_dbaas_mysql_database_v1_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSMySQLDatabaseV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_mysql_datastore_v1.go b/selectel/resource_selectel_dbaas_mysql_datastore_v1.go index fd25e1a0..b3f76be9 100644 --- a/selectel/resource_selectel_dbaas_mysql_datastore_v1.go +++ b/selectel/resource_selectel_dbaas_mysql_datastore_v1.go @@ -240,10 +240,10 @@ func resourceDBaaSMySQLDatastoreV1Delete(ctx context.Context, d *schema.Resource func resourceDBaaSMySQLDatastoreV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_mysql_datastore_v1_test.go b/selectel/resource_selectel_dbaas_mysql_datastore_v1_test.go index 850b3f4c..3b6f7cff 100644 --- a/selectel/resource_selectel_dbaas_mysql_datastore_v1_test.go +++ b/selectel/resource_selectel_dbaas_mysql_datastore_v1_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) type Flavor struct { diff --git a/selectel/resource_selectel_dbaas_postgresql_database_v1.go b/selectel/resource_selectel_dbaas_postgresql_database_v1.go index 2e3db6c5..b8a4c58b 100644 --- a/selectel/resource_selectel_dbaas_postgresql_database_v1.go +++ b/selectel/resource_selectel_dbaas_postgresql_database_v1.go @@ -154,10 +154,10 @@ func resourceDBaaSPostgreSQLDatabaseV1Delete(ctx context.Context, d *schema.Reso func resourceDBaaSPostgreSQLDatabaseV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_postgresql_database_v1_test.go b/selectel/resource_selectel_dbaas_postgresql_database_v1_test.go index 032afde0..9e9f0d13 100644 --- a/selectel/resource_selectel_dbaas_postgresql_database_v1_test.go +++ b/selectel/resource_selectel_dbaas_postgresql_database_v1_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSPostgreSQLDatabaseV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_postgresql_datastore_v1.go b/selectel/resource_selectel_dbaas_postgresql_datastore_v1.go index 0770995f..60ecba2a 100644 --- a/selectel/resource_selectel_dbaas_postgresql_datastore_v1.go +++ b/selectel/resource_selectel_dbaas_postgresql_datastore_v1.go @@ -254,10 +254,10 @@ func resourceDBaaSPostgreSQLDatastoreV1Delete(ctx context.Context, d *schema.Res func resourceDBaaSPostgreSQLDatastoreV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_postgresql_datastore_v1_test.go b/selectel/resource_selectel_dbaas_postgresql_datastore_v1_test.go index 03d83962..2ceb5360 100644 --- a/selectel/resource_selectel_dbaas_postgresql_datastore_v1_test.go +++ b/selectel/resource_selectel_dbaas_postgresql_datastore_v1_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSPostgreSQLDatastoreV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_postgresql_extension_v1.go b/selectel/resource_selectel_dbaas_postgresql_extension_v1.go index 5d1d0722..d7753e4f 100644 --- a/selectel/resource_selectel_dbaas_postgresql_extension_v1.go +++ b/selectel/resource_selectel_dbaas_postgresql_extension_v1.go @@ -115,10 +115,10 @@ func resourceDBaaSPostgreSQLExtensionV1Delete(ctx context.Context, d *schema.Res func resourceDBaaSPostgreSQLExtensionV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_postgresql_extension_v1_test.go b/selectel/resource_selectel_dbaas_postgresql_extension_v1_test.go index 525e63e8..200abb1c 100644 --- a/selectel/resource_selectel_dbaas_postgresql_extension_v1_test.go +++ b/selectel/resource_selectel_dbaas_postgresql_extension_v1_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSPostgreSQLExtensionV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_postgresql_logical_replication_slot_v1.go b/selectel/resource_selectel_dbaas_postgresql_logical_replication_slot_v1.go index 4eca60e2..f6f1e5a4 100644 --- a/selectel/resource_selectel_dbaas_postgresql_logical_replication_slot_v1.go +++ b/selectel/resource_selectel_dbaas_postgresql_logical_replication_slot_v1.go @@ -115,10 +115,10 @@ func resourceDBaaSPostgreSQLLogicalReplicationSlotV1Delete(ctx context.Context, func resourceDBaaSPostgreSQLLogicalReplicationSlotV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_postgresql_logical_replication_slot_v1_test.go b/selectel/resource_selectel_dbaas_postgresql_logical_replication_slot_v1_test.go index 6e7d0753..58e71f7b 100644 --- a/selectel/resource_selectel_dbaas_postgresql_logical_replication_slot_v1_test.go +++ b/selectel/resource_selectel_dbaas_postgresql_logical_replication_slot_v1_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSPostgreSQLLogicalReplicationSlotV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_prometheus_metric_token_v1.go b/selectel/resource_selectel_dbaas_prometheus_metric_token_v1.go index 7c2babe0..c5b350f5 100644 --- a/selectel/resource_selectel_dbaas_prometheus_metric_token_v1.go +++ b/selectel/resource_selectel_dbaas_prometheus_metric_token_v1.go @@ -125,10 +125,10 @@ func resourceDBaaSPrometheusMetricTokenV1Delete(ctx context.Context, d *schema.R func resourceDBaaSPrometheusMetricTokenV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_prometheus_metric_token_v1_test.go b/selectel/resource_selectel_dbaas_prometheus_metric_token_v1_test.go index 3680d200..3fb3e0de 100644 --- a/selectel/resource_selectel_dbaas_prometheus_metric_token_v1_test.go +++ b/selectel/resource_selectel_dbaas_prometheus_metric_token_v1_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSPrometheusMetricTokenV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_redis_datastore_v1.go b/selectel/resource_selectel_dbaas_redis_datastore_v1.go index b6c5c264..e55451d6 100644 --- a/selectel/resource_selectel_dbaas_redis_datastore_v1.go +++ b/selectel/resource_selectel_dbaas_redis_datastore_v1.go @@ -237,10 +237,10 @@ func resourceDBaaSRedisDatastoreV1Delete(ctx context.Context, d *schema.Resource func resourceDBaaSRedisDatastoreV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_redis_datastore_v1_test.go b/selectel/resource_selectel_dbaas_redis_datastore_v1_test.go index d5e3a962..63e34a1d 100644 --- a/selectel/resource_selectel_dbaas_redis_datastore_v1_test.go +++ b/selectel/resource_selectel_dbaas_redis_datastore_v1_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSRedisDatastoreV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_dbaas_user_v1.go b/selectel/resource_selectel_dbaas_user_v1.go index 38453b09..78fb3fc0 100644 --- a/selectel/resource_selectel_dbaas_user_v1.go +++ b/selectel/resource_selectel_dbaas_user_v1.go @@ -143,10 +143,10 @@ func resourceDBaaSUserV1Delete(ctx context.Context, d *schema.ResourceData, meta func resourceDBaaSUserV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_dbaas_user_v1_test.go b/selectel/resource_selectel_dbaas_user_v1_test.go index 7d51825a..7252c70b 100644 --- a/selectel/resource_selectel_dbaas_user_v1_test.go +++ b/selectel/resource_selectel_dbaas_user_v1_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/selectel/dbaas-go" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccDBaaSUserV1Basic(t *testing.T) { diff --git a/selectel/resource_selectel_domains_rrset_v2.go b/selectel/resource_selectel_domains_rrset_v2.go index f4f442e5..d0ad573a 100644 --- a/selectel/resource_selectel_domains_rrset_v2.go +++ b/selectel/resource_selectel_domains_rrset_v2.go @@ -144,7 +144,7 @@ func resourceDomainsRRSetV2Read(ctx context.Context, d *schema.ResourceData, met func resourceDomainsRRSetV2ImportState(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_domains_zone_v2.go b/selectel/resource_selectel_domains_zone_v2.go index b0a9590d..5d6f913c 100644 --- a/selectel/resource_selectel_domains_zone_v2.go +++ b/selectel/resource_selectel_domains_zone_v2.go @@ -134,7 +134,7 @@ func resourceDomainsZoneV2Read(ctx context.Context, d *schema.ResourceData, meta func resourceDomainsZoneV2ImportState(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_mks_cluster_v1.go b/selectel/resource_selectel_mks_cluster_v1.go index 73997a40..5a7a8afd 100644 --- a/selectel/resource_selectel_mks_cluster_v1.go +++ b/selectel/resource_selectel_mks_cluster_v1.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/quotamanager/quotas" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/quotamanager/quotas" "github.com/selectel/mks-go/pkg/v1/cluster" ) @@ -45,8 +45,8 @@ func resourceMKSClusterV1() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - DiffSuppressFunc: func(_, old, new string, _ *schema.ResourceData) bool { - return strings.EqualFold(old, new) + DiffSuppressFunc: func(_, oldVersion, newVersion string, _ *schema.ResourceData) bool { + return strings.EqualFold(oldVersion, newVersion) }, }, "project_id": { @@ -399,10 +399,10 @@ func resourceMKSClusterV1Delete(ctx context.Context, d *schema.ResourceData, met func resourceMKSClusterV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_mks_cluster_v1_test.go b/selectel/resource_selectel_mks_cluster_v1_test.go index c2f2cd1c..14bde06a 100644 --- a/selectel/resource_selectel_mks_cluster_v1_test.go +++ b/selectel/resource_selectel_mks_cluster_v1_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" v1 "github.com/selectel/mks-go/pkg/v1" "github.com/selectel/mks-go/pkg/v1/cluster" "github.com/selectel/mks-go/pkg/v1/kubeoptions" diff --git a/selectel/resource_selectel_mks_nodegroup_v1.go b/selectel/resource_selectel_mks_nodegroup_v1.go index 8a13c6b0..ed37f9fa 100644 --- a/selectel/resource_selectel_mks_nodegroup_v1.go +++ b/selectel/resource_selectel_mks_nodegroup_v1.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/quotamanager/quotas" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/quotamanager/quotas" "github.com/selectel/mks-go/pkg/v1/nodegroup" ) @@ -196,11 +196,11 @@ func resourceMKSNodegroupV1() *schema.Resource { }, CustomizeDiff: customdiff.All( // We need to recreate nodegroup if flavor changed. - customdiff.ForceNewIfChange("flavor_id", func(_ context.Context, old, new, _ interface{}) bool { - return old.(string) != new.(string) + customdiff.ForceNewIfChange("flavor_id", func(_ context.Context, oldVersion, newVersion, _ interface{}) bool { + return oldVersion.(string) != newVersion.(string) }), - customdiff.ForceNewIfChange("local_volume", func(_ context.Context, old, new, _ interface{}) bool { - return old.(bool) != new.(bool) + customdiff.ForceNewIfChange("local_volume", func(_ context.Context, oldVersion, newVersion, _ interface{}) bool { + return oldVersion.(bool) != newVersion.(bool) }), ), } @@ -540,10 +540,10 @@ func resourceMKSNodegroupV1Delete(ctx context.Context, d *schema.ResourceData, m func resourceMKSNodegroupV1ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } if config.Region == "" { - return nil, errors.New("SEL_REGION must be set for the resource import") + return nil, errors.New("INFRA_REGION must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_mks_nodegroup_v1_test.go b/selectel/resource_selectel_mks_nodegroup_v1_test.go index f348370a..289b5fa0 100644 --- a/selectel/resource_selectel_mks_nodegroup_v1_test.go +++ b/selectel/resource_selectel_mks_nodegroup_v1_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" "github.com/selectel/mks-go/pkg/v1/nodegroup" ) diff --git a/selectel/resource_selectel_vpc_crossregion_subnet_v2.go b/selectel/resource_selectel_vpc_crossregion_subnet_v2.go deleted file mode 100644 index 6c92d580..00000000 --- a/selectel/resource_selectel_vpc_crossregion_subnet_v2.go +++ /dev/null @@ -1,124 +0,0 @@ -package selectel - -import ( - "context" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourceVPCCrossRegionSubnetV2() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceVPCCrossRegionSubnetV2Create, - ReadContext: resourceVPCCrossRegionSubnetV2Read, - DeleteContext: resourceVPCCrossRegionSubnetV2Delete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Schema: map[string]*schema.Schema{ - "project_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "regions": { - Type: schema.TypeSet, - Required: true, - ForceNew: true, - Set: hashRegions, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "region": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - }, - }, - "cidr": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "vlan_id": { - Type: schema.TypeInt, - Computed: true, - }, - "status": { - Type: schema.TypeString, - Computed: true, - }, - "servers": { - Type: schema.TypeSet, - Computed: true, - Set: hashServers, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Computed: true, - }, - "name": { - Type: schema.TypeString, - Computed: true, - }, - "status": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - "subnets": { - Type: schema.TypeSet, - Computed: true, - Set: hashSubnets, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "region": { - Type: schema.TypeString, - Computed: true, - }, - "cidr": { - Type: schema.TypeString, - Computed: true, - }, - "network_id": { - Type: schema.TypeString, - Computed: true, - }, - "subnet_id": { - Type: schema.TypeString, - Computed: true, - }, - "project_id": { - Type: schema.TypeString, - Computed: true, - }, - "vlan_id": { - Type: schema.TypeInt, - Computed: true, - }, - "vtep_ip_address": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - }, - } -} - -func resourceVPCCrossRegionSubnetV2Create(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_crossregion_subnet_v2")) -} - -func resourceVPCCrossRegionSubnetV2Read(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_crossregion_subnet_v2")) -} - -func resourceVPCCrossRegionSubnetV2Delete(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_crossregion_subnet_v2")) -} diff --git a/selectel/resource_selectel_vpc_floatingip_v2.go b/selectel/resource_selectel_vpc_floatingip_v2.go index 09795045..5b4a7c8c 100644 --- a/selectel/resource_selectel_vpc_floatingip_v2.go +++ b/selectel/resource_selectel_vpc_floatingip_v2.go @@ -8,8 +8,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/clients" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/floatingips" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/clients" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/floatingips" ) func resourceVPCFloatingIPV2() *schema.Resource { @@ -172,7 +172,7 @@ func resourceVPCFloatingIPV2Delete(_ context.Context, d *schema.ResourceData, me func resourceVPCFloatingIPV2ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, fmt.Errorf("SEL_PROJECT_ID must be set for the resource import") + return nil, fmt.Errorf("INFRA_PROJECT_ID must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_vpc_floatingip_v2_test.go b/selectel/resource_selectel_vpc_floatingip_v2_test.go index 5c3b70b7..d6a641cc 100644 --- a/selectel/resource_selectel_vpc_floatingip_v2_test.go +++ b/selectel/resource_selectel_vpc_floatingip_v2_test.go @@ -8,8 +8,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/floatingips" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/floatingips" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccVPCV2FloatingIPBasic(t *testing.T) { diff --git a/selectel/resource_selectel_vpc_keypair_v2.go b/selectel/resource_selectel_vpc_keypair_v2.go index 7069960f..347bd786 100644 --- a/selectel/resource_selectel_vpc_keypair_v2.go +++ b/selectel/resource_selectel_vpc_keypair_v2.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/keypairs" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/keypairs" ) func resourceVPCKeypairV2() *schema.Resource { diff --git a/selectel/resource_selectel_vpc_keypair_v2_test.go b/selectel/resource_selectel_vpc_keypair_v2_test.go index a5bff779..4a86dcb1 100644 --- a/selectel/resource_selectel_vpc_keypair_v2_test.go +++ b/selectel/resource_selectel_vpc_keypair_v2_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/keypairs" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/keypairs" "github.com/selectel/iam-go/service/serviceusers" "github.com/stretchr/testify/assert" ) diff --git a/selectel/resource_selectel_vpc_license_v2.go b/selectel/resource_selectel_vpc_license_v2.go index 97b7f18a..bd79e159 100644 --- a/selectel/resource_selectel_vpc_license_v2.go +++ b/selectel/resource_selectel_vpc_license_v2.go @@ -9,8 +9,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/clients" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/licenses" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/clients" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/licenses" ) func resourceVPCLicenseV2() *schema.Resource { @@ -181,7 +181,7 @@ func resourceVPCLicenseV2Delete(_ context.Context, d *schema.ResourceData, meta func resourceVPCLicenseV2ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, fmt.Errorf("SEL_PROJECT_ID must be set for the resource import") + return nil, fmt.Errorf("INFRA_PROJECT_ID must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_vpc_license_v2_test.go b/selectel/resource_selectel_vpc_license_v2_test.go index 7123d4a8..0aaca74a 100644 --- a/selectel/resource_selectel_vpc_license_v2_test.go +++ b/selectel/resource_selectel_vpc_license_v2_test.go @@ -9,8 +9,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/licenses" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/licenses" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccVPCV2LicenseBasic(t *testing.T) { diff --git a/selectel/resource_selectel_vpc_project_v2.go b/selectel/resource_selectel_vpc_project_v2.go index f6ea9b16..5794b645 100644 --- a/selectel/resource_selectel_vpc_project_v2.go +++ b/selectel/resource_selectel_vpc_project_v2.go @@ -8,8 +8,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/quotamanager/quotas" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/quotamanager/quotas" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func resourceVPCProjectV2() *schema.Resource { diff --git a/selectel/resource_selectel_vpc_project_v2_test.go b/selectel/resource_selectel_vpc_project_v2_test.go index d5e8ffa6..e5c08b5b 100644 --- a/selectel/resource_selectel_vpc_project_v2_test.go +++ b/selectel/resource_selectel_vpc_project_v2_test.go @@ -9,8 +9,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/quotamanager/quotas" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/quotamanager/quotas" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" "github.com/stretchr/testify/assert" ) diff --git a/selectel/resource_selectel_vpc_role_v2.go b/selectel/resource_selectel_vpc_role_v2.go deleted file mode 100644 index 561901c9..00000000 --- a/selectel/resource_selectel_vpc_role_v2.go +++ /dev/null @@ -1,43 +0,0 @@ -package selectel - -import ( - "context" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourceVPCRoleV2() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceVPCRoleV2Create, - ReadContext: resourceVPCRoleV2Read, - DeleteContext: resourceVPCRoleV2Delete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Schema: map[string]*schema.Schema{ - "project_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "user_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} - -func resourceVPCRoleV2Create(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_role_v2")) -} - -func resourceVPCRoleV2Read(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_role_v2")) -} - -func resourceVPCRoleV2Delete(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_role_v2")) -} diff --git a/selectel/resource_selectel_vpc_subnet_v2.go b/selectel/resource_selectel_vpc_subnet_v2.go index 77c9f301..89878493 100644 --- a/selectel/resource_selectel_vpc_subnet_v2.go +++ b/selectel/resource_selectel_vpc_subnet_v2.go @@ -10,9 +10,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/selectel/go-selvpcclient/v3/selvpcclient" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/clients" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/subnets" + "github.com/selectel/go-selvpcclient/v4/selvpcclient" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/clients" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/subnets" ) func resourceVPCSubnetV2() *schema.Resource { @@ -203,7 +203,7 @@ func resourceVPCSubnetV2Delete(_ context.Context, d *schema.ResourceData, meta i func resourceVPCSubnetV2ImportState(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, fmt.Errorf("SEL_PROJECT_ID must be set for the resource import") + return nil, fmt.Errorf("INFRA_PROJECT_ID must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resource_selectel_vpc_subnet_v2_test.go b/selectel/resource_selectel_vpc_subnet_v2_test.go index f49a23f6..9a1c294c 100644 --- a/selectel/resource_selectel_vpc_subnet_v2_test.go +++ b/selectel/resource_selectel_vpc_subnet_v2_test.go @@ -9,8 +9,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/subnets" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/subnets" ) func TestAccVPCV2SubnetBasic(t *testing.T) { diff --git a/selectel/resource_selectel_vpc_token_v2.go b/selectel/resource_selectel_vpc_token_v2.go deleted file mode 100644 index c3154521..00000000 --- a/selectel/resource_selectel_vpc_token_v2.go +++ /dev/null @@ -1,42 +0,0 @@ -package selectel - -import ( - "context" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourceVPCTokenV2() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceVPCTokenV2Create, - ReadContext: resourceVPCTokenV2Read, - DeleteContext: resourceVPCTokenV2Delete, - Schema: map[string]*schema.Schema{ - "project_id": { - Type: schema.TypeString, - ConflictsWith: []string{"account_name"}, - Optional: true, - ForceNew: true, - }, - "account_name": { - Type: schema.TypeString, - ConflictsWith: []string{"project_id"}, - Optional: true, - ForceNew: true, - }, - }, - } -} - -func resourceVPCTokenV2Create(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_token_v2")) -} - -func resourceVPCTokenV2Read(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_token_v2")) -} - -func resourceVPCTokenV2Delete(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_token_v2")) -} diff --git a/selectel/resource_selectel_vpc_user_v2.go b/selectel/resource_selectel_vpc_user_v2.go deleted file mode 100644 index c3741ecc..00000000 --- a/selectel/resource_selectel_vpc_user_v2.go +++ /dev/null @@ -1,79 +0,0 @@ -package selectel - -import ( - "context" - "unicode" - - "github.com/hashicorp/go-cty/cty" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourceVPCUserV2() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceVPCUserV2Create, - ReadContext: resourceVPCUserV2Read, - UpdateContext: resourceVPCUserV2Update, - DeleteContext: resourceVPCUserV2Delete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: false, - }, - "password": { - Type: schema.TypeString, - Required: true, - ForceNew: false, - ValidateDiagFunc: func(i interface{}, _ cty.Path) diag.Diagnostics { - password := i.(string) - if len(password) < 8 { - return diag.Errorf("password must be at least 8 characters long") - } - - chrType := 0 - for _, r := range password { - switch { - case unicode.IsDigit(r): - chrType |= 1 - case unicode.IsLower(r): - chrType |= 2 - case unicode.IsUpper(r): - chrType |= 4 - } - } - if chrType != 7 { - return diag.Errorf("password must contain at least one digit, one lowercase and one uppercase character") - } - - return nil - }, - }, - "enabled": { - Type: schema.TypeBool, - Optional: true, - Default: true, - ForceNew: false, - }, - }, - } -} - -func resourceVPCUserV2Create(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_user_v2")) -} - -func resourceVPCUserV2Read(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_user_v2")) -} - -func resourceVPCUserV2Update(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_user_v2")) -} - -func resourceVPCUserV2Delete(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_user_v2")) -} diff --git a/selectel/resource_selectel_vpc_vrrp_subnet_v2.go b/selectel/resource_selectel_vpc_vrrp_subnet_v2.go deleted file mode 100644 index b7bb2933..00000000 --- a/selectel/resource_selectel_vpc_vrrp_subnet_v2.go +++ /dev/null @@ -1,133 +0,0 @@ -package selectel - -import ( - "context" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/selectel/go-selvpcclient/v3/selvpcclient" -) - -func resourceVPCVRRPSubnetV2() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceVPCVRRPSubnetV2Create, - ReadContext: resourceVPCVRRPSubnetV2Read, - DeleteContext: resourceVPCVRRPSubnetV2Delete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - Schema: map[string]*schema.Schema{ - "project_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "master_region": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "slave_region": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "prefix_length": { - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - Default: 29, - ValidateFunc: validation.IntBetween(24, 29), - }, - "ip_version": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: selvpcclient.IPv4, - ValidateFunc: validation.StringInSlice([]string{ - string(selvpcclient.IPv4), - string(selvpcclient.IPv6), - }, false), - }, - "cidr": { - Type: schema.TypeString, - Computed: true, - }, - "status": { - Type: schema.TypeString, - Computed: true, - }, - "subnets": { - Type: schema.TypeSet, - Computed: true, - Set: hashSubnets, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "network_id": { - Type: schema.TypeString, - Computed: true, - }, - "subnet_id": { - Type: schema.TypeString, - Computed: true, - }, - "region": { - Type: schema.TypeString, - Computed: true, - }, - "cidr": { - Type: schema.TypeString, - Computed: true, - }, - "vlan_id": { - Type: schema.TypeInt, - Computed: true, - }, - "project_id": { - Type: schema.TypeString, - Computed: true, - }, - "vtep_ip_address": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - "servers": { - Type: schema.TypeSet, - Computed: true, - Set: hashServers, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "id": { - Type: schema.TypeString, - Computed: true, - }, - "name": { - Type: schema.TypeString, - Computed: true, - }, - "status": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - }, - } -} - -func resourceVPCVRRPSubnetV2Create(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_vrrp_subnet_v2")) -} - -func resourceVPCVRRPSubnetV2Read(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_vrrp_subnet_v2")) -} - -func resourceVPCVRRPSubnetV2Delete(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errResourceDeprecated("selectel_vpc_vrrp_subnet_v2")) -} diff --git a/selectel/resourse_selectel_secretsmanager_certificate_v1.go b/selectel/resourse_selectel_secretsmanager_certificate_v1.go index ccd45e03..1db00243 100644 --- a/selectel/resourse_selectel_secretsmanager_certificate_v1.go +++ b/selectel/resourse_selectel_secretsmanager_certificate_v1.go @@ -243,12 +243,12 @@ func resourceSecretsManagerCertificateV1Delete(ctx context.Context, d *schema.Re } // resourceSecretsManagerCertificateV1ImportState — helper used in Importer: &schema.ResourceImporter -// to avoid difficulties occurred with required SEL_PROJECT_ID env in +// to avoid difficulties occurred with required INFRA_PROJECT_ID env in // resourceSecretsManagerCertificateV1Read when uising schema.ImportStatePassthroughContext. func resourceSecretsManagerCertificateV1ImportState(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resourse_selectel_secretsmanager_certificate_v1_test.go b/selectel/resourse_selectel_secretsmanager_certificate_v1_test.go index 7efb6ab7..5263a373 100644 --- a/selectel/resourse_selectel_secretsmanager_certificate_v1_test.go +++ b/selectel/resourse_selectel_secretsmanager_certificate_v1_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccSecretsManagerCertificateV1Basic(t *testing.T) { diff --git a/selectel/resourse_selectel_secretsmanager_secret_v1.go b/selectel/resourse_selectel_secretsmanager_secret_v1.go index f1201341..d02055f0 100644 --- a/selectel/resourse_selectel_secretsmanager_secret_v1.go +++ b/selectel/resourse_selectel_secretsmanager_secret_v1.go @@ -166,12 +166,12 @@ func resourceSecretsManagerSecretV1Update(ctx context.Context, d *schema.Resourc } // resourceSecretsManagerSecretV1ImportState — helper used in Importer: &schema.ResourceImporter -// to avoid difficulties occurred with required SEL_PROJECT_ID env in +// to avoid difficulties occurred with required INFRA_PROJECT_ID env in // resourceSecretsManagerSecretV1Read when uising schema.ImportStatePassthroughContext. func resourceSecretsManagerSecretV1ImportState(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if config.ProjectID == "" { - return nil, errors.New("SEL_PROJECT_ID must be set for the resource import") + return nil, errors.New("INFRA_PROJECT_ID must be set for the resource import") } d.Set("project_id", config.ProjectID) diff --git a/selectel/resourse_selectel_secretsmanager_secret_v1_test.go b/selectel/resourse_selectel_secretsmanager_secret_v1_test.go index ef639c5b..4ef2ffc6 100644 --- a/selectel/resourse_selectel_secretsmanager_secret_v1_test.go +++ b/selectel/resourse_selectel_secretsmanager_secret_v1_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/projects" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/projects" ) func TestAccSecretsManagerSecretV1Basic(t *testing.T) { diff --git a/selectel/servers.go b/selectel/servers.go index 056b454a..303ece72 100644 --- a/selectel/servers.go +++ b/selectel/servers.go @@ -3,7 +3,7 @@ package selectel import ( "fmt" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/servers" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/servers" "github.com/terraform-providers/terraform-provider-selectel/selectel/internal/hashcode" ) diff --git a/selectel/servers_test.go b/selectel/servers_test.go index a181bfd5..118cf1ff 100644 --- a/selectel/servers_test.go +++ b/selectel/servers_test.go @@ -3,7 +3,7 @@ package selectel import ( "testing" - "github.com/selectel/go-selvpcclient/v3/selvpcclient/resell/v2/servers" + "github.com/selectel/go-selvpcclient/v4/selvpcclient/resell/v2/servers" "github.com/stretchr/testify/assert" ) 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..015ed74d --- /dev/null +++ b/website/docs/guides/upgrading_to_version_6.html.markdown @@ -0,0 +1,91 @@ +--- +layout: "selectel" +page_title: "Upgrading Terraform Selectel Provider to version 6.0.0" +sidebar_current: "docs-selectel-guide-upgrade-guide-v6" +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 the following changes: + +- removes deprecated API resources: + - selectel_vpc_role_v2; + - selectel_vpc_user_v2; + - selectel_vpc_vrrp_subnet_v2; + - selectel_vpc_crossregion_subnet_v2; +- сhanges the names of environment variables `SEL_PROJECT_ID` and `SEL_REGION` to `INFRA_PROJECT_ID` and `INFRA_REGION` respectively; +- makes authentication parameters `auth_region` and `auth_url` required for authentication. + +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. + +## Check authentication and rename environment variables + +1. In the Terraform configuration, 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. Ensure that the required authentication parameters `auth_region` and `auth_url` are in the configuration: + +```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`, rename them to `INFRA_PROJECT_ID` and `INFRA_REGION` respectively. +4. To download the new version, initialize the Terraform configuration. + + ```bash + terraform init -upgrade + ``` + +## Replace the removed resources + +Replace the removed resources if you have them in the configuration. + +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 the `selectel_vpc_vrrp_subnet_v2` and `selectel_vpc_crossregion_subnet_v2` resources. +5. To ensure that Terraform applies the required changes, preview the changes: + + ```bash + terraform plan + ``` + +6. Apply the changes: + + ```bash + terraform apply + ``` diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 35882581..8150dd87 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -19,7 +19,7 @@ terraform { required_providers { selectel = { source = "selectel/selectel" - version = "~> 5.1.0" + version = "~> 6.0.0" } } } @@ -30,7 +30,7 @@ resource "selectel_vpc_project_v2" "project_1" { } ``` -## Authentication (4.0.0 and later) +## Authentication (6.0.0 and later) ```hcl # Configure the Selectel provider @@ -39,10 +39,42 @@ provider "selectel" { domain_name = "123456" username = "user" password = "password" + auth_region = "pool" + auth_url = "https://cloud.api.selcloud.ru/identity/v3/" } ``` -## Argument Reference (4.0.0 and later) +## Argument Reference (6.0.0 and later) + +* `domain_name` - (Required) Selectel account ID. The account ID is in the top right corner of the [Control panel](https://my.selectel.ru/). For import, use the value in the `OS_DOMAIN_NAME` environment variable. Learn more about [Registration](https://docs.selectel.ru/en/control-panel-actions/account/registration/). + +* `username` - (Required) Name of the service user. To get the name, in the [Control panel](https://my.selectel.ru/iam/users_management/users?type=service), go to **Identity & Access Management** ⟶ **User management** ⟶ the **Service users** tab ⟶ copy the name of the required user. For import, use the value in the `OS_USERNAME` environment variable. Learn more about [Service users](https://docs.selectel.ru/en/control-panel-actions/users-and-roles/user-types-and-roles/) and [how to create service user](https://docs.selectel.ru/en/control-panel-actions/users-and-roles/add-user/#add-service-user). + +* `password` - (Required, Sensitive) Password of the service user. For import, use the value in the `OS_PASSWORD` environment variable. + +* `auth_url`- (Required) Keystone Identity authentication URL for authentication via user credentials. For import, use the value in the `OS_AUTH_URL` environment variable. + +* `auth_region` - (Required) Pool where the endpoint for Keystone API and Resell API is located. For import, use the value in the `OS_REGION_NAME` environment variable. Learn more about available pools in the [Availability matrix](https://docs.selectel.ru/en/control-panel-actions/availability-matrix/). + +* `user_domain_name` - (Optional) Selectel account ID. Use only for users that were created and assigned a role in a different account. Applicable only to public cloud. The account ID is in the top right corner of the [Control panel](https://my.selectel.ru/). For import, use the value in the `OS_USER_DOMAIN_NAME` environment variable. + +* `project_id` - (Optional) Unique identifier of the project. Use only to import resources that are associated with the specific project. To get the ID, in the [Control panel](https://my.selectel.ru/), go to the product section in the navigation menu ⟶ project name ⟶ copy the ID of the required project. As an alternative, you can retrieve project ID from the [selectel_vpc_project_v2](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/vpc_project_v2) resource. If skipped, use the `INFRA_PROJECT_ID` environment variable. Learn more about [Projects](https://docs.selectel.ru/en/control-panel-actions/projects/about-projects/). + +* `region` - (Optional) Pool, for example, `ru-3`. Use only to import resources from the specific pool. If skipped, use the `INFRA_REGION` environment variable. Learn more about available pools in the [Availability matrix](https://docs.selectel.ru/en/control-panel-actions/availability-matrix/). + +## Authentication (4.0.0 up to 5.*) + +```hcl +# Configure the Selectel provider + +provider "selectel" { + domain_name = "123456" + username = "user" + password = "password" +} +``` + +## Argument Reference (4.0.0 up to 5.*) * `domain_name` - (Required) Selectel account ID. The account ID is in the top right corner of the [Control panel](https://my.selectel.ru/). For import, use the value in the `OS_DOMAIN_NAME` environment variable. Learn more about [Registration](https://docs.selectel.ru/en/control-panel-actions/account/registration/). @@ -76,6 +108,6 @@ provider "selectel" { * `endpoint` - (Optional) Selectel API endpoint. Use only for test environments. If skipped, the provider automatically uses the official Selectel endpoint. -* `project_id` - (Optional) Unique identifier of the project. Use only to import resources that are associated with the specific project. To get the ID, in the [Control panel](https://my.selectel.ru/), go to the product section in the navigation menu ⟶ project name ⟶ copy the ID of the required project. As an alternative, you can retrieve project ID from the [selectel_vpc_project_v2](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/vpc_project_v2) resource. Learn more about [Projects](https://docs.selectel.ru/en/control-panel-actions/projects/about-projects/). If skipped, use the `SEL_PROJECT_ID` environment variable. +* `project_id` - (Optional) Unique identifier of the project. Use only to import resources that are associated with the specific project. To get the ID, in the [Control panel](https://my.selectel.ru/), go to the product section in the navigation menu ⟶ project name ⟶ copy the ID of the required project. As an alternative, you can retrieve project ID from the [selectel_vpc_project_v2](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/vpc_project_v2) resource. Learn more about [Projects](https://docs.selectel.ru/en/control-panel-actions/projects/about-projects/). If skipped, use the `SEL_PROJECT_ID` environment variable. * `region` - (Optional) Pool, for example, `ru-3`. Use only to import resources from the specific pool. Learn more about available pools in the [Availability matrix](https://docs.selectel.ru/en/control-panel-actions/availability-matrix/). If skipped, use the `SEL_REGION` environment variable. diff --git a/website/docs/r/craas_registry_v1.html.markdown b/website/docs/r/craas_registry_v1.html.markdown index 39bd4a20..babf9db0 100644 --- a/website/docs/r/craas_registry_v1.html.markdown +++ b/website/docs/r/craas_registry_v1.html.markdown @@ -39,7 +39,7 @@ You can import a registry: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= +export INFRA_PROJECT_ID= terraform import selectel_craas_registry_v1.registry_1 ``` diff --git a/website/docs/r/dbaas_database_v1.html.markdown b/website/docs/r/dbaas_database_v1.html.markdown index 749b0283..a30a6776 100644 --- a/website/docs/r/dbaas_database_v1.html.markdown +++ b/website/docs/r/dbaas_database_v1.html.markdown @@ -102,10 +102,10 @@ The following attributes are exported: Database can be imported using the `id`, e.g. ```shell -$ export OS_DOMAIN_NAME=999999 -$ export OS_USERNAME=example_user -$ export OS_PASSWORD=example_password -$ export SEL_PROJECT_ID=SELECTEL_VPC_PROJECT_ID -$ export SEL_REGION=SELECTEL_VPC_REGION -$ terraform import selectel_dbaas_database_v1.database_1 b311ce58-2658-46b5-b733-7a0f418703f2 +export OS_DOMAIN_NAME=999999 +export OS_USERNAME=example_user +export OS_PASSWORD=example_password +export INFRA_PROJECT_ID=SELECTEL_VPC_PROJECT_ID +export INFRA_REGION=SELECTEL_VPC_REGION +terraform import selectel_dbaas_database_v1.database_1 b311ce58-2658-46b5-b733-7a0f418703f2 ``` diff --git a/website/docs/r/dbaas_datastore_v1.html.markdown b/website/docs/r/dbaas_datastore_v1.html.markdown index 40d535f8..cc3f6dd7 100644 --- a/website/docs/r/dbaas_datastore_v1.html.markdown +++ b/website/docs/r/dbaas_datastore_v1.html.markdown @@ -125,10 +125,10 @@ The following attributes are exported: Datastore can be imported using the `id`, e.g. ```shell -$ export OS_DOMAIN_NAME=999999 -$ export OS_USERNAME=example_user -$ export OS_PASSWORD=example_password -$ export SEL_PROJECT_ID=SELECTEL_VPC_PROJECT_ID -$ export SEL_REGION=SELECTEL_VPC_REGION -$ terraform import selectel_dbaas_datastore_v1.datastore_1 b311ce58-2658-46b5-b733-7a0f418703f2 +export OS_DOMAIN_NAME=999999 +export OS_USERNAME=example_user +export OS_PASSWORD=example_password +export INFRA_PROJECT_ID=SELECTEL_VPC_PROJECT_ID +export INFRA_REGION=SELECTEL_VPC_REGION +terraform import selectel_dbaas_datastore_v1.datastore_1 b311ce58-2658-46b5-b733-7a0f418703f2 ``` diff --git a/website/docs/r/dbaas_extension_v1.html.markdown b/website/docs/r/dbaas_extension_v1.html.markdown index 1417d7ec..88846367 100644 --- a/website/docs/r/dbaas_extension_v1.html.markdown +++ b/website/docs/r/dbaas_extension_v1.html.markdown @@ -115,10 +115,10 @@ The following attributes are exported: Extension can be imported using the `id`, e.g. ```shell -$ export OS_DOMAIN_NAME=999999 -$ export OS_USERNAME=example_user -$ export OS_PASSWORD=example_password -$ export SEL_PROJECT_ID=SELECTEL_VPC_PROJECT_ID -$ export SEL_REGION=SELECTEL_VPC_REGION -$ terraform import selectel_dbaas_extension_v1.extension_1 b311ce58-2658-46b5-b733-7a0f418703f2 +export OS_DOMAIN_NAME=999999 +export OS_USERNAME=example_user +export OS_PASSWORD=example_password +export INFRA_PROJECT_ID=SELECTEL_VPC_PROJECT_ID +export INFRA_REGION=SELECTEL_VPC_REGION +terraform import selectel_dbaas_extension_v1.extension_1 b311ce58-2658-46b5-b733-7a0f418703f2 ``` diff --git a/website/docs/r/dbaas_kafka_datastore_v1.html.markdown b/website/docs/r/dbaas_kafka_datastore_v1.html.markdown index 7fc6ae30..a2a8948a 100644 --- a/website/docs/r/dbaas_kafka_datastore_v1.html.markdown +++ b/website/docs/r/dbaas_kafka_datastore_v1.html.markdown @@ -70,8 +70,8 @@ You can import a datastore: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= -export SEL_REGION= +export INFRA_PROJECT_ID= +export INFRA_REGION= terraform import selectel_dbaas_kafka_datastore_v1.datastore_1 ``` diff --git a/website/docs/r/dbaas_kafka_topic_v1.html.markdown b/website/docs/r/dbaas_kafka_topic_v1.html.markdown index 442c7882..c94269ba 100644 --- a/website/docs/r/dbaas_kafka_topic_v1.html.markdown +++ b/website/docs/r/dbaas_kafka_topic_v1.html.markdown @@ -46,8 +46,8 @@ You can import a topic: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= -export SEL_REGION= +export INFRA_PROJECT_ID= +export INFRA_REGION= terraform import selectel_dbaas_kafka_topic_v1.topic_1 ``` diff --git a/website/docs/r/dbaas_mysql_database_v1.html.markdown b/website/docs/r/dbaas_mysql_database_v1.html.markdown index 9b06f7ce..6a9f3a8c 100644 --- a/website/docs/r/dbaas_mysql_database_v1.html.markdown +++ b/website/docs/r/dbaas_mysql_database_v1.html.markdown @@ -43,8 +43,8 @@ You can import a database: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= -export SEL_REGION= +export INFRA_PROJECT_ID= +export INFRA_REGION= terraform import selectel_dbaas_mysql_database_v1.database_1 ``` diff --git a/website/docs/r/dbaas_mysql_datastore_v1.html.markdown b/website/docs/r/dbaas_mysql_datastore_v1.html.markdown index ad12bfee..175ca8e5 100644 --- a/website/docs/r/dbaas_mysql_datastore_v1.html.markdown +++ b/website/docs/r/dbaas_mysql_datastore_v1.html.markdown @@ -84,8 +84,8 @@ You can import a datastore: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= -export SEL_REGION= +export INFRA_PROJECT_ID= +export INFRA_REGION= terraform import selectel_dbaas_mysql_datastore_v1.datastore_1 ``` diff --git a/website/docs/r/dbaas_postgresql_database_v1.html.markdown b/website/docs/r/dbaas_postgresql_database_v1.html.markdown index 1d4634f2..074f4f7a 100644 --- a/website/docs/r/dbaas_postgresql_database_v1.html.markdown +++ b/website/docs/r/dbaas_postgresql_database_v1.html.markdown @@ -54,8 +54,8 @@ You can import a database: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= -export SEL_REGION= +export INFRA_PROJECT_ID= +export INFRA_REGION= terraform import selectel_dbaas_postgresql_database_v1.database_1 ``` diff --git a/website/docs/r/dbaas_postgresql_datastore_v1.html.markdown b/website/docs/r/dbaas_postgresql_datastore_v1.html.markdown index e48d0b33..dbf2368a 100644 --- a/website/docs/r/dbaas_postgresql_datastore_v1.html.markdown +++ b/website/docs/r/dbaas_postgresql_datastore_v1.html.markdown @@ -114,8 +114,8 @@ You can import a datastore: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= -export SEL_REGION= +export INFRA_PROJECT_ID= +export INFRA_REGION= terraform import selectel_dbaas_mysql_datastore_v1.datastore_1 ``` diff --git a/website/docs/r/dbaas_postgresql_extension_v1.html.markdown b/website/docs/r/dbaas_postgresql_extension_v1.html.markdown index e0b2f749..614ec507 100644 --- a/website/docs/r/dbaas_postgresql_extension_v1.html.markdown +++ b/website/docs/r/dbaas_postgresql_extension_v1.html.markdown @@ -48,8 +48,8 @@ You can import an extension: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= -export SEL_REGION= +export INFRA_PROJECT_ID= +export INFRA_REGION= terraform import selectel_dbaas_postgresql_extension_v1.extension_1 ``` diff --git a/website/docs/r/dbaas_postgresql_logical_replication_slot_v1.html.markdown b/website/docs/r/dbaas_postgresql_logical_replication_slot_v1.html.markdown index 20ef998d..fb50aafa 100644 --- a/website/docs/r/dbaas_postgresql_logical_replication_slot_v1.html.markdown +++ b/website/docs/r/dbaas_postgresql_logical_replication_slot_v1.html.markdown @@ -46,8 +46,8 @@ You can import a replication slot: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= -export SEL_REGION= +export INFRA_PROJECT_ID= +export INFRA_REGION= terraform import selectel_dbaas_postgresql_logical_replication_slot_v1.slot_1 ``` diff --git a/website/docs/r/dbaas_prometheus_metric_token_v1.html.markdown b/website/docs/r/dbaas_prometheus_metric_token_v1.html.markdown index ad534783..14b4bb22 100644 --- a/website/docs/r/dbaas_prometheus_metric_token_v1.html.markdown +++ b/website/docs/r/dbaas_prometheus_metric_token_v1.html.markdown @@ -40,8 +40,8 @@ You can import a token: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= -export SEL_REGION= +export INFRA_PROJECT_ID= +export INFRA_REGION= terraform import selectel_dbaas_prometheus_metric_token_v1.token_1 ``` diff --git a/website/docs/r/dbaas_redis_datastore_v1.html.markdown b/website/docs/r/dbaas_redis_datastore_v1.html.markdown index 2ebd453d..d8d7d88b 100644 --- a/website/docs/r/dbaas_redis_datastore_v1.html.markdown +++ b/website/docs/r/dbaas_redis_datastore_v1.html.markdown @@ -46,7 +46,6 @@ resource "selectel_dbaas_redis_datastore_v1" "datastore_1" { * `restore` - (Optional) Restores parameters for the datastore. Changing this creates a new datastore. * `datastore_id` - (Optional) Unique identifier of the datastore from which you restore. To get the datastore ID, in the [Control panel](https://my.selectel.ru/vpc/dbaas/), go to **Cloud Platform** ⟶ **Managed Databases** ⟶ copy the ID under the cluster name. - * `target_time` - (Optional) Time within seven previous days when you have the datastore state to restore. * `config` - (Optional) Configuration parameters for the datastore. You can retrieve information about available configuration parameters with the [selectel_dbaas_configuration_parameter_v1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/data-sources/dbaas_configuration_parameter_v1) data source. @@ -75,8 +74,8 @@ You can import a datastore: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= -export SEL_REGION= +export INFRA_PROJECT_ID= +export INFRA_REGION= terraform import selectel_dbaas_redis_datastore_v1.datastore_1 ``` diff --git a/website/docs/r/dbaas_user_v1.html.markdown b/website/docs/r/dbaas_user_v1.html.markdown index f68e2c45..25432ed0 100644 --- a/website/docs/r/dbaas_user_v1.html.markdown +++ b/website/docs/r/dbaas_user_v1.html.markdown @@ -72,8 +72,8 @@ You can import a user: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= -export SEL_REGION= +export INFRA_PROJECT_ID= +export INFRA_REGION= terraform import selectel_dbaas_user_v1.user_1 ``` diff --git a/website/docs/r/domains_rrset_v2.html.markdown b/website/docs/r/domains_rrset_v2.html.markdown index 2ec76ec0..69321d60 100644 --- a/website/docs/r/domains_rrset_v2.html.markdown +++ b/website/docs/r/domains_rrset_v2.html.markdown @@ -234,7 +234,7 @@ You can import an RRSet: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= +export INFRA_PROJECT_ID= terraform import selectel_domains_rrset_v2.rrset_1 // ``` diff --git a/website/docs/r/domains_zone_v2.html.markdown b/website/docs/r/domains_zone_v2.html.markdown index 29893800..5462ce0c 100644 --- a/website/docs/r/domains_zone_v2.html.markdown +++ b/website/docs/r/domains_zone_v2.html.markdown @@ -49,7 +49,7 @@ You can import a zone: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= +export INFRA_PROJECT_ID= terraform import selectel_domains_zone_v2.zone_1 ``` diff --git a/website/docs/r/mks_cluster_v1.html.markdown b/website/docs/r/mks_cluster_v1.html.markdown index df0b4ab9..277da758 100644 --- a/website/docs/r/mks_cluster_v1.html.markdown +++ b/website/docs/r/mks_cluster_v1.html.markdown @@ -106,8 +106,8 @@ You can import a cluster: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= -export SEL_REGION= +export INFRA_PROJECT_ID= +export INFRA_REGION= terraform import selectel_mks_cluster_v1.cluster_name ``` diff --git a/website/docs/r/mks_nodegroup_v1.html.markdown b/website/docs/r/mks_nodegroup_v1.html.markdown index eedbe09c..f3843df7 100644 --- a/website/docs/r/mks_nodegroup_v1.html.markdown +++ b/website/docs/r/mks_nodegroup_v1.html.markdown @@ -111,8 +111,8 @@ You can import a node group: export OS_DOMAIN_NAME= export OS_USERNAME= export OS_PASSWORD= -export SEL_PROJECT_ID= -export SEL_REGION= +export INFRA_PROJECT_ID= +export INFRA_REGION= terraform import selectel_mks_nodegroup_v1.nodegroup_1 / ``` diff --git a/website/docs/r/secretsmanager_certificate_v1.html.markdown b/website/docs/r/secretsmanager_certificate_v1.html.markdown index 3daaafce..6be7fde4 100644 --- a/website/docs/r/secretsmanager_certificate_v1.html.markdown +++ b/website/docs/r/secretsmanager_certificate_v1.html.markdown @@ -79,7 +79,7 @@ resource "selectel_secretsmanager_certificate_v1" "certificate_1" { You can import a certificate: ```shell -export SEL_PROJECT_ID= +export INFRA_PROJECT_ID= terraform import selectel_secretsmanager_certificate_v1.certificate_1 ``` diff --git a/website/docs/r/secretsmanager_secret_v1.html.markdown b/website/docs/r/secretsmanager_secret_v1.html.markdown index 8c66c88a..94ebac4d 100644 --- a/website/docs/r/secretsmanager_secret_v1.html.markdown +++ b/website/docs/r/secretsmanager_secret_v1.html.markdown @@ -42,7 +42,7 @@ resource "selectel_secretsmanager_secret_v1" "secret_1" { You can import a secret: ```shell -export SEL_PROJECT_ID= +export INFRA_PROJECT_ID= terraform import selectel_secretsmanager_secret_v1.secret_1 / ``` diff --git a/website/docs/r/vpc_crossregion_subnet_v2.html.markdown b/website/docs/r/vpc_crossregion_subnet_v2.html.markdown deleted file mode 100644 index 8d69f907..00000000 --- a/website/docs/r/vpc_crossregion_subnet_v2.html.markdown +++ /dev/null @@ -1,76 +0,0 @@ ---- -layout: "selectel" -page_title: "Selectel: selectel_vpc_crossregion_subnet_v2" -sidebar_current: "docs-selectel-resource-vpc-crossregion-subnet-v2" -description: |- - Manages a V2 Cross-region subnet resource within VPC Selectel VPC. ---- - -# selectel\_vpc\_crossregion_subnet_v2 - -> **WARNING**: this resource has been removed because Selectel VPC Resell V2 API deprecated usage of crossregion subnets. - -Manages a V2 Cross-region subnet resource within VPC Selectel VPC. - -## Example Usage - -```hcl -resource "selectel_vpc_project_v2" "project_1" { -} - -resource "selectel_vpc_crossregion_subnet_v2" "crossregion_subnet_1" { - project_id = "${selectel_vpc_project_v2.project_1.id}" - cidr = "192.168.200.0/24" - regions { - region = "ru-1" - } - regions { - region = "ru-3" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `project_id` - (Required) An associated Selectel VPC project. Changing this - creates a new Cross-region subnet. - -* `regions` - (Required) An array of regions where the Cross-region subnet resides. - Changing this creates a new Cross-region subnet. The structure is described below. - -* `cidr` - (Required) A cross-region subnet CIDR representation. Changing this - creates a new Cross-region subnet. - -The `regions` block supports: - -* `region` - (Required) A region of where the Cross-region subnet resides. - Changing this creates a new Cross-region subnet. - -## Attributes Reference - -The following attributes are exported: - -* `servers` - Shows information about servers that use this Cross-region subnet. Contains - `id`, `name` and `status` fields. - -* `status` - Shows if the Cross-region subnet is used or not. - -* `subnets` - Shows information about OpenStack Networking subnets that use this - Cross-region subnet. Contains `cidr`, `network_id`, `project_id`, `region`, `subnet_id`, - `vlan_id` and `vtep_ip_address` fields. - -* `vlan_id` - Shows id of the associated VLAN in the OpenStack Networking service for - this Cross-region subnet. - -## Import - -Cross-region subnets can be imported using the `id`, e.g. - -```shell -$ export OS_DOMAIN_NAME=999999 -$ export OS_USERNAME=example_user -$ export OS_PASSWORD=example_password -$ terraform import selectel_vpc_crossregion_subnet_v2.crossregion_subnet_1 2060 -``` diff --git a/website/docs/r/vpc_token_v2.html.markdown b/website/docs/r/vpc_token_v2.html.markdown deleted file mode 100644 index ed7871fb..00000000 --- a/website/docs/r/vpc_token_v2.html.markdown +++ /dev/null @@ -1,27 +0,0 @@ ---- -layout: "selectel" -page_title: "Selectel: selectel_vpc_token_v2" -sidebar_current: "docs-selectel-resource-vpc-token-v2" -description: |- - Creates and manages a Selectel Keystone token using public API v2. ---- - -# selectel\_vpc\_token_v2 - -Creates and manages a Keystone token using public API v2. For more information about Keystone tokens, see the [official Selectel documentation](https://developers.selectel.ru/docs/control-panel/authorization/). - -> **WARNING**: This resource has been removed because it is for keystone tokens and they are automatically invalidated after 24 hours. - -## Example Usage - -```hcl -resource "selectel_vpc_token_v2" "token_1" { - project_id = selectel_vpc_project_v2.project_1.id -} -``` - -## Argument Reference - -* `project_id` - (Required) Unique identifier of the associated project. Changing this creates a new Keystone token. Retrieved from the [selectel_vpc_project_v2](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/vpc_project_v2) resource. Learn more about [Projects](https://docs.selectel.ru/en/control-panel-actions/projects/about-projects/). - -* `account_name` - (Optional) Selectel account ID. Changing this creates a new Keystone token. The account ID is in the top right corner of the [Control panel](https://my.selectel.ru/). diff --git a/website/selectel.erb b/website/selectel.erb index 640d52a6..2707fd8f 100644 --- a/website/selectel.erb +++ b/website/selectel.erb @@ -70,9 +70,6 @@ > selectel_vpc_subnet_v2 - > - selectel_vpc_token_v2 - > selectel_vpc_user_v2