terraform-provider-snowflake
terraform-provider-snowflake copied to clipboard
unable to import snowflake_stage resource
We are trying to import some existing snowflake_stage resources that were setup manually in snowflake.
terraform code:
resource "snowflake_stage" "test_stage" {
name = "TEST_STAGE"
database = "TEST_DB"
schema = "PUBLIC"
file_format = "TYPE = JSON"
url = "s3://kafka-s3-bucket/topics/test/"
credentials = "AWS_KEY_ID = 'abcd' AWS_SECRET_KEY = '1234'"
}
when we run the import we get an error:
$ terraform import snowflake_stage.test_stage TEST_STAGE
snowflake_stage.test_stage: Importing from ID "TEST_STAGE"...
snowflake_stage.test_stage: Import prepared!
Prepared snowflake_stage for import
snowflake_stage.test_stage: Refreshing state... [id=TEST_STAGE]
Error: 3 fields allowed
Are imports supported for this resource?
this looks to be a similar issue as in https://github.com/chanzuckerberg/terraform-provider-snowflake/issues/113 I was able to import a snowflake_stage by specifying the full ID/path of the resource:
terraform import snowflake_stage.test_stage "<database_name>|<schema_name>|<stage_name>"
the import syntax should be documented in a way similar to how hashi does it in the official terraform docs. I took a stab at this in PR: https://github.com/chanzuckerberg/terraform-provider-snowflake/pull/223
Hello @jnicholsthru . Thanks to your post, I was able to import successfully my stages, thanks.
Did you have any problems creating new ones? I can't do it and I am wondering whether it is a bug or I am doing something wrong
@JavierLopezT what problems are you having?
We are closing this issue as part of a cleanup described in announcement. If you believe that the issue is still valid in v0.89.0, please open a new ticket.