ionos-cloud / terraform-provider-ionoscloud

The IonosCloud Terraform provider gives the ability to deploy and configure resources using the IonosCloud APIs.
Mozilla Public License 2.0
34 stars 23 forks source link

S3 Bucket Creation Support `object_lock_enabled` #639

Closed Fabii547 closed 1 month ago

Fabii547 commented 1 month ago

Current Provider Version

6.5.0

Use-cases

As object_lock_enabled can only be set during bucket creation it would be nice to have support for that attribute soon.

It should be easy to add from my understanding as it just involves adding the attribte to the schema model in https://github.com/ionos-cloud/terraform-provider-ionoscloud/blob/master/internal/framework/services/s3/bucket_resource.go and then adjust the create bucket API call.

- _, err := r.client.BucketsApi.CreateBucket(ctx, data.Name.ValueString()).CreateBucketConfiguration(createBucketConfig).Execute()
+ _, err := r.client.BucketsApi.CreateBucket(ctx, data.Name.ValueString()).CreateBucketConfiguration(createBucketConfig).XAmzBucketObjectLockEnabled(xAmzBucketObjectLockEnabled).Execute()

Side note: For ionoscloud_s3_object all possible attributes were implemented directly, therefore I dont see any reason to not support all possible attributes on bucket creation as well.

digna-ionos commented 1 month ago

Hello. Object lock, versioning and other remaining features will be implemented in a future release.

Fabii547 commented 1 month ago

Hello, good to hear that the remaining features will be implemented in a future release. Is there a rough timeline for when these features will be available?

Right now, I'm only interested in creating a bucket with object lock enabled with terraform. Further configuration of object lock is done manually for now. But as this is not possible I'm still forced to use the AWS provider for that.

digna-ionos commented 1 month ago

We started working on it. We will let you know.

digna-ionos commented 1 month ago

@Fabii547 Object lock and all the other s3 features are now implemented in the latest release of our provider. v6.5.2