diff --git a/internal/services/block/testdata/volume-update-iops.cassette.yaml b/internal/services/block/testdata/volume-update-iops.cassette.yaml new file mode 100644 index 0000000000..97d6907096 --- /dev/null +++ b/internal/services/block/testdata/volume-update-iops.cassette.yaml @@ -0,0 +1,838 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 153 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"name":"test-block-volume-update-iops","perf_iops":5000,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","from_empty":{"size":20000000000},"tags":[]}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 412 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":5000},"status":"creating","tags":[],"type":"sbs_5k","updated_at":"2025-06-18T13:13:45.748366Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "412" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:45 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 613ebc65-738c-4d4b-98f5-ceb180f930c2 + status: 200 OK + code: 200 + duration: 1.691045458s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 412 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":5000},"status":"creating","tags":[],"type":"sbs_5k","updated_at":"2025-06-18T13:13:45.748366Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "412" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:45 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - ce08871a-7685-4593-8426-81b028690c88 + status: 200 OK + code: 200 + duration: 51.009875ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 413 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":5000},"status":"available","tags":[],"type":"sbs_5k","updated_at":"2025-06-18T13:13:45.748366Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "413" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:50 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - cc60d06f-969f-4cad-a994-f23254e35f46 + status: 200 OK + code: 200 + duration: 69.128334ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 413 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":5000},"status":"available","tags":[],"type":"sbs_5k","updated_at":"2025-06-18T13:13:45.748366Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "413" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:50 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a416cd3f-761e-411a-8ab9-b9e108e69e00 + status: 200 OK + code: 200 + duration: 49.972125ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 413 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":5000},"status":"available","tags":[],"type":"sbs_5k","updated_at":"2025-06-18T13:13:45.748366Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "413" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:51 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1c85fb33-5703-48cd-ba88-102977acb5e4 + status: 200 OK + code: 200 + duration: 45.625833ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 413 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":5000},"status":"available","tags":[],"type":"sbs_5k","updated_at":"2025-06-18T13:13:45.748366Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "413" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:51 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d5d82876-1d53-48af-a00d-9f8730d471bf + status: 200 OK + code: 200 + duration: 70.454458ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 413 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":5000},"status":"available","tags":[],"type":"sbs_5k","updated_at":"2025-06-18T13:13:45.748366Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "413" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:51 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 329ecdca-ea73-44e2-b27c-c04d26c51099 + status: 200 OK + code: 200 + duration: 44.256375ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 413 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":5000},"status":"available","tags":[],"type":"sbs_5k","updated_at":"2025-06-18T13:13:45.748366Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "413" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:51 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 20543fb0-e7cd-400f-8d9c-563bccd126f7 + status: 200 OK + code: 200 + duration: 49.753125ms + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 19 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"perf_iops":15000}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 412 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":5000},"status":"updating","tags":[],"type":"sbs_5k","updated_at":"2025-06-18T13:13:45.748366Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "412" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:51 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1e0eb1fa-3955-4d4c-a8e6-aa747e859a93 + status: 200 OK + code: 200 + duration: 95.571459ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 412 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":5000},"status":"updating","tags":[],"type":"sbs_5k","updated_at":"2025-06-18T13:13:45.748366Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "412" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:51 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7f80e160-2bed-41c6-8627-cc053da02a04 + status: 200 OK + code: 200 + duration: 55.249334ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 415 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":15000},"status":"available","tags":[],"type":"sbs_15k","updated_at":"2025-06-18T13:13:51.874158Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "415" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:56 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b56a0968-0c8f-4a66-b6f7-c4839ab55c27 + status: 200 OK + code: 200 + duration: 119.419208ms + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 415 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":15000},"status":"available","tags":[],"type":"sbs_15k","updated_at":"2025-06-18T13:13:51.874158Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "415" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:57 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b6e40c14-359c-47e3-a355-bd3cc6171d07 + status: 200 OK + code: 200 + duration: 38.117375ms + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 415 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":15000},"status":"available","tags":[],"type":"sbs_15k","updated_at":"2025-06-18T13:13:51.874158Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "415" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:57 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 95c7bc6b-c587-40bc-8971-1a7a9ab398db + status: 200 OK + code: 200 + duration: 36.929334ms + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 415 + uncompressed: false + body: '{"created_at":"2025-06-18T13:13:45.748366Z","id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","last_detached_at":null,"name":"test-block-volume-update-iops","parent_snapshot_id":null,"project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5","references":[],"size":20000000000,"specs":{"class":"sbs","perf_iops":15000},"status":"available","tags":[],"type":"sbs_15k","updated_at":"2025-06-18T13:13:51.874158Z","zone":"fr-par-1"}' + headers: + Content-Length: + - "415" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:57 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a762848b-0431-4945-874f-69131c7617ef + status: 200 OK + code: 200 + duration: 49.114417ms + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:57 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - e5a93b32-319e-49de-9bdf-b9472fe8a236 + status: 204 No Content + code: 204 + duration: 70.587334ms + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 127 + uncompressed: false + body: '{"message":"resource is not found","resource":"volume","resource_id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","type":"not_found"}' + headers: + Content-Length: + - "127" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:57 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - cd8098e3-e09e-4876-86df-edfa246f8b34 + status: 404 Not Found + code: 404 + duration: 36.871167ms + - id: 16 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.2; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/block/v1alpha1/zones/fr-par-1/volumes/6a5924fc-234f-472d-a747-9d840dd3bfbf + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 127 + uncompressed: false + body: '{"message":"resource is not found","resource":"volume","resource_id":"6a5924fc-234f-472d-a747-9d840dd3bfbf","type":"not_found"}' + headers: + Content-Length: + - "127" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Wed, 18 Jun 2025 13:13:57 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f80a33ae-eb25-4fa2-8673-abfe6cc1c3fd + status: 404 Not Found + code: 404 + duration: 58.433375ms diff --git a/internal/services/block/volume.go b/internal/services/block/volume.go index 7f9d847caf..f753616c3a 100644 --- a/internal/services/block/volume.go +++ b/internal/services/block/volume.go @@ -44,7 +44,6 @@ func ResourceVolume() *schema.Resource { Type: schema.TypeInt, Required: true, Description: "The maximum IO/s expected, must match available options", - ForceNew: true, }, "size_in_gb": { Type: schema.TypeInt, @@ -214,6 +213,10 @@ func ResourceBlockVolumeUpdate(ctx context.Context, d *schema.ResourceData, m an req.Tags = types.ExpandUpdatedStringsPtr(d.Get("tags")) } + if d.HasChange("iops") { + req.PerfIops = types.ExpandUint32Ptr(d.Get("iops")) + } + if _, err := api.UpdateVolume(req, scw.WithContext(ctx)); err != nil { return diag.FromErr(err) } diff --git a/internal/services/block/volume_test.go b/internal/services/block/volume_test.go index e3196ebe74..fb8ede4bfa 100644 --- a/internal/services/block/volume_test.go +++ b/internal/services/block/volume_test.go @@ -223,3 +223,42 @@ func TestAccVolume_FromInstance(t *testing.T) { }, }) } + +func TestAccVolume_UpdateIops(t *testing.T) { + tt := acctest.NewTestTools(t) + defer tt.Cleanup() + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ProviderFactories: tt.ProviderFactories, + CheckDestroy: blocktestfuncs.IsVolumeDestroyed(tt), + Steps: []resource.TestStep{ + { + Config: ` + resource scaleway_block_volume main { + name = "test-block-volume-update-iops" + iops = 5000 + size_in_gb = 20 + } + `, + Check: resource.ComposeTestCheckFunc( + blocktestfuncs.IsVolumePresent(tt, "scaleway_block_volume.main"), + resource.TestCheckResourceAttr("scaleway_block_volume.main", "iops", "5000"), + ), + }, + { + Config: ` + resource scaleway_block_volume main { + name = "test-block-volume-update-iops" + iops = 15000 + size_in_gb = 20 + } + `, + Check: resource.ComposeTestCheckFunc( + blocktestfuncs.IsVolumePresent(tt, "scaleway_block_volume.main"), + resource.TestCheckResourceAttr("scaleway_block_volume.main", "iops", "15000"), + ), + }, + }, + }) +}