Snowflake-Labs / terraform-provider-snowflake

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

Add destruction functionality for snowflake_account resource #2352

Open sivertflu opened 10 months ago

sivertflu commented 10 months ago

Terraform CLI and Provider Versions

TF version 1.6.6 Provider version 0.82.0

Use Cases or Problem Statement

We would like to fully manage, that is both create and destroy, Snowflake accounts through Terraform and this Provider. Today, the creation operation work, but the destruction of the snowflake_account resources does nothing except remove the resource from the Terraform state. This behaviour is documented and expected, as one previously had to contact Snowflake support to drop an account, but that is no longer the case.

Proposal

The ORGADMIN role can schedule an account to be dropped though both the Snowsight UI and SQL. The account will then be dropped after the grace period expires. I propose that on destruction of the snowflake_account resource, the account is scheduled for deletion upon the expiry of the grace period.

How much impact is this issue causing?

Medium

Additional Information

Workaround today is to manually drop the account after Terraform has deleted the snowflake_account resource from its state.

sfc-gh-asawicki commented 9 months ago

Hey @sivertflu. Thanks for creating the issue.

We will be refining the existing resources soon. You can check our roadmap here: https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md#our-roadmap. I will make sure we discuss this topic then.