-
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: granting ownership on database roles (#2703)
A fix for #2700. Changed expected granted_on when it's equal to the database role. Acceptance test added.
- Loading branch information
1 parent
382bfc1
commit 88944e7
Showing
4 changed files
with
87 additions
and
6 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
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
20 changes: 20 additions & 0 deletions
20
pkg/resources/testdata/TestAcc_GrantOwnership/OnObject_DatabaseRole_ToAccountRole/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,20 @@ | ||
resource "snowflake_role" "test" { | ||
name = var.account_role_name | ||
} | ||
|
||
resource "snowflake_database" "test" { | ||
name = var.database_name | ||
} | ||
|
||
resource "snowflake_database_role" "test" { | ||
name = var.database_role_name | ||
database = snowflake_database.test.name | ||
} | ||
|
||
resource "snowflake_grant_ownership" "test" { | ||
account_role_name = snowflake_role.test.name | ||
on { | ||
object_type = "DATABASE ROLE" | ||
object_name = "\"${snowflake_database_role.test.database}\".\"${snowflake_database_role.test.name}\"" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...esources/testdata/TestAcc_GrantOwnership/OnObject_DatabaseRole_ToAccountRole/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,11 @@ | ||
variable "account_role_name" { | ||
type = string | ||
} | ||
|
||
variable "database_name" { | ||
type = string | ||
} | ||
|
||
variable "database_role_name" { | ||
type = string | ||
} |