oci_data_safe_masking_policy

This resource provides the Masking Policy resource in Oracle Cloud Infrastructure Data Safe service.

Creates a new masking policy and associates it with a sensitive data model or a target database.

To use a sensitive data model as the source of masking columns, set the columnSource attribute to SENSITIVE_DATA_MODEL and provide the sensitiveDataModelId attribute. After creating a masking policy, you can use the AddMaskingColumnsFromSdm operation to automatically add all the columns from the associated sensitive data model. In this case, the target database associated with the sensitive data model is used for column and masking format validations.

You can also create a masking policy without using a sensitive data model. In this case, you need to associate your masking policy with a target database by setting the columnSource attribute to TARGET and providing the targetId attribute. The specified target database is used for column and masking format validations.

After creating a masking policy, you can use the CreateMaskingColumn or PatchMaskingColumns operation to manually add columns to the policy. You need to add the parent columns only, and it automatically adds the child columns (in referential relationship with the parent columns) from the associated sensitive data model or target database.

Example Usage

resource "oci_data_safe_masking_policy" "test_masking_policy" {
	#Required
	column_source {
		#Required
		column_source = var.masking_policy_column_source_column_source

		#Optional
		sensitive_data_model_id = oci_data_safe_sensitive_data_model.test_sensitive_data_model.id
		target_id = oci_cloud_guard_target.test_target.id
	}
	compartment_id = var.compartment_id

	#Optional
	defined_tags = {"Operations.CostCenter"= "42"}
	description = var.masking_policy_description
	display_name = var.masking_policy_display_name
	freeform_tags = {"Department"= "Finance"}
	is_drop_temp_tables_enabled = var.masking_policy_is_drop_temp_tables_enabled
	is_redo_logging_enabled = var.masking_policy_is_redo_logging_enabled
	is_refresh_stats_enabled = var.masking_policy_is_refresh_stats_enabled
	parallel_degree = var.masking_policy_parallel_degree
	post_masking_script = var.masking_policy_post_masking_script
	pre_masking_script = var.masking_policy_pre_masking_script
	recompile = var.masking_policy_recompile
}

Argument Reference

The following arguments are supported:

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Masking Policy * update - (Defaults to 20 minutes), when updating the Masking Policy * delete - (Defaults to 20 minutes), when destroying the Masking Policy

Import

MaskingPolicies can be imported using the id, e.g.

$ terraform import oci_data_safe_masking_policy.test_masking_policy "id"