terraform-provider-snowflake icon indicating copy to clipboard operation
terraform-provider-snowflake copied to clipboard

Qualified name availability in Resources and Data Sources

Open TerjeRusska opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe.

Newer resources require the usage of qualified name which is not available in either existing resources or data sources. Example snowflake_table_column_masking_policy_application snowflake_grant_privileges_to_role. Looping through these types of resources I have to build the qualified names myself from bits of available data.

resource snowflake_table_column_masking_policy_application masking_policy_sandbox {
  provider = snowflake.masking_admin
  for_each = local.masking_policy_sandbox

  # The qualified_name is in format "DATABASE"."SCHEMA"."TABLE"
  # FIXME: Take qualified_name from data source when it comes available
  table          = "\"${each.value.table.database}\".\"${each.value.table.schema}\".\"${each.value.table.name}\""
  column         = each.value.column
  masking_policy = "${each.value.table.database}.${each.value.table.schema}.MASKING_POLICY_${each.value.type}_${each.value.masking_policy}"
}

Describe the solution you'd like

Resources and Data sources should have qualified_name already available as a parameter

Describe alternatives you've considered

Currently manually building these qualified names

Additional context

TerjeRusska avatar Aug 29 '23 07:08 TerjeRusska