1. Packages
  2. Azure Native
  3. API Docs
  4. sql
  5. DataMaskingPolicy
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.50.1 published on Tuesday, Jul 16, 2024 by Pulumi

azure-native.sql.DataMaskingPolicy

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.50.1 published on Tuesday, Jul 16, 2024 by Pulumi

    A database data masking policy. Azure REST API version: 2021-11-01. Prior API version in Azure Native 1.x: 2014-04-01.

    Other available API versions: 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview.

    Example Usage

    Create or update data masking policy max

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var dataMaskingPolicy = new AzureNative.Sql.DataMaskingPolicy("dataMaskingPolicy", new()
        {
            DataMaskingPolicyName = "Default",
            DataMaskingState = AzureNative.Sql.DataMaskingState.Enabled,
            DatabaseName = "sqlcrudtest-331",
            ExemptPrincipals = "testuser;",
            ResourceGroupName = "sqlcrudtest-6852",
            ServerName = "sqlcrudtest-2080",
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewDataMaskingPolicy(ctx, "dataMaskingPolicy", &sql.DataMaskingPolicyArgs{
    			DataMaskingPolicyName: pulumi.String("Default"),
    			DataMaskingState:      sql.DataMaskingStateEnabled,
    			DatabaseName:          pulumi.String("sqlcrudtest-331"),
    			ExemptPrincipals:      pulumi.String("testuser;"),
    			ResourceGroupName:     pulumi.String("sqlcrudtest-6852"),
    			ServerName:            pulumi.String("sqlcrudtest-2080"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.DataMaskingPolicy;
    import com.pulumi.azurenative.sql.DataMaskingPolicyArgs;
    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) {
            var dataMaskingPolicy = new DataMaskingPolicy("dataMaskingPolicy", DataMaskingPolicyArgs.builder()
                .dataMaskingPolicyName("Default")
                .dataMaskingState("Enabled")
                .databaseName("sqlcrudtest-331")
                .exemptPrincipals("testuser;")
                .resourceGroupName("sqlcrudtest-6852")
                .serverName("sqlcrudtest-2080")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    data_masking_policy = azure_native.sql.DataMaskingPolicy("dataMaskingPolicy",
        data_masking_policy_name="Default",
        data_masking_state=azure_native.sql.DataMaskingState.ENABLED,
        database_name="sqlcrudtest-331",
        exempt_principals="testuser;",
        resource_group_name="sqlcrudtest-6852",
        server_name="sqlcrudtest-2080")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const dataMaskingPolicy = new azure_native.sql.DataMaskingPolicy("dataMaskingPolicy", {
        dataMaskingPolicyName: "Default",
        dataMaskingState: azure_native.sql.DataMaskingState.Enabled,
        databaseName: "sqlcrudtest-331",
        exemptPrincipals: "testuser;",
        resourceGroupName: "sqlcrudtest-6852",
        serverName: "sqlcrudtest-2080",
    });
    
    resources:
      dataMaskingPolicy:
        type: azure-native:sql:DataMaskingPolicy
        properties:
          dataMaskingPolicyName: Default
          dataMaskingState: Enabled
          databaseName: sqlcrudtest-331
          exemptPrincipals: testuser;
          resourceGroupName: sqlcrudtest-6852
          serverName: sqlcrudtest-2080
    

    Create or update data masking policy min.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var dataMaskingPolicy = new AzureNative.Sql.DataMaskingPolicy("dataMaskingPolicy", new()
        {
            DataMaskingPolicyName = "Default",
            DataMaskingState = AzureNative.Sql.DataMaskingState.Enabled,
            DatabaseName = "sqlcrudtest-331",
            ResourceGroupName = "sqlcrudtest-6852",
            ServerName = "sqlcrudtest-2080",
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewDataMaskingPolicy(ctx, "dataMaskingPolicy", &sql.DataMaskingPolicyArgs{
    			DataMaskingPolicyName: pulumi.String("Default"),
    			DataMaskingState:      sql.DataMaskingStateEnabled,
    			DatabaseName:          pulumi.String("sqlcrudtest-331"),
    			ResourceGroupName:     pulumi.String("sqlcrudtest-6852"),
    			ServerName:            pulumi.String("sqlcrudtest-2080"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.DataMaskingPolicy;
    import com.pulumi.azurenative.sql.DataMaskingPolicyArgs;
    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) {
            var dataMaskingPolicy = new DataMaskingPolicy("dataMaskingPolicy", DataMaskingPolicyArgs.builder()
                .dataMaskingPolicyName("Default")
                .dataMaskingState("Enabled")
                .databaseName("sqlcrudtest-331")
                .resourceGroupName("sqlcrudtest-6852")
                .serverName("sqlcrudtest-2080")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    data_masking_policy = azure_native.sql.DataMaskingPolicy("dataMaskingPolicy",
        data_masking_policy_name="Default",
        data_masking_state=azure_native.sql.DataMaskingState.ENABLED,
        database_name="sqlcrudtest-331",
        resource_group_name="sqlcrudtest-6852",
        server_name="sqlcrudtest-2080")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const dataMaskingPolicy = new azure_native.sql.DataMaskingPolicy("dataMaskingPolicy", {
        dataMaskingPolicyName: "Default",
        dataMaskingState: azure_native.sql.DataMaskingState.Enabled,
        databaseName: "sqlcrudtest-331",
        resourceGroupName: "sqlcrudtest-6852",
        serverName: "sqlcrudtest-2080",
    });
    
    resources:
      dataMaskingPolicy:
        type: azure-native:sql:DataMaskingPolicy
        properties:
          dataMaskingPolicyName: Default
          dataMaskingState: Enabled
          databaseName: sqlcrudtest-331
          resourceGroupName: sqlcrudtest-6852
          serverName: sqlcrudtest-2080
    

    Create DataMaskingPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new DataMaskingPolicy(name: string, args: DataMaskingPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def DataMaskingPolicy(resource_name: str,
                          args: DataMaskingPolicyArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def DataMaskingPolicy(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          data_masking_state: Optional[DataMaskingState] = None,
                          database_name: Optional[str] = None,
                          resource_group_name: Optional[str] = None,
                          server_name: Optional[str] = None,
                          data_masking_policy_name: Optional[str] = None,
                          exempt_principals: Optional[str] = None)
    func NewDataMaskingPolicy(ctx *Context, name string, args DataMaskingPolicyArgs, opts ...ResourceOption) (*DataMaskingPolicy, error)
    public DataMaskingPolicy(string name, DataMaskingPolicyArgs args, CustomResourceOptions? opts = null)
    public DataMaskingPolicy(String name, DataMaskingPolicyArgs args)
    public DataMaskingPolicy(String name, DataMaskingPolicyArgs args, CustomResourceOptions options)
    
    type: azure-native:sql:DataMaskingPolicy
    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 DataMaskingPolicyArgs
    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 DataMaskingPolicyArgs
    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 DataMaskingPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DataMaskingPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DataMaskingPolicyArgs
    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 dataMaskingPolicyResource = new AzureNative.Sql.DataMaskingPolicy("dataMaskingPolicyResource", new()
    {
        DataMaskingState = AzureNative.Sql.DataMaskingState.Enabled,
        DatabaseName = "string",
        ResourceGroupName = "string",
        ServerName = "string",
        DataMaskingPolicyName = "string",
        ExemptPrincipals = "string",
    });
    
    example, err := sql.NewDataMaskingPolicy(ctx, "dataMaskingPolicyResource", &sql.DataMaskingPolicyArgs{
    	DataMaskingState:      sql.DataMaskingStateEnabled,
    	DatabaseName:          pulumi.String("string"),
    	ResourceGroupName:     pulumi.String("string"),
    	ServerName:            pulumi.String("string"),
    	DataMaskingPolicyName: pulumi.String("string"),
    	ExemptPrincipals:      pulumi.String("string"),
    })
    
    var dataMaskingPolicyResource = new DataMaskingPolicy("dataMaskingPolicyResource", DataMaskingPolicyArgs.builder()
        .dataMaskingState("Enabled")
        .databaseName("string")
        .resourceGroupName("string")
        .serverName("string")
        .dataMaskingPolicyName("string")
        .exemptPrincipals("string")
        .build());
    
    data_masking_policy_resource = azure_native.sql.DataMaskingPolicy("dataMaskingPolicyResource",
        data_masking_state=azure_native.sql.DataMaskingState.ENABLED,
        database_name="string",
        resource_group_name="string",
        server_name="string",
        data_masking_policy_name="string",
        exempt_principals="string")
    
    const dataMaskingPolicyResource = new azure_native.sql.DataMaskingPolicy("dataMaskingPolicyResource", {
        dataMaskingState: azure_native.sql.DataMaskingState.Enabled,
        databaseName: "string",
        resourceGroupName: "string",
        serverName: "string",
        dataMaskingPolicyName: "string",
        exemptPrincipals: "string",
    });
    
    type: azure-native:sql:DataMaskingPolicy
    properties:
        dataMaskingPolicyName: string
        dataMaskingState: Enabled
        databaseName: string
        exemptPrincipals: string
        resourceGroupName: string
        serverName: string
    

    DataMaskingPolicy 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 DataMaskingPolicy resource accepts the following input properties:

    DataMaskingState Pulumi.AzureNative.Sql.DataMaskingState
    The state of the data masking policy.
    DatabaseName string
    The name of the database.
    ResourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    ServerName string
    The name of the server.
    DataMaskingPolicyName string
    The name of the database for which the data masking policy applies.
    ExemptPrincipals string
    The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries.
    DataMaskingState DataMaskingState
    The state of the data masking policy.
    DatabaseName string
    The name of the database.
    ResourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    ServerName string
    The name of the server.
    DataMaskingPolicyName string
    The name of the database for which the data masking policy applies.
    ExemptPrincipals string
    The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries.
    dataMaskingState DataMaskingState
    The state of the data masking policy.
    databaseName String
    The name of the database.
    resourceGroupName String
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    serverName String
    The name of the server.
    dataMaskingPolicyName String
    The name of the database for which the data masking policy applies.
    exemptPrincipals String
    The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries.
    dataMaskingState DataMaskingState
    The state of the data masking policy.
    databaseName string
    The name of the database.
    resourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    serverName string
    The name of the server.
    dataMaskingPolicyName string
    The name of the database for which the data masking policy applies.
    exemptPrincipals string
    The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries.
    data_masking_state DataMaskingState
    The state of the data masking policy.
    database_name str
    The name of the database.
    resource_group_name str
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    server_name str
    The name of the server.
    data_masking_policy_name str
    The name of the database for which the data masking policy applies.
    exempt_principals str
    The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries.
    dataMaskingState "Enabled" | "Disabled"
    The state of the data masking policy.
    databaseName String
    The name of the database.
    resourceGroupName String
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    serverName String
    The name of the server.
    dataMaskingPolicyName String
    The name of the database for which the data masking policy applies.
    exemptPrincipals String
    The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DataMaskingPolicy resource produces the following output properties:

    ApplicationPrincipals string
    The list of the application principals. This is a legacy parameter and is no longer used.
    Id string
    The provider-assigned unique ID for this managed resource.
    Kind string
    The kind of Data Masking Policy. Metadata, used for Azure portal.
    Location string
    The location of the data masking policy.
    MaskingLevel string
    The masking level. This is a legacy parameter and is no longer used.
    Name string
    Resource name.
    Type string
    Resource type.
    ApplicationPrincipals string
    The list of the application principals. This is a legacy parameter and is no longer used.
    Id string
    The provider-assigned unique ID for this managed resource.
    Kind string
    The kind of Data Masking Policy. Metadata, used for Azure portal.
    Location string
    The location of the data masking policy.
    MaskingLevel string
    The masking level. This is a legacy parameter and is no longer used.
    Name string
    Resource name.
    Type string
    Resource type.
    applicationPrincipals String
    The list of the application principals. This is a legacy parameter and is no longer used.
    id String
    The provider-assigned unique ID for this managed resource.
    kind String
    The kind of Data Masking Policy. Metadata, used for Azure portal.
    location String
    The location of the data masking policy.
    maskingLevel String
    The masking level. This is a legacy parameter and is no longer used.
    name String
    Resource name.
    type String
    Resource type.
    applicationPrincipals string
    The list of the application principals. This is a legacy parameter and is no longer used.
    id string
    The provider-assigned unique ID for this managed resource.
    kind string
    The kind of Data Masking Policy. Metadata, used for Azure portal.
    location string
    The location of the data masking policy.
    maskingLevel string
    The masking level. This is a legacy parameter and is no longer used.
    name string
    Resource name.
    type string
    Resource type.
    application_principals str
    The list of the application principals. This is a legacy parameter and is no longer used.
    id str
    The provider-assigned unique ID for this managed resource.
    kind str
    The kind of Data Masking Policy. Metadata, used for Azure portal.
    location str
    The location of the data masking policy.
    masking_level str
    The masking level. This is a legacy parameter and is no longer used.
    name str
    Resource name.
    type str
    Resource type.
    applicationPrincipals String
    The list of the application principals. This is a legacy parameter and is no longer used.
    id String
    The provider-assigned unique ID for this managed resource.
    kind String
    The kind of Data Masking Policy. Metadata, used for Azure portal.
    location String
    The location of the data masking policy.
    maskingLevel String
    The masking level. This is a legacy parameter and is no longer used.
    name String
    Resource name.
    type String
    Resource type.

    Supporting Types

    DataMaskingState, DataMaskingStateArgs

    Enabled
    Enabled
    Disabled
    Disabled
    DataMaskingStateEnabled
    Enabled
    DataMaskingStateDisabled
    Disabled
    Enabled
    Enabled
    Disabled
    Disabled
    Enabled
    Enabled
    Disabled
    Disabled
    ENABLED
    Enabled
    DISABLED
    Disabled
    "Enabled"
    Enabled
    "Disabled"
    Disabled

    Import

    An existing resource can be imported using its type token, name, and identifier, e.g.

    $ pulumi import azure-native:sql:DataMaskingPolicy Default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName} 
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.50.1 published on Tuesday, Jul 16, 2024 by Pulumi