From 5e0b3dab5e82569e057304fa67288d0baa15166d 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 | 21 +++++++++++++++ README.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9fc6002e..84df565d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +1.0.0-rc.1 (June 1, 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)) + +IMPROVEMENT: +----------- + +* Upgrade to Terraform-plugin-sdkv2 and terraform-plugin-framework ([GH-150](https://github.com/outscale/terraform-provider-outscale/issues/150)) +* Somes refactoring + + + 0.12.0 (April 13, 2024) ======================== BUG FIXES: diff --git a/README.md b/README.md index e37d06294..4854d8df2 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,6 +13,79 @@ - [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, you can just 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 + +Somes 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**