Snowflake-Labs / terraform-provider-snowflake

Terraform provider for managing Snowflake accounts
https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest
MIT License
552 stars 420 forks source link

[Feature]: Add Support for EXTERNAL_ACCESS_INTEGRATIONS and SECRETS to Procedure Resources #3165

Closed peter-stratton closed 3 weeks ago

peter-stratton commented 3 weeks ago

Use Cases or Problem Statement

Snowflake Procedures written in both Java and Python support the parameters EXTERNAL_ACCESS_INTEGRATIONS and their associated SECRETS. It would be great if the snowflake_procedure resource could support these as well.

Category

category:resource

Object type(s)

resource:procedure

Proposal

It looks like support for both EXTERNAL_ACCESS_INTEGRATIONS and SECRETS are both included in the Java and Python procedure_gen options structs. There are also dto builder functions to set both parameters. I see tests for the builders and the expected DDL output includes both parameters as well. However, I didn't see full implementation in the road map, nor did I see any open or closed issues related to it.

Since support is partially implemented, I propose completing the implementation by connecting the dto constructor code with the resource schema definition. I've taken a quick look at the code changes required and think a rough approach might be:

  1. adding external_access_integrations and secrets to the procedure schema
  2. update createPythonProcedure and createJavaProcedure to parse both new schema fields and call the associated dto builder functions
  3. update ReadContextProcedure to parse and set new keys on the ResourceData schema
  4. updating/adding test coverage for the updates

I'm happy to help if this isn't something already slated for completion.

How much impact is this issue causing?

Low

Additional Information

Just to clarify, this proposal would JUST be to implement support for passing the EXTERNAL_ACCESS_INTEGRATIONS and SECRETS parameters to the Procedure DDL. It would not satisfy #2546.

Would you like to implement a fix?

sfc-gh-jcieslak commented 3 weeks ago

Hey @peter-stratton 👋 We are going to work on a procedure resource soon. This work will include adding or modifying existing resources to comply with fields available in the CREATE and ALTER. cc: @sfc-gh-asawicki

peter-stratton commented 3 weeks ago

Sounds great, thank you!