snowflake.TagMaskingPolicyAssociation
Explore with Pulumi AI
Attach a masking policy to a tag. Requires a current warehouse to be set. Either with SNOWFLAKE_WAREHOUSE env variable or in current session. If no warehouse is provided, a temporary warehouse will be created.
Example Usage
Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
resources:
# Note: Currently this feature is only available to accounts that are Enterprise Edition (or higher)
test:
type: snowflake:Database
properties:
name: TEST_DB1
dataRetentionTimeInDays: 1
test2:
type: snowflake:Database
properties:
name: TEST_DB2
dataRetentionTimeInDays: 1
test2Schema:
type: snowflake:Schema
name: test2
properties:
database: ${test2.name}
name: FOOBAR2
dataRetentionDays: ${test2.dataRetentionTimeInDays}
testSchema:
type: snowflake:Schema
name: test
properties:
database: ${test.name}
name: FOOBAR
dataRetentionDays: ${test.dataRetentionTimeInDays}
this:
type: snowflake:Tag
properties:
name:
fn::invoke:
Function: std:upper
Arguments:
input: test_tag
Return: result
database: ${test2.name}
schema: ${test2Schema.name}
exampleMaskingPolicy:
type: snowflake:MaskingPolicy
name: example_masking_policy
properties:
name: EXAMPLE_MASKING_POLICY
database: ${test.name}
schema: ${testSchema.name}
valueDataType: string
maskingExpression: case when current_role() in ('ACCOUNTADMIN') then val else sha2(val, 512) end
returnDataType: string
name:
type: snowflake:TagMaskingPolicyAssociation
properties:
tagId: '"${this.database}"."${this.schema}"."${this.name}"'
maskingPolicyId: '"${exampleMaskingPolicy.database}"."${exampleMaskingPolicy.schema}"."${exampleMaskingPolicy.name}"'
Create TagMaskingPolicyAssociation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TagMaskingPolicyAssociation(name: string, args: TagMaskingPolicyAssociationArgs, opts?: CustomResourceOptions);
@overload
def TagMaskingPolicyAssociation(resource_name: str,
args: TagMaskingPolicyAssociationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TagMaskingPolicyAssociation(resource_name: str,
opts: Optional[ResourceOptions] = None,
masking_policy_id: Optional[str] = None,
tag_id: Optional[str] = None)
func NewTagMaskingPolicyAssociation(ctx *Context, name string, args TagMaskingPolicyAssociationArgs, opts ...ResourceOption) (*TagMaskingPolicyAssociation, error)
public TagMaskingPolicyAssociation(string name, TagMaskingPolicyAssociationArgs args, CustomResourceOptions? opts = null)
public TagMaskingPolicyAssociation(String name, TagMaskingPolicyAssociationArgs args)
public TagMaskingPolicyAssociation(String name, TagMaskingPolicyAssociationArgs args, CustomResourceOptions options)
type: snowflake:TagMaskingPolicyAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args TagMaskingPolicyAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args TagMaskingPolicyAssociationArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args TagMaskingPolicyAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TagMaskingPolicyAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TagMaskingPolicyAssociationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var tagMaskingPolicyAssociationResource = new Snowflake.TagMaskingPolicyAssociation("tagMaskingPolicyAssociationResource", new()
{
MaskingPolicyId = "string",
TagId = "string",
});
example, err := snowflake.NewTagMaskingPolicyAssociation(ctx, "tagMaskingPolicyAssociationResource", &snowflake.TagMaskingPolicyAssociationArgs{
MaskingPolicyId: pulumi.String("string"),
TagId: pulumi.String("string"),
})
var tagMaskingPolicyAssociationResource = new TagMaskingPolicyAssociation("tagMaskingPolicyAssociationResource", TagMaskingPolicyAssociationArgs.builder()
.maskingPolicyId("string")
.tagId("string")
.build());
tag_masking_policy_association_resource = snowflake.TagMaskingPolicyAssociation("tagMaskingPolicyAssociationResource",
masking_policy_id="string",
tag_id="string")
const tagMaskingPolicyAssociationResource = new snowflake.TagMaskingPolicyAssociation("tagMaskingPolicyAssociationResource", {
maskingPolicyId: "string",
tagId: "string",
});
type: snowflake:TagMaskingPolicyAssociation
properties:
maskingPolicyId: string
tagId: string
TagMaskingPolicyAssociation Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The TagMaskingPolicyAssociation resource accepts the following input properties:
- Masking
Policy stringId - The resource id of the masking policy
- Tag
Id string - Specifies the identifier for the tag. Note: format must follow: "databaseName"."schemaName"."tagName" or "databaseName.schemaName.tagName" or "databaseName|schemaName.tagName" (snowflake_tag.tag.id)
- Masking
Policy stringId - The resource id of the masking policy
- Tag
Id string - Specifies the identifier for the tag. Note: format must follow: "databaseName"."schemaName"."tagName" or "databaseName.schemaName.tagName" or "databaseName|schemaName.tagName" (snowflake_tag.tag.id)
- masking
Policy StringId - The resource id of the masking policy
- tag
Id String - Specifies the identifier for the tag. Note: format must follow: "databaseName"."schemaName"."tagName" or "databaseName.schemaName.tagName" or "databaseName|schemaName.tagName" (snowflake_tag.tag.id)
- masking
Policy stringId - The resource id of the masking policy
- tag
Id string - Specifies the identifier for the tag. Note: format must follow: "databaseName"."schemaName"."tagName" or "databaseName.schemaName.tagName" or "databaseName|schemaName.tagName" (snowflake_tag.tag.id)
- masking_
policy_ strid - The resource id of the masking policy
- tag_
id str - Specifies the identifier for the tag. Note: format must follow: "databaseName"."schemaName"."tagName" or "databaseName.schemaName.tagName" or "databaseName|schemaName.tagName" (snowflake_tag.tag.id)
- masking
Policy StringId - The resource id of the masking policy
- tag
Id String - Specifies the identifier for the tag. Note: format must follow: "databaseName"."schemaName"."tagName" or "databaseName.schemaName.tagName" or "databaseName|schemaName.tagName" (snowflake_tag.tag.id)
Outputs
All input properties are implicitly available as output properties. Additionally, the TagMaskingPolicyAssociation resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing TagMaskingPolicyAssociation Resource
Get an existing TagMaskingPolicyAssociation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: TagMaskingPolicyAssociationState, opts?: CustomResourceOptions): TagMaskingPolicyAssociation
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
masking_policy_id: Optional[str] = None,
tag_id: Optional[str] = None) -> TagMaskingPolicyAssociation
func GetTagMaskingPolicyAssociation(ctx *Context, name string, id IDInput, state *TagMaskingPolicyAssociationState, opts ...ResourceOption) (*TagMaskingPolicyAssociation, error)
public static TagMaskingPolicyAssociation Get(string name, Input<string> id, TagMaskingPolicyAssociationState? state, CustomResourceOptions? opts = null)
public static TagMaskingPolicyAssociation get(String name, Output<String> id, TagMaskingPolicyAssociationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Masking
Policy stringId - The resource id of the masking policy
- Tag
Id string - Specifies the identifier for the tag. Note: format must follow: "databaseName"."schemaName"."tagName" or "databaseName.schemaName.tagName" or "databaseName|schemaName.tagName" (snowflake_tag.tag.id)
- Masking
Policy stringId - The resource id of the masking policy
- Tag
Id string - Specifies the identifier for the tag. Note: format must follow: "databaseName"."schemaName"."tagName" or "databaseName.schemaName.tagName" or "databaseName|schemaName.tagName" (snowflake_tag.tag.id)
- masking
Policy StringId - The resource id of the masking policy
- tag
Id String - Specifies the identifier for the tag. Note: format must follow: "databaseName"."schemaName"."tagName" or "databaseName.schemaName.tagName" or "databaseName|schemaName.tagName" (snowflake_tag.tag.id)
- masking
Policy stringId - The resource id of the masking policy
- tag
Id string - Specifies the identifier for the tag. Note: format must follow: "databaseName"."schemaName"."tagName" or "databaseName.schemaName.tagName" or "databaseName|schemaName.tagName" (snowflake_tag.tag.id)
- masking_
policy_ strid - The resource id of the masking policy
- tag_
id str - Specifies the identifier for the tag. Note: format must follow: "databaseName"."schemaName"."tagName" or "databaseName.schemaName.tagName" or "databaseName|schemaName.tagName" (snowflake_tag.tag.id)
- masking
Policy StringId - The resource id of the masking policy
- tag
Id String - Specifies the identifier for the tag. Note: format must follow: "databaseName"."schemaName"."tagName" or "databaseName.schemaName.tagName" or "databaseName|schemaName.tagName" (snowflake_tag.tag.id)
Import
format is tag database name | tag schema name | tag name | masking policy database | masking policy schema | masking policy name
$ pulumi import snowflake:index/tagMaskingPolicyAssociation:TagMaskingPolicyAssociation example 'tag_db|tag_schema|tag_name|mp_db|mp_schema|mp_name'
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Snowflake pulumi/pulumi-snowflake
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
snowflake
Terraform Provider.