-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: grants on external volumes (#2538)
Fixes: #2533 Terraform couldn't read privileges for External volumes, because Snowflake returns a shorter `VOLUME` name where we expect `EXTERNAL VOLUME` to be returned. The proposed fix relies on replacing `EXTERNAL VOLUME` with `VOLUME` in the prepare read request function so that the Read operation will be untouched and will work for external volumes. ## Test Plan <!-- detail ways in which this PR has been tested or needs to be tested --> * [x] acceptance tests to show the fix works (didn't pass without the fix) <!-- add more below if you think they are relevant --> ## Other Wrote to the docs team to add this case to the SHOW GRANTS page. **Update**: added missing privileges (CREATE MODEL needed for #2563)
- Loading branch information
1 parent
bfe488a
commit 1de9a29
Showing
5 changed files
with
239 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
pkg/resources/testdata/TestAcc_GrantPrivilegesToAccountRole/OnExternalVolume/test.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
resource "snowflake_grant_privileges_to_account_role" "test" { | ||
account_role_name = var.name | ||
privileges = var.privileges | ||
with_grant_option = var.with_grant_option | ||
on_account_object { | ||
object_type = "EXTERNAL VOLUME" | ||
object_name = var.external_volume | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
pkg/resources/testdata/TestAcc_GrantPrivilegesToAccountRole/OnExternalVolume/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
variable "name" { | ||
type = string | ||
} | ||
|
||
variable "external_volume" { | ||
type = string | ||
} | ||
|
||
variable "privileges" { | ||
type = list(string) | ||
} | ||
|
||
variable "with_grant_option" { | ||
type = bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.