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
- Use any Snowflake account on a recent release where DESCRIBE PROCEDURE returns the new format
- Define any snowflake_procedure_python resource:
- 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?
Terraform CLI Version
(any version)
Terraform Provider Version
2.19.0
Company Name
State of Colorado
Terraform Configuration
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
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?