s1ntaxe770r / tf-planetscale-db

database provisioned using terraform provider for planetscale
0 stars 0 forks source link

Provider fails when attempting to create a database #1

Open gaahrdner opened 2 years ago

gaahrdner commented 2 years ago

My guess is their API changed, here's some TF_LOG output:

2022-01-08T21:47:33.412-0600 [DEBUG] planetscale_database.house-db-mysql: applying the planned Create change
2022-01-08T21:47:33.412-0600 [INFO]  provider.terraform-provider-planetscale_v0.1.1: 2022/01/08 21:47:33 [DEBUG] setting computed for "database" from ComputedKeys: timestamp=2022-01-08T21:47:33.412-0600
2022-01-08T21:47:33.966-0600 [ERROR] vertex "planetscale_database.house-db-mysql" error: unable to create database internal error, response body doesn't match error type signature
╷
│ Error: unable to create database internal error, response body doesn't match error type signature
│ 
│   with planetscale_database.house-db-mysql,
│   on databases.tf line 1, in resource "planetscale_database" "house-db-mysql":
│    1: resource "planetscale_database" "house-db-mysql" {
│ 
╵
2022-01-08T21:47:34.220-0600 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2022-01-08T21:47:34.223-0600 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/s1ntaxe770r/planetscale/0.1.1/darwin_amd64/terraform-provider-planetscale_v0.1.1 pid=79955
2022-01-08T21:47:34.223-0600 [DEBUG] provider: plugin exited
s1ntaxe770r commented 2 years ago

Hey, @gaahrdner thanks for bringing this up. I'll look into this, My guess is the same as yours

s1ntaxe770r commented 2 years ago

found the change in the API, working on a fix

s1ntaxe770r commented 2 years ago

Hey, @gaahrdner I've released a new version of the provider, this should take care of the problem. https://registry.terraform.io/providers/s1ntaxe770r/planetscale/latest

gaahrdner commented 2 years ago

Hey @s1ntaxe770r, thanks for the turn around, unfortunately 0.1.2 gives me the same error as 0.1.1. If I get some time I'll see if I can't dig in a bit to help out.

s1ntaxe770r commented 2 years ago

well, that's odd. Seems to work for me

image

here's the terraform file i used

terraform {
  required_providers {
    planetscale = {
      source = "s1ntaxe770r/planetscale"
      version = "0.1.2"
    }
  }
}

provider "planetscale" {
   access_token = var.access_token
}

resource "planetscale_database" "db" { 
    organization = var.organization
    name = var.db_name
}

output "database" {
  value = planetscale_database.db.database
}