Snowflake_role_grants - grant multiple users to a single role? #2752
-
With the new snowflake_grant_account_role, is it possible to grant a role to multiple users within one block? I'm trying to update this code: resource "snowflake_role_grants" "data_engineer_grant" { Would I have to make a separate block for each user? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hey @natashamathur. Thanks for reaching out to us. Yes, you have to do multiple blocks or utilize builtin HCL for_each meta-argument. You can read more in thread #2668 (comment). |
Beta Was this translation helpful? Give feedback.
-
Can for_each be used for both users and roles within a single block?
|
Beta Was this translation helpful? Give feedback.
-
Ah yes apologies - I am updating! I was trying to figure out how to update this block. For other blocks where its multiple users for one role, I used foreach. I was wondering if its possible to basically loop through twice in one block. Thank you so much! |
Beta Was this translation helpful? Give feedback.
Hey @natashamathur. Thanks for reaching out to us.
Yes, you have to do multiple blocks or utilize builtin HCL for_each meta-argument. You can read more in thread #2668 (comment).