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

[Bug]: snowflake_tables_datasource not recognized as preview feature #3302

Open
1 task
nmcintyre opened this issue Dec 17, 2024 · 3 comments
Open
1 task
Assignees
Labels
bug Used to mark issues with provider's incorrect behavior category:migration Issues connected with migration to v1.0.0.

Comments

@nmcintyre
Copy link

Terraform CLI Version

1.5.7

Terraform Provider Version

1.0.0

Company Name

No response

Terraform Configuration

terraform {
  required_version = ">= 1.0.0, < 2.0.0"

  required_providers {
    snowflake = {
      source  = "snowflake-labs/snowflake"
      version = "~> 1.0.0"
    }
  }

  backend "local" {
    path = "terraform.tfstate"
  }
}

provider "snowflake" {
  preview_features_enabled = ["snowflake_tables_datasource"]
}

data "snowflake_tables" "this" {
  database = "SOME_DATABASE_NAME"
  schema   = "SOME_SCHEMA_NAME"
}

Category

category:data_source

Object type(s)

data_source:tables

Expected Behavior

By not including snowflake_tables in the preview_features_enabled provider configuration, the following error is given:

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: invalid feature: snowflake_tables_datasource
│
│   with data.snowflake_tables.this,
│   on main.tf line 20, in data "snowflake_tables" "this":
│   20: data "snowflake_tables" "this" {
│
╵

Adding "snowflake_tables_datasource" to the preview_features_enabled set should allow use of snowflake_tables datasource.

Actual Behavior

terraform plan produces the following:

│ Error: expected [{{} preview_features_enabled} {{} {{{{} 78}} 0x140010c9b90}}] to be one of ["snowflake_current_account_datasource" "snowflake_account_authentication_policy_attachment_resource" "snowflake_account_password_policy_attachment_resource" "snowflake_alert_resource" "snowflake_alerts_datasource" "snowflake_api_integration_resource" "snowflake_authentication_policy_resource" "snowflake_cortex_search_service_resource" "snowflake_cortex_search_services_datasource" "snowflake_database_datasource" "snowflake_database_role_datasource" "snowflake_dynamic_table_resource" "snowflake_dynamic_tables_datasource" "snowflake_external_function_resource" "snowflake_external_functions_datasource" "snowflake_external_table_resource" "snowflake_external_tables_datasource" "snowflake_external_volume_resource" "snowflake_failover_group_resource" "snowflake_failover_groups_datasource" "snowflake_file_format_resource" "snowflake_file_formats_datasource" "snowflake_function_java_resource" "snowflake_function_javascript_resource" "snowflake_function_python_resource" "snowflake_function_scala_resource" "snowflake_function_sql_resource" "snowflake_managed_account_resource" "snowflake_materialized_view_resource" "snowflake_materialized_views_datasource" "snowflake_network_policy_attachment_resource" "snowflake_network_rule_resource" "snowflake_email_notification_integration_resource" "snowflake_notification_integration_resource" "snowflake_object_parameter_resource" "snowflake_password_policy_resource" "snowflake_pipe_resource" "snowflake_pipes_datasource" "snowflake_current_role_datasource" "snowflake_sequence_resource" "snowflake_sequences_datasource" "snowflake_share_resource" "snowflake_shares_datasource" "snowflake_parameters_datasource" "snowflake_procedure_java_resource" "snowflake_procedure_javascript_resource" "snowflake_procedure_python_resource" "snowflake_procedure_scala_resource" "snowflake_procedure_sql_resource" "snowflake_stage_resource" "snowflake_stages_datasource" "snowflake_storage_integration_resource" "snowflake_storage_integrations_datasource" "snowflake_system_generate_scim_access_token_datasource" "snowflake_system_get_aws_sns_iam_policy_datasource" "snowflake_system_get_privatelink_config_datasource" "snowflake_system_get_snowflake_platform_info_datasource" "snowflake_table_column_masking_policy_application_resource" "snowflake_table_constraint_resource" "snowflake_table_resource" "snowflake_user_authentication_policy_attachment_resource" "snowflake_user_public_keys_resource" "snowflake_user_password_policy_attachment_resource"], got snowflake_tables_datasource
│
│   with provider["registry.terraform.io/snowflake-labs/snowflake"],
│   on main.tf line 17, in provider "snowflake":
│   17:   preview_features_enabled = ["snowflake_tables_datasource"]
│
╵

Steps to Reproduce

  1. Copy the configuration above
  2. Run terraform plan

How much impact is this issue causing?

Medium

Logs

https://gist.github.com/nmcintyre/bbbb43b7e839b7c612c3fc4397790402

Additional Information

No response

Would you like to implement a fix?

  • Yeah, I'll take it 😎
@nmcintyre nmcintyre added the bug Used to mark issues with provider's incorrect behavior label Dec 17, 2024
@nmcintyre
Copy link
Author

This is also happening with snowflake_procedures_datasource as well.

@sfc-gh-jmichalak sfc-gh-jmichalak self-assigned this Dec 18, 2024
@sfc-gh-jmichalak
Copy link
Collaborator

Hi @nmcintyre 👋

The configuration validator is missing snowflake_procedures_datasource, snowflake_functions_datasource, and snowflake_tables_datasource. We should be able to fix this quickly.

@sfc-gh-asawicki sfc-gh-asawicki added the category:migration Issues connected with migration to v1.0.0. label Dec 18, 2024
sfc-gh-asawicki added a commit that referenced this issue Dec 20, 2024
- Update docs and migration guide
- Bump tracking version
- Fix method usage after merge (method has been removed)
- Fix whitespace
- Fix link
- Improve function and procedure examples (multiline)

References: #3303 #3302 #3298
sfc-gh-asawicki added a commit that referenced this issue Dec 20, 2024
- Update docs and migration guide
- Bump tracking version
- Fix method usage after merge (method has been removed)
- Fix whitespace
- Fix link
- Improve function and procedure examples (multiline)

References: #3303 #3302 #3298
@sfc-gh-asawicki
Copy link
Collaborator

sfc-gh-asawicki commented Dec 23, 2024

Hey @nmcintyre. We have released v1.0.1 on Friday. The missing preview feature values were added to all configs and validators.

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 category:migration Issues connected with migration to v1.0.0.
Projects
None yet
Development

No branches or pull requests

3 participants