diff --git a/docs/resources/iam_user.md b/docs/resources/iam_user.md index 347257ded3..35a33212c5 100644 --- a/docs/resources/iam_user.md +++ b/docs/resources/iam_user.md @@ -10,14 +10,29 @@ For more information, see the [API documentation](https://www.scaleway.com/en/de ## Example Usage -### Basic +### Guest user ```terraform -resource "scaleway_iam_user" "basic" { - email = "test@test.com" +resource "scaleway_iam_user" "guest" { + email = "foo@test.com" + tags = ["test-tag"] } ``` +### Member user + +```terraform +resource "scaleway_iam_user" "member" { + email = "foo@test.com" + tags = ["test-tag"] + username = "foo" + first_name = "Foo" + last_name = "Bar" +} +``` + +When `username` is set, the user is created as a [Member](https://www.scaleway.com/en/docs/iam/concepts/#member). Otherwise, it is created as a [Guest](https://www.scaleway.com/en/docs/iam/concepts/#guest). + ### Multiple users ```terraform @@ -28,7 +43,7 @@ locals { ]) } -resource scaleway_iam_user user { +resource "scaleway_iam_user" "user" { for_each = local.users email = each.key } @@ -36,27 +51,44 @@ resource scaleway_iam_user user { ## Argument Reference -- `email` - (Required) The email of the IAM user. +- `organization_id` - (Defaults to [provider](../index.md#organization_id) `organization_id`) The ID of the organization the user is associated with. + +- `email` - (Required) The email of the IAM user. For Guest users, this argument is not editable. - `tags` - (Optional) The tags associated with the user. -- `organization_id` - (Defaults to [provider](../index.md#organization_d) `organization_id`) The ID of the organization the user is associated with. +- `username` - (Optional) The username of the IAM user. When it is set, the user is created as a Member. When it is not set, the user is created as a Guest and the username is set as equal to the email. + +- `password` - The password for first access. + +- `send_password_email` - Whether or not to send an email containing the password for first access. + +- `send_welcome_email` - Whether or not to send a welcome email that includes onboarding information. + +- `first_name` - The user's first name. + +- `last_name` - The user's last name. + +- `phone_number` - The user's phone number. + +- `locale` - The user's locale (e.g., en_US). + +Important: When creating a Guest user, all arguments are ignored, except for `organization_id`, `email` and `tags`. ## Attributes Reference In addition to all arguments above, the following attributes are exported: - `id` - The ID of the user (UUID format). -- `email` - The email of the user - `created_at` - The date and time of the creation of the IAM user. - `updated_at` - The date and time of the last update of the IAM user. - `deletable` - Whether the IAM user is deletable. -- `organization_id` - The ID of the organization the user. - `last_login_at` - The date of the last login. - `type` - The type of user. Check the possible values in the [API doc](https://www.scaleway.com/en/developers/api/iam/#path-users-get-a-given-user). - `status` - The status of user invitation. Check the possible values in the [API doc](https://www.scaleway.com/en/developers/api/iam/#path-users-get-a-given-user). - `mfa` - Whether the MFA is enabled. - `account_root_user_id` - The ID of the account root user associated with the user. +- `locked` - Whether the user is locked. ## Import diff --git a/internal/services/iam/testdata/user-basic.cassette.yaml b/internal/services/iam/testdata/user-guest.cassette.yaml similarity index 53% rename from internal/services/iam/testdata/user-basic.cassette.yaml rename to internal/services/iam/testdata/user-guest.cassette.yaml index 3c8a9a9411..debf86ee58 100644 --- a/internal/services/iam/testdata/user-basic.cassette.yaml +++ b/internal/services/iam/testdata/user-guest.cassette.yaml @@ -12,13 +12,13 @@ interactions: host: api.scaleway.com remote_addr: "" request_uri: "" - body: '{"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","email":"foo@scaleway.com","tags":["tf_tests","tests"]}' + body: '{"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","email":"foo@scaleway.com","tags":["tf_tests","tests"]}' form: {} headers: Content-Type: - application/json User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests url: https://api.scaleway.com/iam/v1alpha1/users method: POST response: @@ -27,20 +27,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 451 + content_length: 516 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":["tf_tests","tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:39.511583Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":["tf_tests","tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:22.620743Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "451" + - "516" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:39 GMT + - Wed, 14 May 2025 21:48:22 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -48,10 +48,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 0a44f7d0-ff9a-4a8a-920c-74d11951910f + - 2c3aba16-7584-4256-9f40-57ee15e804c1 status: 200 OK code: 200 - duration: 230.0025ms + duration: 629.974733ms - id: 1 request: proto: HTTP/1.1 @@ -67,8 +67,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -76,20 +76,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 451 + content_length: 516 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":["tf_tests","tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:39.511583Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":["tf_tests","tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:22.620743Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "451" + - "516" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:39 GMT + - Wed, 14 May 2025 21:48:22 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -97,10 +97,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 6fd5c634-4a1d-4823-a00f-31e7b1587d7e + - 41d15729-5784-4112-a310-0b9c7206971e status: 200 OK code: 200 - duration: 93.144833ms + duration: 77.235639ms - id: 2 request: proto: HTTP/1.1 @@ -116,8 +116,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -125,20 +125,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 451 + content_length: 516 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":["tf_tests","tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:39.511583Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":["tf_tests","tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:22.620743Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "451" + - "516" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:39 GMT + - Wed, 14 May 2025 21:48:23 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -146,10 +146,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - f3e2ddc6-edd3-4d15-abc0-1c49ac61c122 + - 9253f469-d6c8-4a74-9beb-f9a6056d7d64 status: 200 OK code: 200 - duration: 106.723916ms + duration: 66.612769ms - id: 3 request: proto: HTTP/1.1 @@ -165,8 +165,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -174,20 +174,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 451 + content_length: 516 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":["tf_tests","tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:39.511583Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":["tf_tests","tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:22.620743Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "451" + - "516" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:40 GMT + - Wed, 14 May 2025 21:48:23 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -195,10 +195,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 778d6c1a-5d04-4055-b2a3-30b168edbe02 + - fb01ae62-6f5b-4848-8473-9570817aee34 status: 200 OK code: 200 - duration: 89.256208ms + duration: 76.045584ms - id: 4 request: proto: HTTP/1.1 @@ -214,8 +214,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -223,20 +223,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 451 + content_length: 516 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":["tf_tests","tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:39.511583Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":["tf_tests","tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:22.620743Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "451" + - "516" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:42 GMT + - Wed, 14 May 2025 21:48:23 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -244,10 +244,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - b791f3f7-13e0-427f-af09-38f2aaddd897 + - 6b3d424e-99ab-49c3-a184-fd7bd4d977c2 status: 200 OK code: 200 - duration: 87.221667ms + duration: 72.558045ms - id: 5 request: proto: HTTP/1.1 @@ -263,8 +263,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -272,20 +272,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 451 + content_length: 516 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":["tf_tests","tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:39.511583Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":["tf_tests","tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:22.620743Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "451" + - "516" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:43 GMT + - Wed, 14 May 2025 21:48:24 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -293,10 +293,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 90f34204-aab5-4951-a817-aa9087a35050 + - e8c44843-b448-4cec-b9d2-cbd381a5eed2 status: 200 OK code: 200 - duration: 78.3495ms + duration: 77.646432ms - id: 6 request: proto: HTTP/1.1 @@ -314,8 +314,8 @@ interactions: Content-Type: - application/json User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: PATCH response: proto: HTTP/2.0 @@ -323,20 +323,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 442 + content_length: 507 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":["tf_tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:39.511583Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":["tf_tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:22.620743Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "442" + - "507" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:43 GMT + - Wed, 14 May 2025 21:48:24 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -344,10 +344,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 52c86ff4-254f-424d-bd3c-81e0e086c96a + - 3ff2da43-b7a8-4b49-a374-e023402b911e status: 200 OK code: 200 - duration: 146.131458ms + duration: 102.822095ms - id: 7 request: proto: HTTP/1.1 @@ -363,8 +363,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -372,20 +372,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 442 + content_length: 507 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":["tf_tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:43.735416Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":["tf_tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:24.709613Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "442" + - "507" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:43 GMT + - Wed, 14 May 2025 21:48:24 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -393,10 +393,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 94ae025b-9f76-49f5-b2ce-c4a18600111f + - a579485d-3672-4ac6-ba3e-d24fd1b14c2d status: 200 OK code: 200 - duration: 117.443708ms + duration: 73.015636ms - id: 8 request: proto: HTTP/1.1 @@ -412,8 +412,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -421,20 +421,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 442 + content_length: 507 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":["tf_tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:43.735416Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":["tf_tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:24.709613Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "442" + - "507" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:44 GMT + - Wed, 14 May 2025 21:48:25 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -442,10 +442,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 1f64668a-e99b-47b8-bc21-d12a7965cc35 + - 3159c31f-535f-46cd-bcba-2b0392366d38 status: 200 OK code: 200 - duration: 111.291125ms + duration: 73.267675ms - id: 9 request: proto: HTTP/1.1 @@ -461,8 +461,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -470,20 +470,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 442 + content_length: 507 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":["tf_tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:43.735416Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":["tf_tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:24.709613Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "442" + - "507" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:45 GMT + - Wed, 14 May 2025 21:48:25 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -491,10 +491,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 25662f70-49cb-4353-932f-89d5f709bd76 + - 7a903228-425b-47c0-8cce-c4b29537d5b8 status: 200 OK code: 200 - duration: 93.201209ms + duration: 68.184553ms - id: 10 request: proto: HTTP/1.1 @@ -510,8 +510,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -519,20 +519,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 442 + content_length: 507 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":["tf_tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:43.735416Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":["tf_tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:24.709613Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "442" + - "507" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:46 GMT + - Wed, 14 May 2025 21:48:25 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -540,10 +540,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 0ade363a-760e-441e-bfe1-b6c96abe486b + - 716c7697-2689-4a06-8396-a829cb0f2de4 status: 200 OK code: 200 - duration: 106.985958ms + duration: 71.058715ms - id: 11 request: proto: HTTP/1.1 @@ -559,8 +559,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -568,20 +568,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 442 + content_length: 507 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":["tf_tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:43.735416Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":["tf_tests"],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:24.709613Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "442" + - "507" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:47 GMT + - Wed, 14 May 2025 21:48:26 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -589,10 +589,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - bb25ed3e-9336-4e2c-932e-1fe68a9fe4ac + - eaf5caf4-e033-4b39-a2ce-bc759e6b8c65 status: 200 OK code: 200 - duration: 106.241166ms + duration: 69.674784ms - id: 12 request: proto: HTTP/1.1 @@ -610,8 +610,8 @@ interactions: Content-Type: - application/json User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: PATCH response: proto: HTTP/2.0 @@ -619,20 +619,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 432 + content_length: 497 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":[],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:43.735416Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":[],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:24.709613Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "432" + - "497" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:47 GMT + - Wed, 14 May 2025 21:48:26 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -640,10 +640,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 64543919-225c-4435-aa1c-e15fdc319858 + - c619818f-a311-4a53-b6a8-36310364849a status: 200 OK code: 200 - duration: 126.817208ms + duration: 90.012731ms - id: 13 request: proto: HTTP/1.1 @@ -659,8 +659,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -668,20 +668,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 432 + content_length: 497 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":[],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:47.966882Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":[],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:26.549064Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "432" + - "497" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:48 GMT + - Wed, 14 May 2025 21:48:26 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -689,10 +689,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 18968751-dd04-45bd-94c3-a0c416ae778e + - e813f249-39c4-4f48-b8fc-93469f40a7b3 status: 200 OK code: 200 - duration: 92.010125ms + duration: 63.797301ms - id: 14 request: proto: HTTP/1.1 @@ -708,8 +708,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -717,20 +717,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 432 + content_length: 497 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":[],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:47.966882Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":[],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:26.549064Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "432" + - "497" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:48 GMT + - Wed, 14 May 2025 21:48:26 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -738,10 +738,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - f1997d20-ab4e-4556-aab6-278384b94734 + - d56f7042-1838-4540-9152-61965fe868c1 status: 200 OK code: 200 - duration: 117.1115ms + duration: 64.537613ms - id: 15 request: proto: HTTP/1.1 @@ -757,8 +757,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -766,20 +766,20 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 432 + content_length: 497 uncompressed: false - body: '{"account_root_user_id":"","created_at":"2025-01-22T15:32:39.511583Z","deletable":true,"email":"foo@scaleway.com","id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","last_login_at":null,"locked":false,"mfa":false,"organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","status":"invitation_pending","tags":[],"two_factor_enabled":false,"type":"guest","updated_at":"2025-01-22T15:32:47.966882Z","username":"foo@scaleway.com"}' + body: '{"account_root_user_id":"","created_at":"2025-05-14T21:48:22.620743Z","deletable":true,"email":"foo@scaleway.com","first_name":"","id":"51683291-2d50-4f62-bdf6-353518fdfdc9","last_login_at":null,"last_name":"","locale":"","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"invitation_pending","tags":[],"two_factor_enabled":false,"type":"guest","updated_at":"2025-05-14T21:48:26.549064Z","username":"foo@scaleway.com"}' headers: Content-Length: - - "432" + - "497" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:49 GMT + - Wed, 14 May 2025 21:48:27 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -787,10 +787,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 80b05fff-55eb-40df-ba28-ad11adf4d50f + - 392ef50d-592f-4f10-8667-d5908224abc6 status: 200 OK code: 200 - duration: 103.51275ms + duration: 85.521974ms - id: 16 request: proto: HTTP/1.1 @@ -806,8 +806,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: DELETE response: proto: HTTP/2.0 @@ -824,9 +824,9 @@ interactions: Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:50 GMT + - Wed, 14 May 2025 21:48:27 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -834,10 +834,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - e9f9a313-8ab1-41fb-a31d-0f7fa3111239 + - e0dfbf7b-6e53-487a-a02b-fe83d21a5237 status: 204 No Content code: 204 - duration: 151.396166ms + duration: 178.505239ms - id: 17 request: proto: HTTP/1.1 @@ -853,8 +853,8 @@ interactions: form: {} headers: User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/iam/v1alpha1/users/3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348 + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/51683291-2d50-4f62-bdf6-353518fdfdc9 method: GET response: proto: HTTP/2.0 @@ -864,7 +864,7 @@ interactions: trailer: {} content_length: 125 uncompressed: false - body: '{"message":"resource is not found","resource":"user","resource_id":"3c290f7a-f0ec-4a6e-8b21-b2d16ec9b348","type":"not_found"}' + body: '{"message":"resource is not found","resource":"user","resource_id":"51683291-2d50-4f62-bdf6-353518fdfdc9","type":"not_found"}' headers: Content-Length: - "125" @@ -873,9 +873,9 @@ interactions: Content-Type: - application/json Date: - - Wed, 22 Jan 2025 15:32:50 GMT + - Wed, 14 May 2025 21:48:28 GMT Server: - - Scaleway API Gateway (fr-par-1;edge01) + - Scaleway API Gateway (fr-par-3;edge02) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -883,7 +883,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 982137ef-02f3-4b78-8b49-48733bc67a2f + - d1f122e0-e257-400e-af5d-16751d651fff status: 404 Not Found code: 404 - duration: 77.671958ms + duration: 51.10289ms diff --git a/internal/services/iam/testdata/user-member.cassette.yaml b/internal/services/iam/testdata/user-member.cassette.yaml new file mode 100644 index 0000000000..e41891fb88 --- /dev/null +++ b/internal/services/iam/testdata/user-member.cassette.yaml @@ -0,0 +1,644 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 281 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","tags":[],"member":{"email":"foo@scaleway.com","send_password_email":false,"send_welcome_email":false,"username":"foo","password":"Firstaccesspsw123","first_name":"Foo","last_name":"Bar","phone_number":"","locale":"en_US"}}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 487 + uncompressed: false + body: '{"account_root_user_id":"","created_at":"2025-05-19T14:50:35.443485Z","deletable":true,"email":"foo@scaleway.com","first_name":"Foo","id":"133b9fa7-49d7-4a1c-b971-7cc056e89743","last_login_at":null,"last_name":"Bar","locale":"en_US","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"activated","tags":[],"two_factor_enabled":false,"type":"member","updated_at":"2025-05-19T14:50:35.443485Z","username":"foo"}' + headers: + Content-Length: + - "487" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 19 May 2025 14:50:35 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 4dfeff58-f46a-4be5-ab75-6eb1045249c0 + status: 200 OK + code: 200 + duration: 873.799741ms + - 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.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/133b9fa7-49d7-4a1c-b971-7cc056e89743 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 487 + uncompressed: false + body: '{"account_root_user_id":"","created_at":"2025-05-19T14:50:35.443485Z","deletable":true,"email":"foo@scaleway.com","first_name":"Foo","id":"133b9fa7-49d7-4a1c-b971-7cc056e89743","last_login_at":null,"last_name":"Bar","locale":"en_US","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"activated","tags":[],"two_factor_enabled":false,"type":"member","updated_at":"2025-05-19T14:50:35.443485Z","username":"foo"}' + headers: + Content-Length: + - "487" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 19 May 2025 14:50:35 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 603d8de2-0481-4614-8f91-6d0f1b16b07c + status: 200 OK + code: 200 + duration: 74.546035ms + - 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.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/133b9fa7-49d7-4a1c-b971-7cc056e89743 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 487 + uncompressed: false + body: '{"account_root_user_id":"","created_at":"2025-05-19T14:50:35.443485Z","deletable":true,"email":"foo@scaleway.com","first_name":"Foo","id":"133b9fa7-49d7-4a1c-b971-7cc056e89743","last_login_at":null,"last_name":"Bar","locale":"en_US","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"activated","tags":[],"two_factor_enabled":false,"type":"member","updated_at":"2025-05-19T14:50:35.443485Z","username":"foo"}' + headers: + Content-Length: + - "487" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 19 May 2025 14:50:36 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - ea1f65ca-637d-4692-bf64-ffb034a84501 + status: 200 OK + code: 200 + duration: 100.753845ms + - 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.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/133b9fa7-49d7-4a1c-b971-7cc056e89743 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 487 + uncompressed: false + body: '{"account_root_user_id":"","created_at":"2025-05-19T14:50:35.443485Z","deletable":true,"email":"foo@scaleway.com","first_name":"Foo","id":"133b9fa7-49d7-4a1c-b971-7cc056e89743","last_login_at":null,"last_name":"Bar","locale":"en_US","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"activated","tags":[],"two_factor_enabled":false,"type":"member","updated_at":"2025-05-19T14:50:35.443485Z","username":"foo"}' + headers: + Content-Length: + - "487" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 19 May 2025 14:50:36 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 8cadb19a-da14-4654-bc5e-093c22edc173 + status: 200 OK + code: 200 + duration: 86.017615ms + - 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.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/133b9fa7-49d7-4a1c-b971-7cc056e89743 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 487 + uncompressed: false + body: '{"account_root_user_id":"","created_at":"2025-05-19T14:50:35.443485Z","deletable":true,"email":"foo@scaleway.com","first_name":"Foo","id":"133b9fa7-49d7-4a1c-b971-7cc056e89743","last_login_at":null,"last_name":"Bar","locale":"en_US","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"activated","tags":[],"two_factor_enabled":false,"type":"member","updated_at":"2025-05-19T14:50:35.443485Z","username":"foo"}' + headers: + Content-Length: + - "487" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 19 May 2025 14:50:37 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 39f6d09d-45c9-449f-bdde-e7f9bfd931fd + status: 200 OK + code: 200 + duration: 79.341184ms + - 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.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/133b9fa7-49d7-4a1c-b971-7cc056e89743 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 487 + uncompressed: false + body: '{"account_root_user_id":"","created_at":"2025-05-19T14:50:35.443485Z","deletable":true,"email":"foo@scaleway.com","first_name":"Foo","id":"133b9fa7-49d7-4a1c-b971-7cc056e89743","last_login_at":null,"last_name":"Bar","locale":"en_US","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"","status":"activated","tags":[],"two_factor_enabled":false,"type":"member","updated_at":"2025-05-19T14:50:35.443485Z","username":"foo"}' + headers: + Content-Length: + - "487" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 19 May 2025 14:50:37 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a98fb3a2-ee05-4ec7-ab72-fc74e488713f + status: 200 OK + code: 200 + duration: 103.50756ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 132 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"tags":["tf_tests"],"email":"foobar@scaleway.com","first_name":"","last_name":"Baz","phone_number":"+33112345678","locale":"fr_FR"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/133b9fa7-49d7-4a1c-b971-7cc056e89743 + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 509 + uncompressed: false + body: '{"account_root_user_id":"","created_at":"2025-05-19T14:50:35.443485Z","deletable":true,"email":"foobar@scaleway.com","first_name":"","id":"133b9fa7-49d7-4a1c-b971-7cc056e89743","last_login_at":null,"last_name":"Baz","locale":"fr_FR","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"+33112345678","status":"activated","tags":["tf_tests"],"two_factor_enabled":false,"type":"member","updated_at":"2025-05-19T14:50:35.443485Z","username":"foo"}' + headers: + Content-Length: + - "509" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 19 May 2025 14:50:37 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - ac8eed34-43c4-4a67-bdfb-721cb53f6566 + status: 200 OK + code: 200 + duration: 104.571569ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 21 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"username":"foobar"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/133b9fa7-49d7-4a1c-b971-7cc056e89743/update-username + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 512 + uncompressed: false + body: '{"account_root_user_id":"","created_at":"2025-05-19T14:50:35.443485Z","deletable":true,"email":"foobar@scaleway.com","first_name":"","id":"133b9fa7-49d7-4a1c-b971-7cc056e89743","last_login_at":null,"last_name":"Baz","locale":"fr_FR","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"+33112345678","status":"activated","tags":["tf_tests"],"two_factor_enabled":false,"type":"member","updated_at":"2025-05-19T14:50:37.912836Z","username":"foobar"}' + headers: + Content-Length: + - "512" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 19 May 2025 14:50:38 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c0c2fa5f-2d28-417f-b1e7-c5d28319fabb + status: 200 OK + code: 200 + duration: 104.392981ms + - id: 8 + 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.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/133b9fa7-49d7-4a1c-b971-7cc056e89743 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 512 + uncompressed: false + body: '{"account_root_user_id":"","created_at":"2025-05-19T14:50:35.443485Z","deletable":true,"email":"foobar@scaleway.com","first_name":"","id":"133b9fa7-49d7-4a1c-b971-7cc056e89743","last_login_at":null,"last_name":"Baz","locale":"fr_FR","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"+33112345678","status":"activated","tags":["tf_tests"],"two_factor_enabled":false,"type":"member","updated_at":"2025-05-19T14:50:38.014020Z","username":"foobar"}' + headers: + Content-Length: + - "512" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 19 May 2025 14:50:38 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 25e74fab-3a05-438f-930e-5fec146c6638 + status: 200 OK + code: 200 + duration: 116.062203ms + - 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.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/133b9fa7-49d7-4a1c-b971-7cc056e89743 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 512 + uncompressed: false + body: '{"account_root_user_id":"","created_at":"2025-05-19T14:50:35.443485Z","deletable":true,"email":"foobar@scaleway.com","first_name":"","id":"133b9fa7-49d7-4a1c-b971-7cc056e89743","last_login_at":null,"last_name":"Baz","locale":"fr_FR","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"+33112345678","status":"activated","tags":["tf_tests"],"two_factor_enabled":false,"type":"member","updated_at":"2025-05-19T14:50:38.014020Z","username":"foobar"}' + headers: + Content-Length: + - "512" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 19 May 2025 14:50:38 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a24947ee-0fc1-4428-a433-af6f1865a59f + status: 200 OK + code: 200 + duration: 75.617483ms + - 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.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/133b9fa7-49d7-4a1c-b971-7cc056e89743 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 512 + uncompressed: false + body: '{"account_root_user_id":"","created_at":"2025-05-19T14:50:35.443485Z","deletable":true,"email":"foobar@scaleway.com","first_name":"","id":"133b9fa7-49d7-4a1c-b971-7cc056e89743","last_login_at":null,"last_name":"Baz","locale":"fr_FR","locked":false,"mfa":false,"organization_id":"daf36079-e52c-416c-9535-d06742e48acc","phone_number":"+33112345678","status":"activated","tags":["tf_tests"],"two_factor_enabled":false,"type":"member","updated_at":"2025-05-19T14:50:38.014020Z","username":"foobar"}' + headers: + Content-Length: + - "512" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 19 May 2025 14:50:38 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 3579123a-7f2c-420e-b212-6a08754c787d + status: 200 OK + code: 200 + duration: 67.908277ms + - 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.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/133b9fa7-49d7-4a1c-b971-7cc056e89743 + 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: + - Mon, 19 May 2025 14:50:39 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 982ab4f2-8b2a-4e3c-83e4-c4047186994a + status: 204 No Content + code: 204 + duration: 118.221536ms + - 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.0; linux; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/iam/v1alpha1/users/133b9fa7-49d7-4a1c-b971-7cc056e89743 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 125 + uncompressed: false + body: '{"message":"resource is not found","resource":"user","resource_id":"133b9fa7-49d7-4a1c-b971-7cc056e89743","type":"not_found"}' + headers: + Content-Length: + - "125" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 19 May 2025 14:50:39 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7d9aa290-078e-4fda-8836-8a5212f60278 + status: 404 Not Found + code: 404 + duration: 94.560871ms diff --git a/internal/services/iam/user.go b/internal/services/iam/user.go index 28c1ba9f89..bbbe11068b 100644 --- a/internal/services/iam/user.go +++ b/internal/services/iam/user.go @@ -2,6 +2,7 @@ package iam import ( "context" + "errors" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -12,6 +13,8 @@ import ( "github.com/scaleway/terraform-provider-scaleway/v2/internal/types" ) +var descParameterIgnoredForGuest = " (this parameter is ignored in case of guest users)" + func ResourceUser() *schema.Resource { return &schema.Resource{ CreateContext: resourceIamUserCreate, @@ -23,20 +26,62 @@ func ResourceUser() *schema.Resource { }, SchemaVersion: 0, Schema: map[string]*schema.Schema{ + "organization_id": account.OrganizationIDOptionalSchema(), + // User input data "email": { Type: schema.TypeString, Required: true, - ForceNew: true, - Description: "The description of the iam user", + Description: "The email of the user, which is not editable for guests", }, "tags": { - Type: schema.TypeList, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, Optional: true, Description: "The tags associated with the user", }, + "send_password_email": { + Type: schema.TypeBool, + Optional: true, + Description: "Whether or not to send an email containing the member's password" + descParameterIgnoredForGuest, + }, + "send_welcome_email": { + Type: schema.TypeBool, + Optional: true, + Description: "Whether or not to send a welcome email that includes onboarding information" + descParameterIgnoredForGuest, + }, + "username": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The member's username" + descParameterIgnoredForGuest, + }, + "password": { + Type: schema.TypeString, + Optional: true, + Description: "The member's password for first access" + descParameterIgnoredForGuest, + }, + "first_name": { + Type: schema.TypeString, + Optional: true, + Description: "The member's first name" + descParameterIgnoredForGuest, + }, + "last_name": { + Type: schema.TypeString, + Optional: true, + Description: "The member's last name" + descParameterIgnoredForGuest, + }, + "phone_number": { + Type: schema.TypeString, + Optional: true, + Description: "The member's phone number" + descParameterIgnoredForGuest, + }, + "locale": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The member's locale" + descParameterIgnoredForGuest, + }, + // Computed data "created_at": { Type: schema.TypeString, Computed: true, @@ -65,7 +110,7 @@ func ResourceUser() *schema.Resource { "status": { Type: schema.TypeString, Computed: true, - Description: "The status of user invitation.", + Description: "The status of user invitation", }, "mfa": { Type: schema.TypeBool, @@ -75,22 +120,60 @@ func ResourceUser() *schema.Resource { "account_root_user_id": { Type: schema.TypeString, Computed: true, - Description: "The ID of the account root user associated with the iam user.", + Description: "The ID of the account root user associated with the iam user", + }, + "locked": { + Type: schema.TypeBool, + Computed: true, + Description: "Defines whether the user is locked", }, - "organization_id": account.OrganizationIDOptionalSchema(), }, } } +func createUserRequestBody(d *schema.ResourceData, isMember bool) *iam.CreateUserRequest { + if isMember { + // Create and return a member. + return &iam.CreateUserRequest{ + OrganizationID: d.Get("organization_id").(string), + Tags: types.ExpandStrings(d.Get("tags")), + Member: &iam.CreateUserRequestMember{ + Email: d.Get("email").(string), + SendPasswordEmail: d.Get("send_password_email").(bool), + SendWelcomeEmail: d.Get("send_welcome_email").(bool), + Username: d.Get("username").(string), + Password: d.Get("password").(string), + FirstName: d.Get("first_name").(string), + LastName: d.Get("last_name").(string), + PhoneNumber: d.Get("phone_number").(string), + Locale: d.Get("locale").(string), + }, + } + } else { + // Create and return a guest. + return &iam.CreateUserRequest{ + OrganizationID: d.Get("organization_id").(string), + Email: scw.StringPtr(d.Get("email").(string)), + Tags: types.ExpandStrings(d.Get("tags")), + } + } +} + func resourceIamUserCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { api := NewAPI(m) - email := d.Get("email").(string) - user, err := api.CreateUser(&iam.CreateUserRequest{ - OrganizationID: d.Get("organization_id").(string), - Email: &email, - Tags: types.ExpandStrings(d.Get("tags")), - }, scw.WithContext(ctx)) + var user *iam.User + + var err error + + if d.Get("username").(string) != "" { + // Create a member. + user, err = api.CreateUser(createUserRequestBody(d, true), scw.WithContext(ctx)) + } else { + // Create a guest. + user, err = api.CreateUser(createUserRequestBody(d, false), scw.WithContext(ctx)) + } + if err != nil { return diag.FromErr(err) } @@ -116,16 +199,25 @@ func resourceIamUserRead(ctx context.Context, d *schema.ResourceData, m interfac return diag.FromErr(err) } + _ = d.Set("organization_id", user.OrganizationID) + // User input data _ = d.Set("email", user.Email) + _ = d.Set("tags", types.FlattenSliceString(user.Tags)) + _ = d.Set("username", user.Username) + _ = d.Set("first_name", user.FirstName) + _ = d.Set("last_name", user.LastName) + _ = d.Set("phone_number", user.PhoneNumber) + _ = d.Set("locale", user.Locale) + // Computed data _ = d.Set("created_at", types.FlattenTime(user.CreatedAt)) _ = d.Set("updated_at", types.FlattenTime(user.UpdatedAt)) - _ = d.Set("organization_id", user.OrganizationID) _ = d.Set("deletable", user.Deletable) - _ = d.Set("tags", types.FlattenSliceString(user.Tags)) _ = d.Set("last_login_at", types.FlattenTime(user.LastLoginAt)) _ = d.Set("type", user.Type) _ = d.Set("status", user.Status) _ = d.Set("mfa", user.Mfa) + _ = d.Set("account_root_user_id", user.AccountRootUserID) + _ = d.Set("locked", user.Locked) return nil } @@ -140,14 +232,50 @@ func resourceIamUserUpdate(ctx context.Context, d *schema.ResourceData, m interf return diag.FromErr(err) } - if d.HasChanges("tags") { - _, err = api.UpdateUser(&iam.UpdateUserRequest{ - UserID: user.ID, - Tags: types.ExpandUpdatedStringsPtr(d.Get("tags")), - }, scw.WithContext(ctx)) + if user.Type == "guest" { + // Users of type "guest" only support the update of tags. The update of the email is not supported. + if d.HasChanges("tags") { + _, err = api.UpdateUser(&iam.UpdateUserRequest{ + UserID: user.ID, + Tags: types.ExpandUpdatedStringsPtr(d.Get("tags")), + }, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + } + + if d.HasChange("email") { + return diag.FromErr(errors.New("the email of a guest user cannot be updated, you need to create a new user")) + } + } else { + req := &iam.UpdateUserRequest{UserID: user.ID} + + if d.HasChanges("tags", "email", "first_name") { + req.Tags = types.ExpandUpdatedStringsPtr(d.Get("tags")) + req.Email = scw.StringPtr(d.Get("email").(string)) + req.FirstName = scw.StringPtr(d.Get("first_name").(string)) + } + + if d.HasChanges("last_name", "phone_number", "locale") { + req.LastName = scw.StringPtr(d.Get("last_name").(string)) + req.PhoneNumber = scw.StringPtr(d.Get("phone_number").(string)) + req.Locale = scw.StringPtr(d.Get("locale").(string)) + } + + _, err = api.UpdateUser(req, scw.WithContext(ctx)) if err != nil { return diag.FromErr(err) } + // The update of the 'username' field is made through a different endpoint and payload. + if d.HasChange("username") { + _, err = api.UpdateUserUsername(&iam.UpdateUserUsernameRequest{ + UserID: user.ID, + Username: d.Get("username").(string), + }, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + } } return resourceIamUserRead(ctx, d, m) diff --git a/internal/services/iam/user_test.go b/internal/services/iam/user_test.go index 27cad17962..8705acd3b4 100644 --- a/internal/services/iam/user_test.go +++ b/internal/services/iam/user_test.go @@ -12,7 +12,7 @@ import ( "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/iam" ) -func TestAccUser_Basic(t *testing.T) { +func TestAccUser_Guest(t *testing.T) { tt := acctest.NewTestTools(t) defer tt.Cleanup() resource.ParallelTest(t, resource.TestCase{ @@ -21,46 +21,118 @@ func TestAccUser_Basic(t *testing.T) { Steps: []resource.TestStep{ { Config: ` - resource "scaleway_iam_user" "user_basic" { - email = "foo@scaleway.com" - tags = ["tf_tests", "tests"] - } - `, + resource "scaleway_iam_user" "guest_user" { + email = "foo@scaleway.com" + tags = ["tf_tests", "tests"] + } + `, Check: resource.ComposeTestCheckFunc( - testAccCheckIamUserExists(tt, "scaleway_iam_user.user_basic"), - acctest.CheckResourceAttrUUID("scaleway_iam_user.user_basic", "id"), - resource.TestCheckResourceAttr("scaleway_iam_user.user_basic", "email", "foo@scaleway.com"), - resource.TestCheckResourceAttr("scaleway_iam_user.user_basic", "tags.#", "2"), - resource.TestCheckResourceAttr("scaleway_iam_user.user_basic", "tags.0", "tf_tests"), - resource.TestCheckResourceAttr("scaleway_iam_user.user_basic", "tags.1", "tests"), + testAccCheckIamUserExists(tt, "scaleway_iam_user.guest_user"), + acctest.CheckResourceAttrUUID("scaleway_iam_user.guest_user", "id"), + resource.TestCheckResourceAttr("scaleway_iam_user.guest_user", "email", "foo@scaleway.com"), + resource.TestCheckResourceAttr("scaleway_iam_user.guest_user", "tags.#", "2"), + resource.TestCheckResourceAttr("scaleway_iam_user.guest_user", "tags.0", "tf_tests"), + resource.TestCheckResourceAttr("scaleway_iam_user.guest_user", "tags.1", "tests"), + // The username is the same as the email for guests. + resource.TestCheckResourceAttr("scaleway_iam_user.guest_user", "username", "foo@scaleway.com"), + resource.TestCheckResourceAttr("scaleway_iam_user.guest_user", "type", "guest"), ), }, + // Update tags. { Config: ` - resource "scaleway_iam_user" "user_basic" { - email = "foo@scaleway.com" - tags = ["tf_tests"] - } - `, + resource "scaleway_iam_user" "guest_user" { + email = "foo@scaleway.com" + tags = ["tf_tests"] + } + `, Check: resource.ComposeTestCheckFunc( - testAccCheckIamUserExists(tt, "scaleway_iam_user.user_basic"), - acctest.CheckResourceAttrUUID("scaleway_iam_user.user_basic", "id"), - resource.TestCheckResourceAttr("scaleway_iam_user.user_basic", "email", "foo@scaleway.com"), - resource.TestCheckResourceAttr("scaleway_iam_user.user_basic", "tags.#", "1"), - resource.TestCheckResourceAttr("scaleway_iam_user.user_basic", "tags.0", "tf_tests"), + testAccCheckIamUserExists(tt, "scaleway_iam_user.guest_user"), + acctest.CheckResourceAttrUUID("scaleway_iam_user.guest_user", "id"), + resource.TestCheckResourceAttr("scaleway_iam_user.guest_user", "email", "foo@scaleway.com"), + resource.TestCheckResourceAttr("scaleway_iam_user.guest_user", "tags.#", "1"), + resource.TestCheckResourceAttr("scaleway_iam_user.guest_user", "tags.0", "tf_tests"), + resource.TestCheckResourceAttr("scaleway_iam_user.guest_user", "type", "guest"), ), }, + // Remove tags. { Config: ` - resource "scaleway_iam_user" "user_basic" { - email = "foo@scaleway.com" - } - `, + resource "scaleway_iam_user" "guest_user" { + email = "foo@scaleway.com" + } + `, Check: resource.ComposeTestCheckFunc( - testAccCheckIamUserExists(tt, "scaleway_iam_user.user_basic"), - acctest.CheckResourceAttrUUID("scaleway_iam_user.user_basic", "id"), - resource.TestCheckResourceAttr("scaleway_iam_user.user_basic", "email", "foo@scaleway.com"), - resource.TestCheckResourceAttr("scaleway_iam_user.user_basic", "tags.#", "0"), + testAccCheckIamUserExists(tt, "scaleway_iam_user.guest_user"), + acctest.CheckResourceAttrUUID("scaleway_iam_user.guest_user", "id"), + resource.TestCheckResourceAttr("scaleway_iam_user.guest_user", "email", "foo@scaleway.com"), + resource.TestCheckResourceAttr("scaleway_iam_user.guest_user", "tags.#", "0"), + resource.TestCheckResourceAttr("scaleway_iam_user.guest_user", "type", "guest"), + ), + }, + }, + }) +} + +func TestAccUser_Member(t *testing.T) { + tt := acctest.NewTestTools(t) + defer tt.Cleanup() + resource.ParallelTest(t, resource.TestCase{ + ProviderFactories: tt.ProviderFactories, + CheckDestroy: isUserDestroyed(tt), + Steps: []resource.TestStep{ + { + Config: ` + resource "scaleway_iam_user" "member_user" { + email = "foo@scaleway.com" + username = "foo" + first_name = "Foo" + last_name = "Bar" + password = "Firstaccesspsw123" + locale = "en_US" + } + `, + Check: resource.ComposeTestCheckFunc( + testAccCheckIamUserExists(tt, "scaleway_iam_user.member_user"), + acctest.CheckResourceAttrUUID("scaleway_iam_user.member_user", "id"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "email", "foo@scaleway.com"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "username", "foo"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "first_name", "Foo"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "last_name", "Bar"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "password", "Firstaccesspsw123"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "phone_number", ""), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "locale", "en_US"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "tags.#", "0"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "type", "member"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "mfa", "false"), + ), + }, + // Add tag and update email, username, last name, phone number and locale. + { + Config: ` + resource "scaleway_iam_user" "member_user" { + email = "foobar@scaleway.com" + username = "foobar" + last_name = "Baz" + phone_number = "+33112345678" + locale = "fr_FR" + tags = ["tf_tests"] + } + `, + Check: resource.ComposeTestCheckFunc( + testAccCheckIamUserExists(tt, "scaleway_iam_user.member_user"), + acctest.CheckResourceAttrUUID("scaleway_iam_user.member_user", "id"), + // Let's check that a field is set to empty when not defined in the configuration. + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "first_name", ""), + // Let's update some fields and test if they actually get updated. + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "email", "foobar@scaleway.com"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "username", "foobar"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "last_name", "Baz"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "phone_number", "+33112345678"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "locale", "fr_FR"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "tags.#", "1"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "tags.0", "tf_tests"), + resource.TestCheckResourceAttr("scaleway_iam_user.member_user", "type", "member"), ), }, },