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

Support multiple projects #19

Closed bkircher closed 4 years ago

bkircher commented 5 years ago

The cloud provider does not support multiple projects.

To reproduce, create two projects, e.g. A and B and make B the default. Then create a new gridscale_sshkey resource. SSH key will be created in project A (despite B being the default). There's no schema for projects in the provider plugin yet.

Terraform Version

Terraform v0.12.10 Provider plugin git hash 7a2c4dd

Affected Resource(s)

I guess all.

Terraform Configuration Files

provider "gridscale" {
  uuid    = "…"
  token   = "…"
  api_url = "https://api.gridscale.io"
}

resource "gridscale_sshkey" "sshkey-john" {
  name   = "John Doe <johndoe@example.com>"
  sshkey = "ssh-rsa AAAAB3iLSh7LgcQmUAAcmrPckGKiFJ9ZIb+c9RQ== johndoe@example.com"
}

Expected Behavior

There should be syntax to specify the project a resource refers to. Also nice would be that, when no project is given, the current selected "default" project is respected.

Actual Behavior

Resources seemingly just get added to the very first project in gs.

References

fkr commented 4 years ago

The project is currently chosen by the api token you're using. API tokens are project-specific. Likely this needs to be properly documented.

nvthongswansea commented 4 years ago

The project is currently chosen by the api token you're using. API tokens are project-specific. Likely this needs to be properly documented.

This feature will be included in a future release (soon). I'll try to make it backward compatible.

nvthongswansea commented 4 years ago

https://github.com/gridscale/terraform-examples/tree/master/multi-project

bkircher commented 4 years ago

Thanks guys