Closed anconrad closed 10 months ago
for workaround we can introuduce a scaleway_account_project data and pass the id as arg
data "scaleway_account_project" "this" {}
project_id = data.scaleway_account_project.this.project_id
Same issue here.
The query is blocked by IAM.
2023-11-06T11:48:38.021+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: ---------------------------------------------------------
2023-11-06T11:48:38.021+0100 [INFO] provider.terraform-provider-scaleway_v2.32.0: 2023/11/06 11:48:38 [DEBUG] [DEBUG] POST https://api.scaleway.com/k8s/v1/regions/fr-par/clusters: timestamp=2023-11-06T11:48:38.021+0100
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: DEBUG: 2023/11/06 11:48:38
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: --------------- Scaleway SDK RESPONSE 1 : ---------------
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: HTTP/2.0 403 Forbidden
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: Content-Length: 79
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: Content-Security-Policy: default-src 'none'; frame-ancestors 'none'
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: Content-Type: application/json
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: Date: Mon, 06 Nov 2023 10:48:38 GMT
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: Server: Scaleway API-Gateway
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: Strict-Transport-Security: max-age=63072000
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: X-Content-Type-Options: nosniff
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: X-Frame-Options: DENY
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: X-Request-Id: a029ddbb-fb25-47b5-b563-ff5a7c4d222d
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0:
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: {"details":[],"message":"insufficient permissions","type":"permissions_denied"}
2023-11-06T11:48:38.137+0100 [DEBUG] provider.terraform-provider-scaleway_v2.32.0: ----------------------------------------------------------
2023-11-06T11:48:38.137+0100 [ERROR] provider.terraform-provider-scaleway_v2.32.0: Response contains error diagnostic: diagnostic_severity=ERROR tf_resource_type=scaleway_k8s_cluster tf_rpc=ApplyResourceChange @module=sdk.proto diagnostic_detail= diagnostic_summary="scaleway-sdk-go: insufficient permissions: " tf_proto_version=5.4 @caller=github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov5/internal/diag/diagnostics.go:58 tf_provider_addr=provider tf_req_id=aac13b6f-87bb-f7b1-4710-00585e2c318b timestamp=2023-11-06T11:48:38.137+0100
2023-11-06T11:48:38.148+0100 [ERROR] vertex "scaleway_k8s_cluster.depl_k8s_cluster" error: scaleway-sdk-go: insufficient permissions:
╷
│ Error: scaleway-sdk-go: insufficient permissions:
│
│ with scaleway_k8s_cluster.depl_k8s_cluster,
│ on k8s.tf line 3, in resource "scaleway_k8s_cluster" "depl_k8s_cluster":
│ 3: resource "scaleway_k8s_cluster" "depl_k8s_cluster" {
│
╵
2023-11-06T11:48:38.155+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-11-06T11:48:38.158+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/scaleway/scaleway/2.32.0/linux_amd64/terraform-provider-scaleway_v2.32.0 pid=463498
2023-11-06T11:48:38.158+0100 [DEBUG] provider: plugin exited
I just set project_id in scaleway_k8s_cluster
:
resource "scaleway_k8s_cluster" "depl_k8s_cluster" {
# [...]
project_id = "xxxxx" # regression introduced in v2.32.0 of SCW provider
}
.. and it works!
scaleway_lb
have the same issue.
Same workaround.
scaleway_rdb_instance
have the same issue => same workaround.
Hello @anconrad,
The version 2.32.0 of the provider contains code that will not work anymore because it was designed for the kapsule API as it was back then as it was transitioning private networks from optional to required.
Are you also experiencing the issue with later versions ? I was able to reproduce the issue on 2.32.0, but not with further versions.
I'm closing the issue since I have got no response, but feel free to reopen it if you are experiencing further issues.
Versions & Resources
Terraform v1.6.3 scaleway/scaleway 2.32.0 scaleway_k8s_cluster scaleway_vpc_private_network
Terraform Configuration Files
provider.tf
main.tf
Expected Behavior
Creation of a cluster.
It seems the project id is respected my the scaleway_vpc_private_network but not by scaleway_k8s_cluster. This leads to the cluster not finding the vpc pn.
Actual Behavior
Error: scaleway-sdk-go: invalid argument(s): private_network_id does not respect constraint, Private Network could not be found │ │ with scaleway_k8s_cluster.my-cluster, │ on main.tf line 20, in resource "scaleway_k8s_cluster" "my-cluster": │ 20: resource "scaleway_k8s_cluster" "my-cluster" {
Steps to Reproduce
terraform apply
References
see also #2187