From a351c7ae26d0f26961009a048f05713fc6519c78 Mon Sep 17 00:00:00 2001 From: Thiery Ouattara Date: Thu, 30 May 2024 15:40:23 +0000 Subject: [PATCH] Update Readme for Migration to provider v1.0.0 --- CHANGELOG.md | 41 ++++++++++++++----- README.md | 112 ++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 123 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9fc6002e..c26715aa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +1.0.0-rc.1 (June 19, 2024) +======================== +BUG FIXES: +---------- + +* Error in attributes value for healthy_threshold ([GH-450](https://github.com/outscale/terraform-provider-outscale/issues/450)) + +FEATURES: +--------- + +* Enable adding Tag on boot disk ([GH-110](https://github.com/outscale/terraform-provider-outscale/issues/110)) +* Enable linked multiple flexible GPUs to VM ([GH-220](https://github.com/outscale/terraform-provider-outscale/issues/220)) + +IMPROVEMENTS: +----------- +* Rename ``` outscale_volumes_link ``` to ``` outscale_volume_link ``` +* Upgrade to Terraform-plugin-sdkv2 and terraform-plugin-framework ([GH-150](https://github.com/outscale/terraform-provider-outscale/issues/150)) +* Some refactoring + 0.12.0 (April 13, 2024) ======================== BUG FIXES: @@ -14,11 +33,11 @@ FEATURES: * Update vm data_source(s) ([filters](https://docs.outscale.com/en/userguide/Home.html#_january_2024)) ([GH-431](https://github.com/outscale/terraform-provider-outscale/issues/431)) * Enable to set a route table as Main ([GH-362](https://github.com/outscale/terraform-provider-outscale/issues/362)) -IMPROVEMENT: +IMPROVEMENTS: ----------- * Update tests and osc-sdk-go -* Somes refactoring +* Some refactoring 0.11.0 (February 13, 2024) ======================== @@ -28,11 +47,11 @@ FEATURES: * Support for Creating Security Group Rules Using Security Group Names ([GH-399](https://github.com/outscale/terraform-provider-outscale/issues/399)) -IMPROVEMENT: +IMPROVEMENTS: ----------- * Update tests and osc-sdk-go -* Somes refactoring +* Some refactoring 0.10.0 (November 10, 2023) ======================== @@ -52,7 +71,7 @@ FEATURES: * Implement snapshot creation before volume deletion by terraform destroy ([GH-367](https://github.com/outscale/terraform-provider-outscale/issues/367)) * Support differential updates for outscale_load_balancer_vms ([GH-54](https://github.com/outscale/terraform-provider-outscale/issues/54)) -IMPROVEMENT: +IMPROVEMENTS: ----------- * Remove other inbound_rules and outbound_rules from outscale_security_group_rule ([GH-286](https://github.com/outscale/terraform-provider-outscale/issues/286)) @@ -78,7 +97,7 @@ FEATURES: * Implement all_vms parametter in vm_state datasource(s) ([GH-291](https://github.com/outscale/terraform-provider-outscale/issues/291)) -IMPROVEMENT: +IMPROVEMENTS: ----------- * Using environment secret and remove pull_request_target @@ -113,7 +132,7 @@ FEATURES: * Check the behaviour of the provider when the resource is removed manually by the user ([GH-19](https://github.com/outscale/terraform-provider-outscale/issues/19)) * "bsu_optimized" parameter in VM is deprecated in our API ([GH-217](https://github.com/outscale/terraform-provider-outscale/issues/217)) -IMPROVEMENT: +IMPROVEMENTS: ----------- * Move ```terraform-provider-outscale``` repository form ```outscale-dev``` to ```outscale``` organization @@ -141,7 +160,7 @@ FEATURES: * Implement "CreationDate" parameter in Vm resources and datasource(s) ([GH-125](https://github.com/outscale-dev/terraform-provider-outscale/issues/125)) * Implement "LocationCode" parameter in Subregions datasource ([GH-140](https://github.com/outscale-dev/terraform-provider-outscale/issues/140)) -IMPROVEMENT: +IMPROVEMENTS: ----------- * Add more parameters for throttling checking ([GH-207](https://github.com/outscale-dev/terraform-provider-outscale/issues/207)) @@ -164,7 +183,7 @@ FEATURES: * Implement Api Access Policy ([GH-147](https://github.com/outscale-dev/terraform-provider-outscale/issues/147)) * Implement "Ca" resource and datasource(s) ([GH-151](https://github.com/outscale-dev/terraform-provider-outscale/issues/151)) -IMPROVEMENT: +IMPROVEMENTS: ----------- * Change the description when parameters are quoted ([GH-101](https://github.com/outscale-dev/terraform-provider-outscale/issues/101)) @@ -183,7 +202,7 @@ BUG FIXES: * Fix StartVM action when updating VM tags ([GH-86](https://github.com/outscale-dev/terraform-provider-outscale/issues/86)) * Fix ```secondary_private_ip_count``` parameter in outscale_nic_private_ip resource ([GH-100](https://github.com/outscale-dev/terraform-provider-outscale/issues/100)) -IMPROVEMENT: +IMPROVEMENTS: ----------- * Update retrying when api call throttled ([GH-106](https://github.com/outscale-dev/terraform-provider-outscale/issues/106)) @@ -206,7 +225,7 @@ BUG FIXES: * Fix tags on outscale_resources #68 * iops value is set to 0 for standard volumes (TPD-2053) -IMPROVEMENT: +IMPROVEMENTS: ----------- * Update sdk diff --git a/README.md b/README.md index e37d06294..76ca14478 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ - 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) -Terraform +Terraform ## Requirements @@ -13,13 +13,87 @@ - [Go](https://golang.org/doc/install) 1.22.0 (to build the provider plugin) +## Migration to v1 + +> [!WARNING] +> +> Before you begin using the ```v1``` binary on your Terraform code, make sure to back up your state file! +> +> If you are using a local state file, make copy of your terraform.tfstate file in your project directory. +> +> If you are using a remote backend such as an S3 bucket, make sure that you follow the backup procedures and that you exercise the restore procedure at least once. +> +> Additionally, make sure you backup or version your code as migration will require some code changes (on Flexible_gpu resource). + +### Step 1: Upgrade provider version + +```sh +terraform { + required_providers { + outscale = { + source = "outscale/outscale" + version = "1.0.0-rc.1" + } + } +} + +provider "outscale" { + # Configuration options +} +``` + +```sh +terraform init -upgrade +``` + +### Step 2: Edit terraform state and configuration files + +Some block types changed in terraform state, the following script will delete those blocks. + +Then ``` terraform refresh``` or ``` terraform apply ``` will set the right block type. + +#### On Linux +```sh +terraform fmt +sed -i '/"block_device_mappings_created": \[/, /\],/d' terraform.tfstate +sed -i 's/outscale_volumes_link/outscale_volume_link/g' terraform.tfstate +sed -i '/"link_public_ip": {/, /},/d' terraform.tfstate +sed -i '/"link_nic": {/, /},/d' terraform.tfstate +sed -i '/"flexible_gpu_id": "/, /",/d' terraform.tfstate +sed -i 's/outscale_volumes_link/outscale_volume_link/g' *.tf +sed -i 's/flexible_gpu_id /flexible_gpu_ids /g' *.tf +sed -i '/flexible_gpu_ids /s/= /= \[/' *.tf +sed -i '/outscale_flexible_gpu\./s/$/ \]/' *.tf +terraform fmt +``` + +#### On MacOS +```sh +terraform fmt +sed -i='' '/"block_device_mappings_created": \[/, /\],/d' terraform.tfstate +sed -i='' 's/outscale_volumes_link/outscale_volume_link/g' terraform.tfstate +sed -i='' '/"link_public_ip": {/, /},/d' terraform.tfstate +sed -i='' '/"link_nic": {/, /},/d' terraform.tfstate +sed -i='' '/"flexible_gpu_id": "/, /",/d' terraform.tfstate +sed -i='' 's/outscale_volumes_link/outscale_volume_link/g' *.tf +sed -i='' 's/flexible_gpu_id /flexible_gpu_ids /g' *.tf +sed -i='' '/flexible_gpu_ids /s/= /= \[/' *.tf +sed -i='' '/outscale_flexible_gpu\./s/$/\]/' *.tf +terraform fmt +``` +### Step 3: Refresh configuration to update terraform state + +```sh +terraform refresh +``` + ## Breaking change > **Warning** > > We have a broken change on our api when creating access_key without expiration date for all version less then v0.9.0. ([GH-issues](https://github.com/outscale/terraform-provider-outscale/issues/342)) > -> We recommend to upgrade on the latest ([v0.12.0](https://registry.terraform.io/providers/outscale/outscale/latest)) +> We recommend to upgrade on the latest ([v1.0.0-rc.1](https://registry.terraform.io/providers/outscale/outscale/latest)) ## Using the Provider with Terraform @@ -36,7 +110,7 @@ terraform { required_providers { outscale = { source = "outscale/outscale" - version = "0.12.0" + version = "1.0.0-rc.1" } } } @@ -56,7 +130,7 @@ terraform { required_providers { outscale = { source = "outscale/outscale" - version = "0.12.0" + version = "1.0.0-rc.1" } } } @@ -89,7 +163,7 @@ terraform { required_providers { outscale = { source = "outscale/outscale" - version = "0.12.0" + version = "1.0.0-rc.1" } } } @@ -113,12 +187,12 @@ Clone repository to: `$GOPATH/src/github.com/outscale/terraform-provider-outscal ```sh mkdir -p $GOPATH/src/github.com/terraform-providers cd $GOPATH/src/github.com/terraform-providers -git clone --branch v0.12.0 https://github.com/outscale/terraform-provider-outscale +git clone --branch v1.0.0-rc.1 https://github.com/outscale/terraform-provider-outscale ``` Enter the provider directory and build the provider ```sh cd $GOPATH/src/github.com/terraform-providers/terraform-provider-outscale -go build -o terraform-provider-outscale_v0.12.0 +go build -o terraform-provider-outscale_v1.0.0-rc.1 ``` ## Using the provider built ### For Terraform @@ -126,10 +200,10 @@ go build -o terraform-provider-outscale_v0.12.0 1. Download and install [Terraform](https://www.terraform.io/downloads.html) -2. Move the plugin to the repository ~/.terraform.d/plugins/registry.terraform.io/outscale/outscale/0.12.0/linux_amd64/. +2. Move the plugin to the repository ~/.terraform.d/plugins/registry.terraform.io/outscale/outscale/1.0.0-rc.1/linux_amd64/. ```shell -mkdir -p ~/.terraform.d/plugins/registry.terraform.io/outscale/outscale/0.12.0/linux_amd64 -mv terraform-provider-outscale_v0.12.0 ~/.terraform.d/plugins/registry.terraform.io/outscale/outscale/0.12.0/linux_amd64 +mkdir -p ~/.terraform.d/plugins/registry.terraform.io/outscale/outscale/1.0.0-rc.1/linux_amd64 +mv terraform-provider-outscale_v1.0.0-rc.1 ~/.terraform.d/plugins/registry.terraform.io/outscale/outscale/1.0.0-rc.1/linux_amd64 ``` 3. Execute `terraform init` @@ -138,10 +212,10 @@ mv terraform-provider-outscale_v0.12.0 ~/.terraform.d/plugins/registry.terraform #### On macOS 1. Download and install [Terraform](https://www.terraform.io/downloads.html) -2. Move the plugin to the repository ~/.terraform.d/plugins/registry.terraform.io/outscale/outscale/0.12.0/darwin_arm64 +2. Move the plugin to the repository ~/.terraform.d/plugins/registry.terraform.io/outscale/outscale/1.0.0-rc.1/darwin_arm64 ```shell -mkdir -p ~/.terraform.d/plugins/registry.terraform.io/outscale/outscale/0.12.0/darwin_arm64 -mv terraform-provider-outscale_v0.12.0 ~/.terraform.d/plugins/registry.terraform.io/outscale/outscale/0.12.0/darwin_arm64 +mkdir -p ~/.terraform.d/plugins/registry.terraform.io/outscale/outscale/1.0.0-rc.1/darwin_arm64 +mv terraform-provider-outscale_v1.0.0-rc.1 ~/.terraform.d/plugins/registry.terraform.io/outscale/outscale/1.0.0-rc.1/darwin_arm64 ``` 3. Execute `terraform init` @@ -153,10 +227,10 @@ mv terraform-provider-outscale_v0.12.0 ~/.terraform.d/plugins/registry.terraform 1. Download and install [OpenTofu](https://opentofu.org/docs/intro/install/deb/) -2. Move the plugin to the repository ~/.terraform.d/plugins/registry.opentofu.org/outscale/outscale/0.12.0/linux_amd64/. +2. Move the plugin to the repository ~/.terraform.d/plugins/registry.opentofu.org/outscale/outscale/1.0.0-rc.1/linux_amd64/. ```shell -mkdir -p ~/.terraform.d/plugins/registry.opentofu.org/outscale/outscale/0.12.0/linux_amd64 -mv terraform-provider-outscale_v0.12.0 ~/.terraform.d/plugins/registry.opentofu.org/outscale/outscale/0.12.0/linux_amd64 +mkdir -p ~/.terraform.d/plugins/registry.opentofu.org/outscale/outscale/1.0.0-rc.1/linux_amd64 +mv terraform-provider-outscale_v1.0.0-rc.1 ~/.terraform.d/plugins/registry.opentofu.org/outscale/outscale/1.0.0-rc.1/linux_amd64 ``` 3. Execute `tofu init` @@ -165,10 +239,10 @@ mv terraform-provider-outscale_v0.12.0 ~/.terraform.d/plugins/registry.opentofu. #### On macOS 1. Download and install [OpenTofu](https://opentofu.org/docs/intro/install/homebrew/) -2. Move the plugin to the repository ~/.terraform.d/plugins/registry.opentofu.org/outscale/outscale/0.12.0/darwin_arm64 +2. Move the plugin to the repository ~/.terraform.d/plugins/registry.opentofu.org/outscale/outscale/1.0.0-rc.1/darwin_arm64 ```shell -mkdir -p ~/.terraform.d/plugins/registry.opentofu.org/outscale/outscale/0.12.0/darwin_arm64 -mv terraform-provider-outscale_v0.12.0 ~/.terraform.d/plugins/registry.opentofu.org/outscale/outscale/0.12.0/darwin_arm64 +mkdir -p ~/.terraform.d/plugins/registry.opentofu.org/outscale/outscale/1.0.0-rc.1/darwin_arm64 +mv terraform-provider-outscale_v1.0.0-rc.1 ~/.terraform.d/plugins/registry.opentofu.org/outscale/outscale/1.0.0-rc.1/darwin_arm64 ``` 3. Execute `tofu init`