Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.CloudGuard.getDataMaskRules
Explore with Pulumi AI
This data source provides the list of Data Mask Rules in Oracle Cloud Infrastructure Cloud Guard service.
Returns a list of all DataMaskRule resources in the specified compartmentId (OCID) and its subcompartments.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testDataMaskRules = oci.CloudGuard.getDataMaskRules({
    compartmentId: compartmentId,
    accessLevel: dataMaskRuleAccessLevel,
    dataMaskRuleStatus: dataMaskRuleDataMaskRuleStatus,
    displayName: dataMaskRuleDisplayName,
    iamGroupId: testGroup.id,
    state: dataMaskRuleState,
    targetId: testTarget.id,
    targetType: dataMaskRuleTargetType,
});
import pulumi
import pulumi_oci as oci
test_data_mask_rules = oci.CloudGuard.get_data_mask_rules(compartment_id=compartment_id,
    access_level=data_mask_rule_access_level,
    data_mask_rule_status=data_mask_rule_data_mask_rule_status,
    display_name=data_mask_rule_display_name,
    iam_group_id=test_group["id"],
    state=data_mask_rule_state,
    target_id=test_target["id"],
    target_type=data_mask_rule_target_type)
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/cloudguard"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudguard.GetDataMaskRules(ctx, &cloudguard.GetDataMaskRulesArgs{
			CompartmentId:      compartmentId,
			AccessLevel:        pulumi.StringRef(dataMaskRuleAccessLevel),
			DataMaskRuleStatus: pulumi.StringRef(dataMaskRuleDataMaskRuleStatus),
			DisplayName:        pulumi.StringRef(dataMaskRuleDisplayName),
			IamGroupId:         pulumi.StringRef(testGroup.Id),
			State:              pulumi.StringRef(dataMaskRuleState),
			TargetId:           pulumi.StringRef(testTarget.Id),
			TargetType:         pulumi.StringRef(dataMaskRuleTargetType),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testDataMaskRules = Oci.CloudGuard.GetDataMaskRules.Invoke(new()
    {
        CompartmentId = compartmentId,
        AccessLevel = dataMaskRuleAccessLevel,
        DataMaskRuleStatus = dataMaskRuleDataMaskRuleStatus,
        DisplayName = dataMaskRuleDisplayName,
        IamGroupId = testGroup.Id,
        State = dataMaskRuleState,
        TargetId = testTarget.Id,
        TargetType = dataMaskRuleTargetType,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.CloudGuard.CloudGuardFunctions;
import com.pulumi.oci.CloudGuard.inputs.GetDataMaskRulesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var testDataMaskRules = CloudGuardFunctions.getDataMaskRules(GetDataMaskRulesArgs.builder()
            .compartmentId(compartmentId)
            .accessLevel(dataMaskRuleAccessLevel)
            .dataMaskRuleStatus(dataMaskRuleDataMaskRuleStatus)
            .displayName(dataMaskRuleDisplayName)
            .iamGroupId(testGroup.id())
            .state(dataMaskRuleState)
            .targetId(testTarget.id())
            .targetType(dataMaskRuleTargetType)
            .build());
    }
}
variables:
  testDataMaskRules:
    fn::invoke:
      function: oci:CloudGuard:getDataMaskRules
      arguments:
        compartmentId: ${compartmentId}
        accessLevel: ${dataMaskRuleAccessLevel}
        dataMaskRuleStatus: ${dataMaskRuleDataMaskRuleStatus}
        displayName: ${dataMaskRuleDisplayName}
        iamGroupId: ${testGroup.id}
        state: ${dataMaskRuleState}
        targetId: ${testTarget.id}
        targetType: ${dataMaskRuleTargetType}
Using getDataMaskRules
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getDataMaskRules(args: GetDataMaskRulesArgs, opts?: InvokeOptions): Promise<GetDataMaskRulesResult>
function getDataMaskRulesOutput(args: GetDataMaskRulesOutputArgs, opts?: InvokeOptions): Output<GetDataMaskRulesResult>def get_data_mask_rules(access_level: Optional[str] = None,
                        compartment_id: Optional[str] = None,
                        data_mask_rule_status: Optional[str] = None,
                        display_name: Optional[str] = None,
                        filters: Optional[Sequence[GetDataMaskRulesFilter]] = None,
                        iam_group_id: Optional[str] = None,
                        state: Optional[str] = None,
                        target_id: Optional[str] = None,
                        target_type: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetDataMaskRulesResult
def get_data_mask_rules_output(access_level: Optional[pulumi.Input[str]] = None,
                        compartment_id: Optional[pulumi.Input[str]] = None,
                        data_mask_rule_status: Optional[pulumi.Input[str]] = None,
                        display_name: Optional[pulumi.Input[str]] = None,
                        filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetDataMaskRulesFilterArgs]]]] = None,
                        iam_group_id: Optional[pulumi.Input[str]] = None,
                        state: Optional[pulumi.Input[str]] = None,
                        target_id: Optional[pulumi.Input[str]] = None,
                        target_type: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetDataMaskRulesResult]func GetDataMaskRules(ctx *Context, args *GetDataMaskRulesArgs, opts ...InvokeOption) (*GetDataMaskRulesResult, error)
