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

Error provisioning snowflake_dynamic_table #2331

Closed
ramprasads108 opened this issue Jan 9, 2024 · 4 comments
Closed

Error provisioning snowflake_dynamic_table #2331

ramprasads108 opened this issue Jan 9, 2024 · 4 comments
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@ramprasads108
Copy link

ramprasads108 commented Jan 9, 2024

Terraform CLI and Provider Versions

Terraform v1.3.6
Snowflake-Labs Terraform provider 0.82.0

Terraform Configuration

terraform {
  required_version = ">= 1.3.6"
  required_providers {
    snowflake = {
      source  = "snowflake-labs/snowflake"
      version = "=0.82.0"
    }
  }
}

provider "snowflake" {
  user    = "sampleusername"
  authenticator   = "ExternalBrowser"
  account = "sampleacc"
  role    = "ACCOUNTADMIN"
}



resource "snowflake_dynamic_table" "example" {
  database   = "sample_Database"
  schema     = "DEMO_TEST"
  name       = "sample_DYNAMIC_TABLE"

  target_lag {
    maximum_duration = "20 minutes"
  }
  warehouse = "COMPUTE_WH"
  query     = "SELECT * from DEMO_TABLE"
  comment   = "example dynamic table"
}

Expected Behavior

create a dynamic table in our snowflake account

Actual Behavior

terraform apply -auto-approve

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:

  • create

Terraform will perform the following actions:

snowflake_dynamic_table.example will be created

  • resource "snowflake_dynamic_table" "example" {
    • automatic_clustering = (known after apply)

    • bytes = (known after apply)

    • cluster_by = (known after apply)

    • comment = "example dynamic table"

    • data_timestamp = (known after apply)

    • database = "sample_Database"

    • id = (known after apply)

    • is_clone = (known after apply)

    • is_replica = (known after apply)

    • last_suspended_on = (known after apply)

    • name = "sample_DYNAMIC_TABLE"

    • or_replace = false

    • owner = (known after apply)

    • query = "SELECT * from DEMO_TABLE"

    • refresh_mode = (known after apply)

    • refresh_mode_reason = (known after apply)

    • rows = (known after apply)

    • scheduling_state = (known after apply)

    • schema = "DEMO_TEST"

    • warehouse = "COMPUTE_WH"

    • target_lag {

      • maximum_duration = "20 minutes"
        }
        }

Plan: 1 to add, 0 to change, 0 to destroy.
snowflake_dynamic_table.example: Creating...

│ Error: [errors.go:17] object does not exist or not authorized

│ with snowflake_dynamic_table.example,
│ on main.tf line 21, in resource "snowflake_dynamic_table" "example":
│ 21: resource "snowflake_dynamic_table" "example" {

Steps to Reproduce

  1. terraform apply

How much impact is this issue causing?

High

Logs

No response

Additional Information

No response

@ramprasads108 ramprasads108 added the bug Used to mark issues with provider's incorrect behavior label Jan 9, 2024
@sfc-gh-asawicki
Copy link
Collaborator

Hey @ramprasads108. Thanks for reporting the issue.

Can you try specifying the fully qualified name for the table in the query?

If it does not help, please provide the full debug log with the error.

@sfc-gh-asawicki
Copy link
Collaborator

Hey @ramprasads108.

The fully qualified name for tables consists of three parts: database, schema, and table. Please try again, to confirm that it does not help.

Additionally, do you have all the required grants to perform the CREATE (https://docs.snowflake.com/en/sql-reference/sql/create-dynamic-table#access-control-requirements)?

@ramprasads108
Copy link
Author

fully qualified works. thanks

1 similar comment
@ramprasads108
Copy link
Author

fully qualified works. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to mark issues with provider's incorrect behavior
Projects
None yet
Development

No branches or pull requests

2 participants