Skip to content

snowflake_procedure_python read fails after Snowflake BCR moves packages to artifact_repository_packages #5116

Description

@sfc-gh-bcooper

Terraform CLI Version

(any version)

Terraform Provider Version

2.19.0

Company Name

State of Colorado

Terraform Configuration

resource "snowflake_procedure_python" "example" {
  name     = "my_procedure"
  database = "MY_DB"
  schema   = "MY_SCHEMA"
  runtime_version = "3.8"
  packages = ["snowflake-snowpark-python"]
  handler = "main"
  return_type = "STRING"
  statement = "def main(session): return 'hello'"
}

Category

category:resource

Object type(s)

resource:procedure_python

Expected Behavior

The provider should successfully read Python procedures on accounts with the new DESCRIBE PROCEDURE output format by checking the artifact_repository_packages field in addition to (or instead of) the packages field.

Actual Behavior

All operations involving snowflake_procedure_python fail during the read phase with the error message above.

Steps to Reproduce

  1. Use any Snowflake account on a recent release where DESCRIBE PROCEDURE returns the new format
  2. Define any snowflake_procedure_python resource:
  3. Run terraform apply

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

Workaround
Replace snowflake_procedure_python resources with snowflake_execute resources using raw CREATE OR REPLACE PROCEDURE SQL. This bypasses the provider's read validation entirely:

resource "snowflake_execute" "example" {
execute = <<-SQL
CREATE OR REPLACE PROCEDURE MY_DB.MY_SCHEMA.my_procedure()
RETURNS STRING
LANGUAGE PYTHON
RUNTIME_VERSION = '3.8'
PACKAGES = ('snowflake-snowpark-python')
HANDLER = 'main'
AS $$
def main(session):
return 'hello'
$$
SQL

revert = "DROP PROCEDURE IF EXISTS MY_DB.MY_SCHEMA.my_procedure()"
}

Additional Context
This appears to be related to Snowflake's artifact_repository feature introduced for Python procedures. The SHOW PROCEDURES output also has no packages column, confirming that DESCRIBE PROCEDURE is the only source for package information and that the schema of its output has changed.

The fix likely needs to be made in the provider's read function to check both fields for backward compatibility with older Snowflake accounts while supporting the new format.

Would you like to implement a fix?

  • Yeah, I'll take it 😎

Metadata

Metadata

Labels

category:resourceIssue connected to one of the existing/new resources.category:stableIssue connected with a stable feature.general-usageImproper usage of the provider or terraform ecosystem or question about the usage.resource:function_pythonIssue connected to the snowflake_function_python resourceresource:procedure_pythonIssue connected to the snowflake_procedure_python resource

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions