-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: default_secondary_roles_option incompatible with BCR-1692 empty list #3340
Comments
Hey @coleheflin-gt 👋
So, the only way to automatically change from null to all is to use the "DEFAULT" option. After enabling the BCR bundle, the default will adapt from the old default ( I tested it manually, but we also have automated tests that check this exact behavior:
|
I updated my user in our staging account to set default_secondary_roles_option = "NONE" and then ran SHOW USERS and the default_secondary_roles value still shows as null instead of an emtpy list. See below for a snippet of my state file.
Is this because we aren't on the 2024_08 release yet? Here's the results of the bundle we are on in staging:
|
hm, so I ended up forcing all users to have Must've been something weird about these users being created prior to the changes you linked above and their default_secondary_roles_option were already set to NONE. Lmk if there's anything else you want me to run on this, otherwise I'm good to close this out. |
Terraform CLI Version
1.10.4
Terraform Provider Version
0.100.0
Company Name
Gametime
Terraform Configuration
Category
category:resource
Object type(s)
resource:user
Expected Behavior
The provider should support setting default_secondary_roles to an empty list [] to accommodate BCR-1692 requirements, particularly for admin users who need to prevent the automatic conversion of NULL to ['ALL'].
Actual Behavior
The provider only supports three string options for default_secondary_roles_option:
"DEFAULT"
"NONE" (translates to NULL in Snowflake)
"ALL"
This makes it impossible to set an empty list [], which is distinct from NULL and necessary for BCR-1692 compliance.
Steps to Reproduce
Configure a Snowflake user with admin roles
Attempt to set default_secondary_roles to an empty list
Observe that the provider only allows string options, none of which translate to an empty list in Snowflake
How much impact is this issue causing?
Medium
Logs
No response
Additional Information
This issue ideally needs resolution before February 2025 when BCR-1692 becomes generally available and automatically enabled for all Snowflake accounts. Without this capability, admins will always have ALL roles active, making it difficult to verify individual role permissions. Current workaround requires managing this setting outside of Terraform, however, this is not ideal since it's harder to maintain over time as we add/remove users.
https://community.snowflake.com/s/article/default-secondary-roles-all-overview-and-additional-explanations?mkt_tok=MjUyLVJGTy0yMjcAAAGYD-UFmpgGrNBZ_5dYnBoTOd61JPESiXOSoa0vOewMaknYlrHL9gGMuCCON7912_Nbev_rtx-s0DKat5T-J9XwW0DWYsIZiV1RdXQ0J7dOlKJONPPtCQ#f1
https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/user#default_secondary_roles_option-1
Would you like to implement a fix?
The text was updated successfully, but these errors were encountered: