FlexibleEngineCloud/terraform-provider-flexibleengine

flexibleengine_s3_bucket multi_az option

Closed this issue · 3 comments

Hello,

Today we are using Object Storage Service (OSS) with both OBS and S3 bucket which we create with the two following terraform provider objects:

On the first one (OBS) we can activate the multi_az option but not on the second one (S3), is it intended or is it planned to be supported for S3 as well, in a future update maybe?

On OBS bucket, we saw that it's possible to activate this option afterwards (after the bucket creation), but it implies the deletion and recreation of the bucket and so, that it is empty. Same question here, is it intended or is it planned to be enhanced in future update? Indeed, it would be great to have the data copied automatically to other AZs. You mentionned some limitations here, is it still the case?

Best regards,

Maxime LAVOCAT

Hello @maximelavocat , I can give you an answer on the second point.
It's not possible to transform a mono AZ bucket into a multi AZ bucket.
But you can migrate objects from a mono AZ bucket to a multi AZ bucket using obsutil tool : https://docs.prod-cloud-ocb.orange-business.com/utiltg/obs/obs_11_0001.html
Using sync command: https://docs.prod-cloud-ocb.orange-business.com/utiltg/obs/obs_11_0044.html
The only limitation is the bucket names must be different between source and destination.
This synchronization is direct from bucket to bucket if in the same region.
I hope it helps.
BR,
Vincent

Hello, the s3_bucket will be deprecated in the future,so please use obs_bucket to manage new bucket.

You can migrate resource types without recreating by following steps:

  1. terraform state rm flexibleengine_s3_bucket.bucketname, this command removes the resource from the Terraform state file without destroy it;
  2. redefine your resource block with flexibleengine_obs_bucket. In general, only the resource name needs to be changed to flexibleengine_obs_bucket;
  3. import the resource with terraform import flexibleengine_obs_bucket.bucketname ;

Note: some attributes are missing, you can exec terraform apply command to fix it.
If you have any questions, please let us know, thanks!

Hello,

Thanks to both of you for your quick replies.
I tested both of them, and it's working, so we should be able to migrate all our s3 to obs and then activate multi_az on all of them.
Just a little remark if it can be useful to anyone, in your third steps @ShiChangkuo, you also need to add the ID of the resource you want to import, in our case, it's the name of the bucket, so something like that: terraform import flexibleengine_obs_bucket.bucketname bucketname.

Thx again.
Maxime