terraform-provider-snowflake icon indicating copy to clipboard operation
terraform-provider-snowflake copied to clipboard

[Bug]: Panic during import of stage

Open papanikge opened this issue 1 year ago • 1 comments

Terraform CLI Version

v1.5.7

Terraform Provider Version

v0.92.0

Terraform Configuration

terraform {
  required_providers {
    snowflake = {
      source  = "Snowflake-Labs/snowflake"
      version = "~> 0.61"
    }
  }
}

provider "snowflake" {
  account  = "blah1"
  user     = "blah2"
  password = "blahsecret"
  role     = "ACCOUNTADMIN"
}

Category

category:sdk

Object type(s)

No response

Expected Behavior

Should have reported an error

Actual Behavior

Paniced

Steps to Reproduce

  • create a stage in snowflake in one database
  • create a resource like this:
resource "snowflake_stage" "stage1" {
  name                = "stage1"
  database            = snowflake_database.db.name
  schema              = snowflake_schema.schema1.name
  storage_integration = snowflake_storage_integration.s3_my.name
  url                 = "s3://<blah>"
  file_format         = "JSON"
}
  • do `terraform import snowflake_stage.stage1 stage1

How much impact is this issue causing?

Low

Logs

https://gist.github.com/papanikge/8c16be53e329fb96c4b6965fc55323e0

Additional Information

No response

Would you like to implement a fix?

  • [ ] Yeah, I'll take it 😎

papanikge avatar Jul 03 '24 11:07 papanikge

Hi @papanikge. I think that the resource ID is incorrect. Please follow https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/stage#import, and use 'dbName|schemaName|stageName' for importing stages.

sfc-gh-jmichalak avatar Jul 03 '24 11:07 sfc-gh-jmichalak

Closing due to inactivity. Solution was provided.

sfc-gh-asawicki avatar Sep 05 '24 11:09 sfc-gh-asawicki