func GetDataMaskRulesOutput(ctx *Context, args *GetDataMaskRulesOutputArgs, opts ...InvokeOption) GetDataMaskRulesResultOutput> Note: This function is named GetDataMaskRules in the Go SDK.
public static class GetDataMaskRules 
{
    public static Task<GetDataMaskRulesResult> InvokeAsync(GetDataMaskRulesArgs args, InvokeOptions? opts = null)
    public static Output<GetDataMaskRulesResult> Invoke(GetDataMaskRulesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetDataMaskRulesResult> getDataMaskRules(GetDataMaskRulesArgs args, InvokeOptions options)
public static Output<GetDataMaskRulesResult> getDataMaskRules(GetDataMaskRulesArgs args, InvokeOptions options)
fn::invoke:
  function: oci:CloudGuard/getDataMaskRules:getDataMaskRules
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CompartmentId string
- The OCID of the compartment in which to list resources.
- AccessLevel string
- Valid values are RESTRICTEDandACCESSIBLE. Default isRESTRICTED. Setting this toACCESSIBLEreturns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set toRESTRICTEDpermissions are checked and no partial results are displayed.
- DataMask stringRule Status 
- The status of the data mask rule
- DisplayName string
- A filter to return only resources that match the entire display name given.
- Filters
List<GetData Mask Rules Filter> 
- IamGroup stringId 
- OCID of the IAM group
- State string
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- TargetId string
- OCID of the target
- TargetType string
- Type of target
- CompartmentId string
- The OCID of the compartment in which to list resources.
- AccessLevel string
- Valid values are RESTRICTEDandACCESSIBLE. Default isRESTRICTED. Setting this toACCESSIBLEreturns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set toRESTRICTEDpermissions are checked and no partial results are displayed.
- DataMask stringRule Status 
- The status of the data mask rule
- DisplayName string
- A filter to return only resources that match the entire display name given.
- Filters
[]GetData Mask Rules Filter 
- IamGroup stringId 
- OCID of the IAM group
- State string
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- TargetId string
- OCID of the target
- TargetType string
- Type of target
- compartmentId String
- The OCID of the compartment in which to list resources.
- accessLevel String
- Valid values are RESTRICTEDandACCESSIBLE. Default isRESTRICTED. Setting this toACCESSIBLEreturns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set toRESTRICTEDpermissions are checked and no partial results are displayed.
- dataMask StringRule Status 
- The status of the data mask rule
- displayName String
- A filter to return only resources that match the entire display name given.
- filters
List<GetData Mask Rules Filter> 
- iamGroup StringId 
- OCID of the IAM group
- state String
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- targetId String
- OCID of the target
- targetType String
- Type of target
- compartmentId string
- The OCID of the compartment in which to list resources.
- accessLevel string
- Valid values are RESTRICTEDandACCESSIBLE. Default isRESTRICTED. Setting this toACCESSIBLEreturns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set toRESTRICTEDpermissions are checked and no partial results are displayed.
- dataMask stringRule Status 
- The status of the data mask rule
- displayName string
- A filter to return only resources that match the entire display name given.
- filters
GetData Mask Rules Filter[] 
- iamGroup stringId 
- OCID of the IAM group
- state string
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- targetId string
- OCID of the target
- targetType string
- Type of target
- compartment_id str
- The OCID of the compartment in which to list resources.
- access_level str
- Valid values are RESTRICTEDandACCESSIBLE. Default isRESTRICTED. Setting this toACCESSIBLEreturns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set toRESTRICTEDpermissions are checked and no partial results are displayed.
- data_mask_ strrule_ status 
- The status of the data mask rule
- display_name str
- A filter to return only resources that match the entire display name given.
- filters
Sequence[GetData Mask Rules Filter] 
- iam_group_ strid 
- OCID of the IAM group
- state str
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- target_id str
- OCID of the target
- target_type str
- Type of target
- compartmentId String
- The OCID of the compartment in which to list resources.
- accessLevel String
- Valid values are RESTRICTEDandACCESSIBLE. Default isRESTRICTED. Setting this toACCESSIBLEreturns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set toRESTRICTEDpermissions are checked and no partial results are displayed.
- dataMask StringRule Status 
- The status of the data mask rule
- displayName String
- A filter to return only resources that match the entire display name given.
- filters List<Property Map>
- iamGroup StringId 
- OCID of the IAM group
- state String
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- targetId String
- OCID of the target
- targetType String
- Type of target
getDataMaskRules Result
The following output properties are available:
- CompartmentId string
- Compartment OCID where the resource is created
- DataMask List<GetRule Collections Data Mask Rules Data Mask Rule Collection> 
- The list of data_mask_rule_collection.
- Id string
- The provider-assigned unique ID for this managed resource.
- AccessLevel string
- DataMask stringRule Status 
- The current status of the data mask rule
- DisplayName string
- Data mask rule display name
- Filters
List<GetData Mask Rules Filter> 
- IamGroup stringId 
- IAM Group ID associated with the data mask rule
- State string
- The current lifecycle state of the data mask rule
- TargetId string
- TargetType string
- CompartmentId string
- Compartment OCID where the resource is created
- DataMask []GetRule Collections Data Mask Rules Data Mask Rule Collection 
- The list of data_mask_rule_collection.
- Id string
- The provider-assigned unique ID for this managed resource.
- AccessLevel string
- DataMask stringRule Status 
- The current status of the data mask rule
- DisplayName string
- Data mask rule display name
- Filters
[]GetData Mask Rules Filter 
- IamGroup stringId 
- IAM Group ID associated with the data mask rule
- State string
- The current lifecycle state of the data mask rule
- TargetId string
- TargetType string
- compartmentId String
- Compartment OCID where the resource is created
- dataMask List<GetRule Collections Data Mask Rules Data Mask Rule Collection> 
- The list of data_mask_rule_collection.
- id String
- The provider-assigned unique ID for this managed resource.
- accessLevel String
- dataMask StringRule Status 
- The current status of the data mask rule
- displayName String
- Data mask rule display name
- filters
List<GetData Mask Rules Filter> 
- iamGroup StringId 
- IAM Group ID associated with the data mask rule
- state String
- The current lifecycle state of the data mask rule
- targetId String
- targetType String
- compartmentId string
- Compartment OCID where the resource is created
- dataMask GetRule Collections Data Mask Rules Data Mask Rule Collection[] 
- The list of data_mask_rule_collection.
- id string
- The provider-assigned unique ID for this managed resource.
- accessLevel string
- dataMask stringRule Status 
- The current status of the data mask rule
- displayName string
- Data mask rule display name
- filters
GetData Mask Rules Filter[] 
- iamGroup stringId 
- IAM Group ID associated with the data mask rule
- state string
- The current lifecycle state of the data mask rule
- targetId string
- targetType string
- compartment_id str
- Compartment OCID where the resource is created
- data_mask_ Sequence[Getrule_ collections Data Mask Rules Data Mask Rule Collection] 
- The list of data_mask_rule_collection.
- id str
- The provider-assigned unique ID for this managed resource.
- access_level str
- data_mask_ strrule_ status 
- The current status of the data mask rule
- display_name str
- Data mask rule display name
- filters
Sequence[GetData Mask Rules Filter] 
- iam_group_ strid 
- IAM Group ID associated with the data mask rule
- state str
- The current lifecycle state of the data mask rule
- target_id str
- target_type str
- compartmentId String
- Compartment OCID where the resource is created
- dataMask List<Property Map>Rule Collections 
- The list of data_mask_rule_collection.
- id String
- The provider-assigned unique ID for this managed resource.
- accessLevel String
- dataMask StringRule Status 
- The current status of the data mask rule
- displayName String
- Data mask rule display name
- filters List<Property Map>
- iamGroup StringId 
- IAM Group ID associated with the data mask rule
- state String
- The current lifecycle state of the data mask rule
- targetId String
- targetType String
Supporting Types
GetDataMaskRulesDataMaskRuleCollection       
GetDataMaskRulesDataMaskRuleCollectionItem        
- CompartmentId string
- The OCID of the compartment in which to list resources.
- DataMask List<string>Categories 
- List of data mask rule categories
- DataMask stringRule Status 
- The status of the data mask rule
- Dictionary<string, string>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
- Description string
- The data mask rule description
- DisplayName string
- A filter to return only resources that match the entire display name given.
- Dictionary<string, string>
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- IamGroup stringId 
- OCID of the IAM group
- Id string
- Unique identifier that can't be changed after creation
- LifecyleDetails string
- Additional details on the substate of the lifecycle state [DEPRECATE]
- State string
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- Dictionary<string, string>
- System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
- TargetSelecteds List<GetData Mask Rules Data Mask Rule Collection Item Target Selected> 
- Specification of how targets are to be selected (select ALL, or select by TargetResourceType or TargetId).
- TimeCreated string
- The date and time the target was created. Format defined by RFC3339.
- TimeUpdated string
- The date and time the target was updated. Format defined by RFC3339.
- CompartmentId string
- The OCID of the compartment in which to list resources.
- DataMask []stringCategories 
- List of data mask rule categories
- DataMask stringRule Status 
- The status of the data mask rule
- map[string]string
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
- Description string
- The data mask rule description
- DisplayName string
- A filter to return only resources that match the entire display name given.
- map[string]string
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- IamGroup stringId 
- OCID of the IAM group
- Id string
- Unique identifier that can't be changed after creation
- LifecyleDetails string
- Additional details on the substate of the lifecycle state [DEPRECATE]
- State string
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- map[string]string
- System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
- TargetSelecteds []GetData Mask Rules Data Mask Rule Collection Item Target Selected 
- Specification of how targets are to be selected (select ALL, or select by TargetResourceType or TargetId).
- TimeCreated string
- The date and time the target was created. Format defined by RFC3339.
- TimeUpdated string
- The date and time the target was updated. Format defined by RFC3339.
- compartmentId String
- The OCID of the compartment in which to list resources.
- dataMask List<String>Categories 
- List of data mask rule categories
- dataMask StringRule Status 
- The status of the data mask rule
- Map<String,String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
- description String
- The data mask rule description
- displayName String
- A filter to return only resources that match the entire display name given.
- Map<String,String>
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- iamGroup StringId 
- OCID of the IAM group
- id String
- Unique identifier that can't be changed after creation
- lifecyleDetails String
- Additional details on the substate of the lifecycle state [DEPRECATE]
- state String
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- Map<String,String>
- System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
- targetSelecteds List<GetData Mask Rules Data Mask Rule Collection Item Target Selected> 
- Specification of how targets are to be selected (select ALL, or select by TargetResourceType or TargetId).
- timeCreated String
- The date and time the target was created. Format defined by RFC3339.
- timeUpdated String
- The date and time the target was updated. Format defined by RFC3339.
- compartmentId string
- The OCID of the compartment in which to list resources.
- dataMask string[]Categories 
- List of data mask rule categories
- dataMask stringRule Status 
- The status of the data mask rule
- {[key: string]: string}
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
- description string
- The data mask rule description
- displayName string
- A filter to return only resources that match the entire display name given.
- {[key: string]: string}
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- iamGroup stringId 
- OCID of the IAM group
- id string
- Unique identifier that can't be changed after creation
- lifecyleDetails string
- Additional details on the substate of the lifecycle state [DEPRECATE]
- state string
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- {[key: string]: string}
- System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
- targetSelecteds GetData Mask Rules Data Mask Rule Collection Item Target Selected[] 
- Specification of how targets are to be selected (select ALL, or select by TargetResourceType or TargetId).
- timeCreated string
- The date and time the target was created. Format defined by RFC3339.
- timeUpdated string
- The date and time the target was updated. Format defined by RFC3339.
- compartment_id str
- The OCID of the compartment in which to list resources.
- data_mask_ Sequence[str]categories 
- List of data mask rule categories
- data_mask_ strrule_ status 
- The status of the data mask rule
- Mapping[str, str]
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
- description str
- The data mask rule description
- display_name str
- A filter to return only resources that match the entire display name given.
- Mapping[str, str]
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- iam_group_ strid 
- OCID of the IAM group
- id str
- Unique identifier that can't be changed after creation
- lifecyle_details str
- Additional details on the substate of the lifecycle state [DEPRECATE]
- state str
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- Mapping[str, str]
- System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
- target_selecteds Sequence[GetData Mask Rules Data Mask Rule Collection Item Target Selected] 
- Specification of how targets are to be selected (select ALL, or select by TargetResourceType or TargetId).
- time_created str
- The date and time the target was created. Format defined by RFC3339.
- time_updated str
- The date and time the target was updated. Format defined by RFC3339.
- compartmentId String
- The OCID of the compartment in which to list resources.
- dataMask List<String>Categories 
- List of data mask rule categories
- dataMask StringRule Status 
- The status of the data mask rule
- Map<String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
- description String
- The data mask rule description
- displayName String
- A filter to return only resources that match the entire display name given.
- Map<String>
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- iamGroup StringId 
- OCID of the IAM group
- id String
- Unique identifier that can't be changed after creation
- lifecyleDetails String
- Additional details on the substate of the lifecycle state [DEPRECATE]
- state String
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- Map<String>
- System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
- targetSelecteds List<Property Map>
- Specification of how targets are to be selected (select ALL, or select by TargetResourceType or TargetId).
- timeCreated String
- The date and time the target was created. Format defined by RFC3339.
- timeUpdated String
- The date and time the target was updated. Format defined by RFC3339.
GetDataMaskRulesDataMaskRuleCollectionItemTargetSelected          
GetDataMaskRulesFilter    
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.