gridscale / terraform-provider-gridscale

Terraform gridscale provider
https://registry.terraform.io/providers/gridscale/gridscale/latest/docs
Mozilla Public License 2.0
12 stars 11 forks source link

cannot create new or access existing object storage access keys anymore #245

Open mbunkus opened 11 months ago

mbunkus commented 11 months ago

Terraform Version

Terraform v1.5.7
on linux_amd64
+ provider registry.terraform.io/gridscale/gridscale v1.22.0

Affected Resource(s)

terraform {
  required_providers {
    gridscale = {
      source = "gridscale/gridscale"
      version = ">= 1.22.0"
    }
  }
}

resource "gridscale_object_storage_accesskey" "mbu-test" {
   comment = "mbu-test"
   timeouts {
      create="10m"
  }
}

Debug Output

https://gist.github.com/mbunkus/766ff857876c3fa78bc46c01bc708ed3

Expected Behavior

Trying to create a new storage access key should work, especially when I'm just copy-pasting from the docs.

Additionally accessing existing via data "gridscale_object_storage_accesskey" should work.

Last but not least I should be able to specify if I want to create a user-specific key or an account key.

Actual Behavior

I'm trying to create a new storage access key. This fails with an error that I'm not authorized to do that. I can create other resources just fine.

Additionally I'm trying to access existing access keys via 'data "gridscale_object_storage_accesskey"', and that fails the same way: with an error that I'm not authorized to access this piece of data.

I cannot select which type of key I want to create.

Steps to Reproduce

  1. terraform apply

Important Factoids

This used to work, but doesn't anymore. It seems there were incompatible changes to the API that weren't reflected in the Terraform provider.

nvthongswansea commented 7 months ago

@mbunkus I've tested your config and I've found out that it is because of the api key permissions. Please let me check this permission issue before giving you a concrete answer.

nvthongswansea commented 7 months ago

@mbunkus currently we only allow to manage the object storage access key via an unrestricted API key. You could make a new unrestricted API key via gridscale panel or you could update your current one to be unrestricted.