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

feat: Add service user and legacy service user resources #3119

Closed sfc-gh-asawicki closed 1 month ago

sfc-gh-asawicki commented 1 month ago

Introduce snowflake_service_user and snowflake_legacy_service_user resources:

References: #2951

Implementation considerations

Users of different types differ in Snowflake just slightly - a few fields are restricted from SERVICE and LEGACY_SERVICE type users. We decided to split Snowflake resources into multiple resources on our route to V1, to simplify the logic and usage (in this case, not to handle the type changes which are followed by attributes being hidden/revealed). That led to three choices for the implementation, to reuse the existing resource:

Ultimately, the second option was picked for the current implementation. More details of pros and cons of each solution are presented in points below.

copy-paste

Pros:

Cons:

parameterized handling methods

Pros:

Cons:

enrich the helper methods

Pros:

Cons:

github-actions[bot] commented 1 month ago

Integration tests failure for c7aca444c4a3e3bae5ce978dd6b5ad38c5150a97

github-actions[bot] commented 1 month ago

Integration tests failure for 7c3737b8ed747eab803c2206d424c475d704d338

github-actions[bot] commented 1 month ago

Integration tests failure for 3a1ff98589dce8fb8287453f8a746f8963307d58