Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stage creation fails when storage integration has special characters #1080

Closed
adamantike opened this issue Jun 28, 2022 · 0 comments · Fixed by #1081, #1096 or #1332
Closed

Stage creation fails when storage integration has special characters #1080

adamantike opened this issue Jun 28, 2022 · 0 comments · Fixed by #1081, #1096 or #1332
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@adamantike
Copy link
Contributor

Provider Version
snowflake-labs/snowflake v0.36.0

Terraform Version
Terraform 1.2.3

Describe the bug
When trying to create a Stage that has a storage integration with special characters in its name (e.g. dashes), apply fails.

Expected behavior
Stage creation/alter should work for any allowed characters in Snowflake for storage integration names.

Code samples and commands
Example code:

resource "snowflake_stage" "this" {
  name                = "test"
  schema              = "SCHEMA"
  database            = "DB"
  url                 = "s3://bucket/path"
  storage_integration = "my-integration"
}

terraform plan output:

  # snowflake_stage.this will be created
  + resource "snowflake_stage" "this" {
      + aws_external_id     = (known after apply)
      + database            = "DB"
      + id                  = (known after apply)
      + name                = "test"
      + schema              = "SCHEMA"
      + snowflake_iam_user  = (known after apply)
      + storage_integration = "my-integration"
      + url                 = "s3://bucket/path"
    }

terraform apply error:

snowflake_stage.this: Creating...
╷
│ Error: error creating stage test: 001003 (42000): SQL compilation error:
│ syntax error line 1 at position 85 unexpected '-'.
│ syntax error line 1 at position 85 unexpected '-'.
│ syntax error line 1 at position 97 unexpected '<EOF>'.
│
│   with snowflake_stage.this,
│   on main_stages.tf line 1, in resource "snowflake_stage" "this":
│    1: resource "snowflake_stage" "this" {
│
╵
Operation failed: failed running terraform apply (exit 1

Generated SQL:

CREATE STAGE "DB"."SCHEMA"."test" URL = 's3://bucket/path' STORAGE_INTEGRATION = my-integration;
@adamantike adamantike added the bug Used to mark issues with provider's incorrect behavior label Jun 28, 2022
adamantike added a commit to adamantike/terraform-provider-snowflake that referenced this issue Jun 28, 2022
…al characters

To support storage integration names including special characters, this
change adds quotes to the names, to avoid generating invalid SQL (e.g.
when names have dashes).

Fixes Snowflake-Labs#1080
sfc-gh-swinkler pushed a commit that referenced this issue Jul 1, 2022
…al characters (#1081)

To support storage integration names including special characters, this
change adds quotes to the names, to avoid generating invalid SQL (e.g.
when names have dashes).

Fixes #1080

Co-authored-by: Jason Lin <jason.lin@snowflake.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment