Skip to content

[FEATURE] Allow to use ovh_cloud_project_volume as a resource #801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kyngs opened this issue Jan 14, 2025 · 3 comments · Fixed by #804
Closed

[FEATURE] Allow to use ovh_cloud_project_volume as a resource #801

kyngs opened this issue Jan 14, 2025 · 3 comments · Fixed by #804

Comments

@kyngs
Copy link

kyngs commented Jan 14, 2025

Description

I would like to configure my block volumes using Terraform. Currently, there's only a data source for ovh_cloud_project_volume, but not a resource.

Affected Resource(s) and/or Data Source(s)

  • ovh_cloud_project_volume

Potential Terraform Configuration

Something like:

resource "ovh_cloud_project_volume" "volume" {
  service_name    = "your_project_id"
  region          = "DE" 
  name            = "my-volume"
  size            = 10  # Size in GB
  type            = "classic"
}

Additional context

I feel like this is intentional, why? To prevent accidental data loss?

@amstuta
Copy link
Collaborator

amstuta commented Jan 14, 2025

Hello @kyngs,

In fact the resource to handle volumes exists, it is just named a bit differently because it is based on the region-centric API routes in the /cloud section.

Here is the resource documentation: https://registry.terraform.io/providers/ovh/ovh/latest/docs/resources/cloud_project_region_volume

Is it what you were looking for ?

@kyngs
Copy link
Author

kyngs commented Jan 14, 2025

Hello @kyngs,

In fact the resource to handle volumes exists, it is just named a bit differently because it is based on the region-centric API routes in the /cloud section.

Here is the resource documentation: https://registry.terraform.io/providers/ovh/ovh/latest/docs/resources/cloud_project_region_volume

Is it what you were looking for ?

Hi, thanks for the quick response.
This resource really does seem like what I was looking for, not sure how I missed it. Tho its category seems odd.
I've got a new question: why does changing the size of the volume force a replace? The administration panel allows me to expand the volume without deleting it.

@amstuta
Copy link
Collaborator

amstuta commented Jan 15, 2025

You're right, the category makes no sense and will be fixed soon!

Regarding the size update, it has not been implemented yet in the provider as it requires a separate API call to POST /cloud/project/{serviceName}/volume/{volumeId}/upsize. We will add this call in the provider shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants