databricks / terraform-provider-databricks

Databricks Terraform Provider
https://registry.terraform.io/providers/databricks/databricks/latest
Other
454 stars 392 forks source link

[ISSUE] Provider issue: Can't import workspace #967

Closed anthonybench closed 2 years ago

anthonybench commented 2 years ago

Unless I'm mistaken, I can't seem to import a workspace. Passing values via Terragrunt. There isn't an Import section in the doc for this resource, so I'm unsure how to proceed. This is an AWS E2 workspace.

Configuration

resource "databricks_mws_workspaces" "da_workspace" {
  provider        = databricks.account
  account_id      = var.databricks_account_id
  workspace_name  = var.workspace_name
  deployment_name = var.workspace_name
  aws_region      = var.region

  credentials_id            = databricks_mws_credentials.this.credentials_id
  storage_configuration_id  = databricks_mws_storage_configurations.this.storage_configuration_id
  network_id                = databricks_mws_networks.this.network_id
}

Expected Behavior

"Import successful!"

Actual Behavior

databricks_mws_workspaces.da_workspace: Importing from ID "<elided>"...
╷
│ Error: nil entry in ImportState results. This is always a bug with
│ the resource that is being imported. Please report this as
│ a bug to Terraform.
│ 
│ 
╵

ERRO[0008] 1 error occurred:
        * exit status 1

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terragrunt import 'databricks_mws_workspace.da_workspace' <WORKSPACE_ID>

Terraform and provider versions

Terraform version: 1.0.7 Terragrunt version: 0.31.0 Provider version: 0.3.11

nfx commented 2 years ago

You can import by using separated by "/" account_id and workspace_id

anthonybench commented 2 years ago

Thank you!

anthonybench commented 2 years ago

Is this true for any (or all) of:

?

nfx commented 2 years ago

@anthonybench for all databricksmws* and some other resources https://github.com/databrickslabs/terraform-provider-databricks/search?q=common.NewPairSeparatedID

anthonybench commented 2 years ago

@nfx I saw you guys dropped 0.5.0 a few days ago, though the databricks_mws_workspaces doc still has the "evolving api" notice. Is there still some major overhaul taking place, or is it pretty good to go now?

nfx commented 2 years ago

@anthonybench soon the databricks_mws_* will be split into it's own dedicated databricksaccount provider. databricks_mws_* will be there in databricks provider, but no longer maintained, giving enough time for people to migrate to a proper double-provider setup.

anthonybench commented 2 years ago

@nfx Awesome, thank you!

otosky commented 2 years ago

@nfx is there any update on the timeline of the databricksaccount provider? just curious as to whether it's a this-year thing or further out.

nfx commented 2 years ago

@otosky no timeline on databricksaccount provider. but at least it's on a roadmap =)