-
Notifications
You must be signed in to change notification settings - Fork 427
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
snowflake_pipe_grant on_all option #1932
Comments
Have you tried the Here would be an example use case:
|
maybe we have a new release but last time I tried, it didn't work because we cannot do a grant ... on all pipes in ... to role ... in Snowflake, we can do a grant on future but not on all. So we have to do a loop. I think the snowflake_grant_privileges_to_role should have a condition if it's plural = "pipes", it should get the list of all pipes and grant individually or something like that. |
Hello @sfc-gh-swinkler I got error According to Snowflake documentation, it's not allowed:
https://docs.snowflake.com/en/sql-reference/sql/grant-privilege#required-parameters |
Hey @alexandrewatercare @fabien-sarcel The config should look similar to this resource "snowflake_grant_privileges_to_role" "g" {
privileges = ["MONITOR", "OPERATE"]
role_name = snowflake_role.r.name
for_each = toset(["pipe1", "pipe2", "pipe3"])
on_schema_object {
object_type = "PIPE"
object_name = each.key
}
} |
Hi @sfc-gh-jcieslak , I got a runtime error when I try your workaround.
|
@fabien-sarcel because I've given you an example usage, not a complete one that will work on your environment. You'll have to replace a source that you're giving to for_each field and this source should contain valid identifiers (it can be other things than toSet(), you could probably make a setup where those values would come from pipes data source). I'm aware that the error message is not clear, but it basically means that it requires a fully qualified name of the schema object, so "<schema_name>.<schema_object_name>". resource "snowflake_grant_privileges_to_role" "g" {
privileges = ["MONITOR", "OPERATE"]
role_name = snowflake_role.r.name
for_each = toset(["<schema_name>.<schema_object_name>", "<schema_name>.<schema_object_name>"])
on_schema_object {
object_type = "PIPE"
object_name = each.key
}
} |
Thanks @sfc-gh-swinkler. |
@fabien-sarcel Great to hear! Is that ok to close this issue then? |
I didn't open it, but from my point of view I'll say yes. |
@alexandrewatercare Right now, we're working on designing / re-designing and we're considering the approach you've mentioned. For now, please use for_each, but we can leave the issue open and we'll get back to it once it is implemented or we'll have a decision about not implementing it. |
Hey 👋, working on_all pipes will be merged soon in #2477 and will be available in the next release. As soon as the latest version appears (next week), please let us know if it fixes the bug and the issue can be closed. Until that happens suggested |
Closing due to inactivity of the author (fix confirmed fabien-sarcel). If the issue persists, please create another ticket. |
Is your feature request related to a problem? Please describe.
We can't use the on_all parameter for the snowflake_pipe_grant. This parameter is for all other resource type but not for this one. We have the on_future but not on_all
Describe the solution you'd like
The on_all parameter is available
Describe alternatives you've considered
We can use the data sources snowflake_pipes and loop ourself on all existing pipe but it's harder to maintain.
The text was updated successfully, but these errors were encountered: