terraform-provider-snowflake
terraform-provider-snowflake copied to clipboard
Importing snoflake_role_grants
The documentation on how to import a snowflake_role_grants seems not to be correct. It states the format is terraform import snowflake_role_grants.example rolename
. See documentation
Using that format leads to the following error:
Error: 4 to 6 fields allowed in ID
What is the correct way to import them?
For me, the import actually runs without any errors (provider version 0.37.1) , but the role grants are not imported.
For example, in Snowflake I have
so I would expect the roles AAD-APP-... and SYSADMIN to be granted the DATAENGINEER role. But in the imported state, the roles list is empty:
Or do I misunderstand something about the grants direction here?
I have the same issue as @lp-code. There are no user/role grants imported although the import command runs without errors(provider version 0.39.0). Any solutions/suggestions?
@lp-code and @nikoshet Sounds like your issue might be related to this discussion https://github.com/Snowflake-Labs/terraform-provider-snowflake/discussions/740?
@lp-code and @nikoshet Sounds like your issue might be related to this discussion #740?
I haven't completely understood the issue, but it seems likely that it is the one I hit as you point out that
https://github.com/Snowflake-Labs/terraform-provider-snowflake/pull/520 also had the unexpected consequence that there's no way to import role grants
I haven't worked further on the role grants; it would for certainly be annoying if they could not be managed from TF.
Hey 👋 Closing the issue as it's referring to the deprecated resource and we're not supporting them. Please, try to use the latest provider version with the non-deprecated resources (e.g. snowflake_grant_privileges_to_account_role). If the issue persists on the non-deprecated resource (or the feature is present in Snowflake, but not in the provider), please create a new GitHub issue. The migration guide may help during migration to the latest resources. Here's a list of the latest, non-deprecated, grant resources:
Resources snowflake_grant_privileges_to_database_role snowflake_grant_privileges_to_account_role snowflake_grant_account_role snowflake_grant_database_role snowflake_grant_application_role (coming soon) snowflake_grant_privileges_to_share snowflake_grant_ownership (coming soon)
Data sources snowflake_grants