Context:
I am trying to define dbt cloud resources:
- project
- database (snowflake) connection
- environment
- project repo (connected to github)
- credentials (snowflake)
- job
terraform apply threw an error when I provide the password
parameter to dbt_cloud_snowflake_credential
, and ran fine without it.
Code:
resource "dbt_cloud_project" "dbt_cloud_project" {
name = "test-project"
dbt_project_subdirectory = "dbt"
}
resource "dbt_cloud_connection" "dbt_cloud_connection" {
name = "snowflake-sandbox-connection"
account = "${var.snowflake_account_id}.${var.snowflake_region}"
database = snowflake_database.database.name
project_id = dbt_cloud_project.dbt_cloud_project.id
role = snowflake_role.data_scientist.name
type = "snowflake"
warehouse = local.workspace.warehouse_size
}
resource "dbt_cloud_project_connection" "dbt_cloud_project_connection" {
connection_id = dbt_cloud_connection.dbt_cloud_connection.connection_id
project_id = dbt_cloud_project.dbt_cloud_project.id
}
resource "dbt_cloud_environment" "dev_environment" {
dbt_version = "1.0.0"
name = "Development"
project_id = dbt_cloud_project.dbt_cloud_project.id
type = "development"
}
resource "dbt_cloud_repository" "github_repo" {
project_id = dbt_cloud_project.dbt_cloud_project.id
remote_url = "[email protected]:xxx/xxx.git"
}
resource "dbt_cloud_project_repository" "github_repo" {
project_id = dbt_cloud_project.dbt_cloud_project.id
repository_id = dbt_cloud_repository.github_repo.repository_id
}
resource "dbt_cloud_snowflake_credential" "snowflake_credential" {
auth_type = "password"
num_threads = 4
project_id = dbt_cloud_project.dbt_cloud_project.id
schema = snowflake_schema.schema.name
user = var.snowflake_username
password = var.snowflake_password
}
resource "dbt_cloud_job" "test_job" {
environment_id = dbt_cloud_environment.dev_environment.environment_id
execute_steps = ["dbt compile"]
name = "test_job"
project_id = dbt_cloud_project.dbt_cloud_project.id
triggers = {schedule: true}
schedule_days = [1]
schedule_hours = [0]
}
Terraform plan:
# dbt_cloud_snowflake_credential.snowflake_credential will be updated in-place
~ resource "dbt_cloud_snowflake_credential" "snowflake_credential" {
id = "146395:154576"
+ password = (sensitive value)
# (7 unchanged attributes hidden)
}
Error log:
dbt_cloud_snowflake_credential.snowflake_credential: Modifying... [id=146395:154576]
dbt_cloud_job.test_job: Modifying... [id=117792]
╷
│ Error: Plugin did not respond
│
│ with dbt_cloud_snowflake_credential.snowflake_credential,
│ on dbt-cloud.tf line 38, in resource "dbt_cloud_snowflake_credential" "snowflake_credential":
│ 38: resource "dbt_cloud_snowflake_credential" "snowflake_credential" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more
│ details.
╵
╷
│ Error: Plugin did not respond
│
│ with dbt_cloud_job.test_job,
│ on dbt-cloud.tf line 47, in resource "dbt_cloud_job" "test_job":
│ 47: resource "dbt_cloud_job" "test_job" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more
│ details.
╵
Stack trace from the terraform-provider-dbt-cloud_v0.1.0 plugin:
panic: interface conversion: interface {} is nil, not bool
goroutine 39 [running]:
github.com/gthesheep/terraform-provider-dbt-cloud/pkg/resources.resourceJobUpdate({0x18b3b08, 0xc0005431a0}, 0xc00040ce00, {0x179c200, 0xc00042a900})
github.com/gthesheep/terraform-provider-dbt-cloud/pkg/resources/job.go:326 +0x1045
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xc000186fc0, {0x18b3b40, 0xc000606a80}, 0xd, {0x179c200, 0xc00042a900})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:376 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000186fc0, {0x18b3b40, 0xc000606a80}, 0xc000544f70, 0xc00040cc80, {0x179c200, 0xc00042a900})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:482 +0x785
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0003923f0, {0x18b3a98, 0xc000308000}, 0xc00043a370)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xdaa
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc000240640, {0x18b3b40, 0xc000606390}, 0xc0003da150)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:812 +0x56b
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x1787be0, 0xc000240640}, {0x18b3b40, 0xc000606390}, 0xc000542180, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002aa8c0, {0x18c0818, 0xc0004024e0}, 0xc00060c480, 0xc0003a2150, 0x1d7ba60, 0x0)
google.golang.org/[email protected]/server.go:1282 +0xccf
google.golang.org/grpc.(*Server).handleStream(0xc0002aa8c0, {0x18c0818, 0xc0004024e0}, 0xc00060c480, 0x0)
google.golang.org/[email protected]/server.go:1619 +0xa2a
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:921 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:919 +0x294
Error: The terraform-provider-dbt-cloud_v0.1.0 plugin crashed!
This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.
stale