From d2bb71b9803054b8403ed9775eb811d35970042a Mon Sep 17 00:00:00 2001 From: Arkadius Schuchhardt Date: Thu, 2 Mar 2023 23:22:29 +0100 Subject: [PATCH] fix: readded imported privileges special case for database grants --- pkg/resources/database_grant.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/resources/database_grant.go b/pkg/resources/database_grant.go index 96362ca5ab..4238d0c053 100644 --- a/pkg/resources/database_grant.go +++ b/pkg/resources/database_grant.go @@ -123,6 +123,13 @@ func ReadDatabaseGrant(d *schema.ResourceData, meta interface{}) error { } } + // 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) }