How to use provider configuration variable in a module

I am using Snowflake Provider for which we are specifying the account in configuration file.

We have created our own module based on snowflake_database resource in which we want to create resource snowflake_grant_privileges_to_account_role only if account value is XYZ.

Any example on how to do this?

Can you clarify a little more about how the database is defined in the module, and how it’s getting its idea of what account it’s in? As well as how you’re configuring the provider with the account ID(s) in the first place?

There does seem to be a snowflake_accounts data source (Terraform Registry), but it’s not totally clear from those docs alone how you’d be able to use it to get the account for a current instance.

You could also look at the snowflake_database resource type and see if there are any useful attributes you can use to derive the account name there.