Skip to content

Commit

Permalink
fix: readded imported privileges special case for database grants (#1597
Browse files Browse the repository at this point in the history
)

Co-authored-by: Arkadius Schuchhardt <[email protected]>
  • Loading branch information
Relativity74205 and AS-auxmoney authored Mar 16, 2023
1 parent c41b6a3 commit 711ac0c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/resources/database_grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ func ReadDatabaseGrant(d *schema.ResourceData, meta interface{}) error {
return err
}

// IMPORTED PRIVILEGES is not a real resource, so we can't actually verify
// that it is still there. However, it is needed to grant usage for the snowflake database to custom roles.
// Just exit for now
if grantID.Privilege == "IMPORTED PRIVILEGES" {
return nil
}

builder := snowflake.DatabaseGrant(grantID.DatabaseName)
return readGenericGrant(d, meta, databaseGrantSchema, builder, false, validDatabasePrivileges)
}
Expand Down

0 comments on commit 711ac0c

Please sign in to comment.