1. Packages
  2. Azure Classic
  3. API Docs
  4. mssql
  5. ManagedInstanceTransparentDataEncryption

We recommend using Azure Native.

Azure Classic v5.67.0 published on Wednesday, Feb 21, 2024 by Pulumi

azure.mssql.ManagedInstanceTransparentDataEncryption

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.67.0 published on Wednesday, Feb 21, 2024 by Pulumi

    Manages the transparent data encryption configuration for a MSSQL Managed Instance

    NOTE: Once transparent data encryption(TDE) is enabled on a MS SQL instance, it is not possible to remove TDE. You will be able to switch between ‘ServiceManaged’ and ‘CustomerManaged’ keys, but will not be able to remove encryption. For safety when this resource is deleted, the TDE mode will automatically be set to ‘ServiceManaged’. See key_vault_uri for more information on how to specify the key types. As SQL Managed Instance only supports a single configuration for encryption settings, this resource will replace the current encryption settings on the server.

    Note: See documentation for important information on how handle lifecycle management of the keys to prevent data lockout.

    Example Usage

    With Service Managed Key

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
        {
            Location = "EastUs",
        });
    
        var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new()
        {
            ResourceGroupName = exampleResourceGroup.Name,
            AddressSpaces = new[]
            {
                "10.0.0.0/16",
            },
            Location = azurerm_resource_group.Test.Location,
        });
    
        var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new()
        {
            ResourceGroupName = exampleResourceGroup.Name,
            VirtualNetworkName = exampleVirtualNetwork.Name,
            AddressPrefixes = new[]
            {
                "10.0.0.0/24",
            },
            Delegations = new[]
            {
                new Azure.Network.Inputs.SubnetDelegationArgs
                {
                    Name = "managedinstancedelegation",
                    ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs
                    {
                        Name = "Microsoft.Sql/managedInstances",
                        Actions = new[]
                        {
                            "Microsoft.Network/virtualNetworks/subnets/join/action",
                            "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action",
                            "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action",
                        },
                    },
                },
            },
        });
    
        var exampleManagedInstance = new Azure.MSSql.ManagedInstance("exampleManagedInstance", new()
        {
            ResourceGroupName = exampleResourceGroup.Name,
            Location = exampleResourceGroup.Location,
            LicenseType = "BasePrice",
            SkuName = "GP_Gen5",
            StorageSizeInGb = 32,
            SubnetId = exampleSubnet.Id,
            Vcores = 4,
            AdministratorLogin = "missadministrator",
            AdministratorLoginPassword = "NCC-1701-D",
            Identity = new Azure.MSSql.Inputs.ManagedInstanceIdentityArgs
            {
                Type = "SystemAssigned",
            },
        });
    
        var exampleManagedInstanceTransparentDataEncryption = new Azure.MSSql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", new()
        {
            ManagedInstanceId = exampleManagedInstance.Id,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
    			Location: pulumi.String("EastUs"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
    			ResourceGroupName: exampleResourceGroup.Name,
    			AddressSpaces: pulumi.StringArray{
    				pulumi.String("10.0.0.0/16"),
    			},
    			Location: pulumi.Any(azurerm_resource_group.Test.Location),
    		})
    		if err != nil {
    			return err
    		}
    		exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{
    			ResourceGroupName:  exampleResourceGroup.Name,
    			VirtualNetworkName: exampleVirtualNetwork.Name,
    			AddressPrefixes: pulumi.StringArray{
    				pulumi.String("10.0.0.0/24"),
    			},
    			Delegations: network.SubnetDelegationArray{
    				&network.SubnetDelegationArgs{
    					Name: pulumi.String("managedinstancedelegation"),
    					ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{
    						Name: pulumi.String("Microsoft.Sql/managedInstances"),
    						Actions: pulumi.StringArray{
    							pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"),
    							pulumi.String("Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action"),
    							pulumi.String("Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action"),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleManagedInstance, err := mssql.NewManagedInstance(ctx, "exampleManagedInstance", &mssql.ManagedInstanceArgs{
    			ResourceGroupName:          exampleResourceGroup.Name,
    			Location:                   exampleResourceGroup.Location,
    			LicenseType:                pulumi.String("BasePrice"),
    			SkuName:                    pulumi.String("GP_Gen5"),
    			StorageSizeInGb:            pulumi.Int(32),
    			SubnetId:                   exampleSubnet.ID(),
    			Vcores:                     pulumi.Int(4),
    			AdministratorLogin:         pulumi.String("missadministrator"),
    			AdministratorLoginPassword: pulumi.String("NCC-1701-D"),
    			Identity: &mssql.ManagedInstanceIdentityArgs{
    				Type: pulumi.String("SystemAssigned"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = mssql.NewManagedInstanceTransparentDataEncryption(ctx, "exampleManagedInstanceTransparentDataEncryption", &mssql.ManagedInstanceTransparentDataEncryptionArgs{
    			ManagedInstanceId: exampleManagedInstance.ID(),
    		})
    		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.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.network.VirtualNetwork;
    import com.pulumi.azure.network.VirtualNetworkArgs;
    import com.pulumi.azure.network.Subnet;
    import com.pulumi.azure.network.SubnetArgs;
    import com.pulumi.azure.network.inputs.SubnetDelegationArgs;
    import com.pulumi.azure.network.inputs.SubnetDelegationServiceDelegationArgs;
    import com.pulumi.azure.mssql.ManagedInstance;
    import com.pulumi.azure.mssql.ManagedInstanceArgs;
    import com.pulumi.azure.mssql.inputs.ManagedInstanceIdentityArgs;
    import com.pulumi.azure.mssql.ManagedInstanceTransparentDataEncryption;
    import com.pulumi.azure.mssql.ManagedInstanceTransparentDataEncryptionArgs;
    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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
                .location("EastUs")
                .build());
    
            var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()        
                .resourceGroupName(exampleResourceGroup.name())
                .addressSpaces("10.0.0.0/16")
                .location(azurerm_resource_group.test().location())
                .build());
    
            var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()        
                .resourceGroupName(exampleResourceGroup.name())
                .virtualNetworkName(exampleVirtualNetwork.name())
                .addressPrefixes("10.0.0.0/24")
                .delegations(SubnetDelegationArgs.builder()
                    .name("managedinstancedelegation")
                    .serviceDelegation(SubnetDelegationServiceDelegationArgs.builder()
                        .name("Microsoft.Sql/managedInstances")
                        .actions(                    
                            "Microsoft.Network/virtualNetworks/subnets/join/action",
                            "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action",
                            "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action")
                        .build())
                    .build())
                .build());
    
            var exampleManagedInstance = new ManagedInstance("exampleManagedInstance", ManagedInstanceArgs.builder()        
                .resourceGroupName(exampleResourceGroup.name())
                .location(exampleResourceGroup.location())
                .licenseType("BasePrice")
                .skuName("GP_Gen5")
                .storageSizeInGb(32)
                .subnetId(exampleSubnet.id())
                .vcores(4)
                .administratorLogin("missadministrator")
                .administratorLoginPassword("NCC-1701-D")
                .identity(ManagedInstanceIdentityArgs.builder()
                    .type("SystemAssigned")
                    .build())
                .build());
    
            var exampleManagedInstanceTransparentDataEncryption = new ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", ManagedInstanceTransparentDataEncryptionArgs.builder()        
                .managedInstanceId(exampleManagedInstance.id())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure as azure
    
    example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="EastUs")
    example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
        resource_group_name=example_resource_group.name,
        address_spaces=["10.0.0.0/16"],
        location=azurerm_resource_group["test"]["location"])
    example_subnet = azure.network.Subnet("exampleSubnet",
        resource_group_name=example_resource_group.name,
        virtual_network_name=example_virtual_network.name,
        address_prefixes=["10.0.0.0/24"],
        delegations=[azure.network.SubnetDelegationArgs(
            name="managedinstancedelegation",
            service_delegation=azure.network.SubnetDelegationServiceDelegationArgs(
                name="Microsoft.Sql/managedInstances",
                actions=[
                    "Microsoft.Network/virtualNetworks/subnets/join/action",
                    "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action",
                    "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action",
                ],
            ),
        )])
    example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance",
        resource_group_name=example_resource_group.name,
        location=example_resource_group.location,
        license_type="BasePrice",
        sku_name="GP_Gen5",
        storage_size_in_gb=32,
        subnet_id=example_subnet.id,
        vcores=4,
        administrator_login="missadministrator",
        administrator_login_password="NCC-1701-D",
        identity=azure.mssql.ManagedInstanceIdentityArgs(
            type="SystemAssigned",
        ))
    example_managed_instance_transparent_data_encryption = azure.mssql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", managed_instance_id=example_managed_instance.id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "EastUs"});
    const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
        resourceGroupName: exampleResourceGroup.name,
        addressSpaces: ["10.0.0.0/16"],
        location: azurerm_resource_group.test.location,
    });
    const exampleSubnet = new azure.network.Subnet("exampleSubnet", {
        resourceGroupName: exampleResourceGroup.name,
        virtualNetworkName: exampleVirtualNetwork.name,
        addressPrefixes: ["10.0.0.0/24"],
        delegations: [{
            name: "managedinstancedelegation",
            serviceDelegation: {
                name: "Microsoft.Sql/managedInstances",
                actions: [
                    "Microsoft.Network/virtualNetworks/subnets/join/action",
                    "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action",
                    "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action",
                ],
            },
        }],
    });
    const exampleManagedInstance = new azure.mssql.ManagedInstance("exampleManagedInstance", {
        resourceGroupName: exampleResourceGroup.name,
        location: exampleResourceGroup.location,
        licenseType: "BasePrice",
        skuName: "GP_Gen5",
        storageSizeInGb: 32,
        subnetId: exampleSubnet.id,
        vcores: 4,
        administratorLogin: "missadministrator",
        administratorLoginPassword: "NCC-1701-D",
        identity: {
            type: "SystemAssigned",
        },
    });
    const exampleManagedInstanceTransparentDataEncryption = new azure.mssql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", {managedInstanceId: exampleManagedInstance.id});
    
    resources:
      exampleResourceGroup:
        type: azure:core:ResourceGroup
        properties:
          location: EastUs
      exampleVirtualNetwork:
        type: azure:network:VirtualNetwork
        properties:
          resourceGroupName: ${exampleResourceGroup.name}
          addressSpaces:
            - 10.0.0.0/16
          location: ${azurerm_resource_group.test.location}
      exampleSubnet:
        type: azure:network:Subnet
        properties:
          resourceGroupName: ${exampleResourceGroup.name}
          virtualNetworkName: ${exampleVirtualNetwork.name}
          addressPrefixes:
            - 10.0.0.0/24
          delegations:
            - name: managedinstancedelegation
              serviceDelegation:
                name: Microsoft.Sql/managedInstances
                actions:
                  - Microsoft.Network/virtualNetworks/subnets/join/action
                  - Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action
                  - Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action
      exampleManagedInstance:
        type: azure:mssql:ManagedInstance
        properties:
          resourceGroupName: ${exampleResourceGroup.name}
          location: ${exampleResourceGroup.location}
          licenseType: BasePrice
          skuName: GP_Gen5
          storageSizeInGb: 32
          subnetId: ${exampleSubnet.id}
          vcores: 4
          administratorLogin: missadministrator
          administratorLoginPassword: NCC-1701-D
          identity:
            type: SystemAssigned
      exampleManagedInstanceTransparentDataEncryption:
        type: azure:mssql:ManagedInstanceTransparentDataEncryption
        properties:
          managedInstanceId: ${exampleManagedInstance.id}
    

    With Customer Managed Key

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var current = Azure.Core.GetClientConfig.Invoke();
    
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
        {
            Location = "EastUs",
        });
    
        var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new()
        {
            ResourceGroupName = exampleResourceGroup.Name,
            AddressSpaces = new[]
            {
                "10.0.0.0/16",
            },
            Location = azurerm_resource_group.Test.Location,
        });
    
        var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new()
        {
            ResourceGroupName = exampleResourceGroup.Name,
            VirtualNetworkName = exampleVirtualNetwork.Name,
            AddressPrefixes = new[]
            {
                "10.0.0.0/24",
            },
            Delegations = new[]
            {
                new Azure.Network.Inputs.SubnetDelegationArgs
                {
                    Name = "managedinstancedelegation",
                    ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs
                    {
                        Name = "Microsoft.Sql/managedInstances",
                        Actions = new[]
                        {
                            "Microsoft.Network/virtualNetworks/subnets/join/action",
                            "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action",
                            "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action",
                        },
                    },
                },
            },
        });
    
        var exampleManagedInstance = new Azure.MSSql.ManagedInstance("exampleManagedInstance", new()
        {
            ResourceGroupName = exampleResourceGroup.Name,
            Location = exampleResourceGroup.Location,
            LicenseType = "BasePrice",
            SkuName = "GP_Gen5",
            StorageSizeInGb = 32,
            SubnetId = exampleSubnet.Id,
            Vcores = 4,
            AdministratorLogin = "missadministrator",
            AdministratorLoginPassword = "NCC-1701-D",
            Identity = new Azure.MSSql.Inputs.ManagedInstanceIdentityArgs
            {
                Type = "SystemAssigned",
            },
        });
    
        // Create a key vault with policies for the deployer to create a key & SQL Managed Instance to wrap/unwrap/get key
        var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new()
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            EnabledForDiskEncryption = true,
            TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
            SoftDeleteRetentionDays = 7,
            PurgeProtectionEnabled = false,
            SkuName = "standard",
            AccessPolicies = new[]
            {
                new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs
                {
                    TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
                    ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId),
                    KeyPermissions = new[]
                    {
                        "Get",
                        "List",
                        "Create",
                        "Delete",
                        "Update",
                        "Recover",
                        "Purge",
                        "GetRotationPolicy",
                    },
                },
                new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs
                {
                    TenantId = exampleManagedInstance.Identity.Apply(identity => identity?.TenantId),
                    ObjectId = exampleManagedInstance.Identity.Apply(identity => identity?.PrincipalId),
                    KeyPermissions = new[]
                    {
                        "Get",
                        "WrapKey",
                        "UnwrapKey",
                    },
                },
            },
        });
    
        var exampleKey = new Azure.KeyVault.Key("exampleKey", new()
        {
            KeyVaultId = exampleKeyVault.Id,
            KeyType = "RSA",
            KeySize = 2048,
            KeyOpts = new[]
            {
                "unwrapKey",
                "wrapKey",
            },
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                exampleKeyVault,
            },
        });
    
        var exampleManagedInstanceTransparentDataEncryption = new Azure.MSSql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", new()
        {
            ManagedInstanceId = exampleManagedInstance.Id,
            KeyVaultKeyId = exampleKey.Id,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		current, err := core.GetClientConfig(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
    			Location: pulumi.String("EastUs"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
    			ResourceGroupName: exampleResourceGroup.Name,
    			AddressSpaces: pulumi.StringArray{
    				pulumi.String("10.0.0.0/16"),
    			},
    			Location: pulumi.Any(azurerm_resource_group.Test.Location),
    		})
    		if err != nil {
    			return err
    		}
    		exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{
    			ResourceGroupName:  exampleResourceGroup.Name,
    			VirtualNetworkName: exampleVirtualNetwork.Name,
    			AddressPrefixes: pulumi.StringArray{
    				pulumi.String("10.0.0.0/24"),
    			},
    			Delegations: network.SubnetDelegationArray{
    				&network.SubnetDelegationArgs{
    					Name: pulumi.String("managedinstancedelegation"),
    					ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{
    						Name: pulumi.String("Microsoft.Sql/managedInstances"),
    						Actions: pulumi.StringArray{
    							pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"),
    							pulumi.String("Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action"),
    							pulumi.String("Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action"),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleManagedInstance, err := mssql.NewManagedInstance(ctx, "exampleManagedInstance", &mssql.ManagedInstanceArgs{
    			ResourceGroupName:          exampleResourceGroup.Name,
    			Location:                   exampleResourceGroup.Location,
    			LicenseType:                pulumi.String("BasePrice"),
    			SkuName:                    pulumi.String("GP_Gen5"),
    			StorageSizeInGb:            pulumi.Int(32),
    			SubnetId:                   exampleSubnet.ID(),
    			Vcores:                     pulumi.Int(4),
    			AdministratorLogin:         pulumi.String("missadministrator"),
    			AdministratorLoginPassword: pulumi.String("NCC-1701-D"),
    			Identity: &mssql.ManagedInstanceIdentityArgs{
    				Type: pulumi.String("SystemAssigned"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{
    			Location:                 exampleResourceGroup.Location,
    			ResourceGroupName:        exampleResourceGroup.Name,
    			EnabledForDiskEncryption: pulumi.Bool(true),
    			TenantId:                 *pulumi.String(current.TenantId),
    			SoftDeleteRetentionDays:  pulumi.Int(7),
    			PurgeProtectionEnabled:   pulumi.Bool(false),
    			SkuName:                  pulumi.String("standard"),
    			AccessPolicies: keyvault.KeyVaultAccessPolicyArray{
    				&keyvault.KeyVaultAccessPolicyArgs{
    					TenantId: *pulumi.String(current.TenantId),
    					ObjectId: *pulumi.String(current.ObjectId),
    					KeyPermissions: pulumi.StringArray{
    						pulumi.String("Get"),
    						pulumi.String("List"),
    						pulumi.String("Create"),
    						pulumi.String("Delete"),
    						pulumi.String("Update"),
    						pulumi.String("Recover"),
    						pulumi.String("Purge"),
    						pulumi.String("GetRotationPolicy"),
    					},
    				},
    				&keyvault.KeyVaultAccessPolicyArgs{
    					TenantId: exampleManagedInstance.Identity.ApplyT(func(identity mssql.ManagedInstanceIdentity) (*string, error) {
    						return &identity.TenantId, nil
    					}).(pulumi.StringPtrOutput),
    					ObjectId: exampleManagedInstance.Identity.ApplyT(func(identity mssql.ManagedInstanceIdentity) (*string, error) {
    						return &identity.PrincipalId, nil
    					}).(pulumi.StringPtrOutput),
    					KeyPermissions: pulumi.StringArray{
    						pulumi.String("Get"),
    						pulumi.String("WrapKey"),
    						pulumi.String("UnwrapKey"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{
    			KeyVaultId: exampleKeyVault.ID(),
    			KeyType:    pulumi.String("RSA"),
    			KeySize:    pulumi.Int(2048),
    			KeyOpts: pulumi.StringArray{
    				pulumi.String("unwrapKey"),
    				pulumi.String("wrapKey"),
    			},
    		}, pulumi.DependsOn([]pulumi.Resource{
    			exampleKeyVault,
    		}))
    		if err != nil {
    			return err
    		}
    		_, err = mssql.NewManagedInstanceTransparentDataEncryption(ctx, "exampleManagedInstanceTransparentDataEncryption", &mssql.ManagedInstanceTransparentDataEncryptionArgs{
    			ManagedInstanceId: exampleManagedInstance.ID(),
    			KeyVaultKeyId:     exampleKey.ID(),
    		})
    		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.azure.core.CoreFunctions;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.network.VirtualNetwork;
    import com.pulumi.azure.network.VirtualNetworkArgs;
    import com.pulumi.azure.network.Subnet;
    import com.pulumi.azure.network.SubnetArgs;
    import com.pulumi.azure.network.inputs.SubnetDelegationArgs;
    import com.pulumi.azure.network.inputs.SubnetDelegationServiceDelegationArgs;
    import com.pulumi.azure.mssql.ManagedInstance;
    import com.pulumi.azure.mssql.ManagedInstanceArgs;
    import com.pulumi.azure.mssql.inputs.ManagedInstanceIdentityArgs;
    import com.pulumi.azure.keyvault.KeyVault;
    import com.pulumi.azure.keyvault.KeyVaultArgs;
    import com.pulumi.azure.keyvault.inputs.KeyVaultAccessPolicyArgs;
    import com.pulumi.azure.keyvault.Key;
    import com.pulumi.azure.keyvault.KeyArgs;
    import com.pulumi.azure.mssql.ManagedInstanceTransparentDataEncryption;
    import com.pulumi.azure.mssql.ManagedInstanceTransparentDataEncryptionArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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 current = CoreFunctions.getClientConfig();
    
            var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
                .location("EastUs")
                .build());
    
            var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()        
                .resourceGroupName(exampleResourceGroup.name())
                .addressSpaces("10.0.0.0/16")
                .location(azurerm_resource_group.test().location())
                .build());
    
            var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()        
                .resourceGroupName(exampleResourceGroup.name())
                .virtualNetworkName(exampleVirtualNetwork.name())
                .addressPrefixes("10.0.0.0/24")
                .delegations(SubnetDelegationArgs.builder()
                    .name("managedinstancedelegation")
                    .serviceDelegation(SubnetDelegationServiceDelegationArgs.builder()
                        .name("Microsoft.Sql/managedInstances")
                        .actions(                    
                            "Microsoft.Network/virtualNetworks/subnets/join/action",
                            "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action",
                            "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action")
                        .build())
                    .build())
                .build());
    
            var exampleManagedInstance = new ManagedInstance("exampleManagedInstance", ManagedInstanceArgs.builder()        
                .resourceGroupName(exampleResourceGroup.name())
                .location(exampleResourceGroup.location())
                .licenseType("BasePrice")
                .skuName("GP_Gen5")
                .storageSizeInGb(32)
                .subnetId(exampleSubnet.id())
                .vcores(4)
                .administratorLogin("missadministrator")
                .administratorLoginPassword("NCC-1701-D")
                .identity(ManagedInstanceIdentityArgs.builder()
                    .type("SystemAssigned")
                    .build())
                .build());
    
            var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()        
                .location(exampleResourceGroup.location())
                .resourceGroupName(exampleResourceGroup.name())
                .enabledForDiskEncryption(true)
                .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
                .softDeleteRetentionDays(7)
                .purgeProtectionEnabled(false)
                .skuName("standard")
                .accessPolicies(            
                    KeyVaultAccessPolicyArgs.builder()
                        .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
                        .objectId(current.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
                        .keyPermissions(                    
                            "Get",
                            "List",
                            "Create",
                            "Delete",
                            "Update",
                            "Recover",
                            "Purge",
                            "GetRotationPolicy")
                        .build(),
                    KeyVaultAccessPolicyArgs.builder()
                        .tenantId(exampleManagedInstance.identity().applyValue(identity -> identity.tenantId()))
                        .objectId(exampleManagedInstance.identity().applyValue(identity -> identity.principalId()))
                        .keyPermissions(                    
                            "Get",
                            "WrapKey",
                            "UnwrapKey")
                        .build())
                .build());
    
            var exampleKey = new Key("exampleKey", KeyArgs.builder()        
                .keyVaultId(exampleKeyVault.id())
                .keyType("RSA")
                .keySize(2048)
                .keyOpts(            
                    "unwrapKey",
                    "wrapKey")
                .build(), CustomResourceOptions.builder()
                    .dependsOn(exampleKeyVault)
                    .build());
    
            var exampleManagedInstanceTransparentDataEncryption = new ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", ManagedInstanceTransparentDataEncryptionArgs.builder()        
                .managedInstanceId(exampleManagedInstance.id())
                .keyVaultKeyId(exampleKey.id())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure as azure
    
    current = azure.core.get_client_config()
    example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="EastUs")
    example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
        resource_group_name=example_resource_group.name,
        address_spaces=["10.0.0.0/16"],
        location=azurerm_resource_group["test"]["location"])
    example_subnet = azure.network.Subnet("exampleSubnet",
        resource_group_name=example_resource_group.name,
        virtual_network_name=example_virtual_network.name,
        address_prefixes=["10.0.0.0/24"],
        delegations=[azure.network.SubnetDelegationArgs(
            name="managedinstancedelegation",
            service_delegation=azure.network.SubnetDelegationServiceDelegationArgs(
                name="Microsoft.Sql/managedInstances",
                actions=[
                    "Microsoft.Network/virtualNetworks/subnets/join/action",
                    "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action",
                    "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action",
                ],
            ),
        )])
    example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance",
        resource_group_name=example_resource_group.name,
        location=example_resource_group.location,
        license_type="BasePrice",
        sku_name="GP_Gen5",
        storage_size_in_gb=32,
        subnet_id=example_subnet.id,
        vcores=4,
        administrator_login="missadministrator",
        administrator_login_password="NCC-1701-D",
        identity=azure.mssql.ManagedInstanceIdentityArgs(
            type="SystemAssigned",
        ))
    # Create a key vault with policies for the deployer to create a key & SQL Managed Instance to wrap/unwrap/get key
    example_key_vault = azure.keyvault.KeyVault("exampleKeyVault",
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name,
        enabled_for_disk_encryption=True,
        tenant_id=current.tenant_id,
        soft_delete_retention_days=7,
        purge_protection_enabled=False,
        sku_name="standard",
        access_policies=[
            azure.keyvault.KeyVaultAccessPolicyArgs(
                tenant_id=current.tenant_id,
                object_id=current.object_id,
                key_permissions=[
                    "Get",
                    "List",
                    "Create",
                    "Delete",
                    "Update",
                    "Recover",
                    "Purge",
                    "GetRotationPolicy",
                ],
            ),
            azure.keyvault.KeyVaultAccessPolicyArgs(
                tenant_id=example_managed_instance.identity.tenant_id,
                object_id=example_managed_instance.identity.principal_id,
                key_permissions=[
                    "Get",
                    "WrapKey",
                    "UnwrapKey",
                ],
            ),
        ])
    example_key = azure.keyvault.Key("exampleKey",
        key_vault_id=example_key_vault.id,
        key_type="RSA",
        key_size=2048,
        key_opts=[
            "unwrapKey",
            "wrapKey",
        ],
        opts=pulumi.ResourceOptions(depends_on=[example_key_vault]))
    example_managed_instance_transparent_data_encryption = azure.mssql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption",
        managed_instance_id=example_managed_instance.id,
        key_vault_key_id=example_key.id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const current = azure.core.getClientConfig({});
    const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "EastUs"});
    const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
        resourceGroupName: exampleResourceGroup.name,
        addressSpaces: ["10.0.0.0/16"],
        location: azurerm_resource_group.test.location,
    });
    const exampleSubnet = new azure.network.Subnet("exampleSubnet", {
        resourceGroupName: exampleResourceGroup.name,
        virtualNetworkName: exampleVirtualNetwork.name,
        addressPrefixes: ["10.0.0.0/24"],
        delegations: [{
            name: "managedinstancedelegation",
            serviceDelegation: {
                name: "Microsoft.Sql/managedInstances",
                actions: [
                    "Microsoft.Network/virtualNetworks/subnets/join/action",
                    "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action",
                    "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action",
                ],
            },
        }],
    });
    const exampleManagedInstance = new azure.mssql.ManagedInstance("exampleManagedInstance", {
        resourceGroupName: exampleResourceGroup.name,
        location: exampleResourceGroup.location,
        licenseType: "BasePrice",
        skuName: "GP_Gen5",
        storageSizeInGb: 32,
        subnetId: exampleSubnet.id,
        vcores: 4,
        administratorLogin: "missadministrator",
        administratorLoginPassword: "NCC-1701-D",
        identity: {
            type: "SystemAssigned",
        },
    });
    // Create a key vault with policies for the deployer to create a key & SQL Managed Instance to wrap/unwrap/get key
    const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", {
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        enabledForDiskEncryption: true,
        tenantId: current.then(current => current.tenantId),
        softDeleteRetentionDays: 7,
        purgeProtectionEnabled: false,
        skuName: "standard",
        accessPolicies: [
            {
                tenantId: current.then(current => current.tenantId),
                objectId: current.then(current => current.objectId),
                keyPermissions: [
                    "Get",
                    "List",
                    "Create",
                    "Delete",
                    "Update",
                    "Recover",
                    "Purge",
                    "GetRotationPolicy",
                ],
            },
            {
                tenantId: exampleManagedInstance.identity.apply(identity => identity?.tenantId),
                objectId: exampleManagedInstance.identity.apply(identity => identity?.principalId),
                keyPermissions: [
                    "Get",
                    "WrapKey",
                    "UnwrapKey",
                ],
            },
        ],
    });
    const exampleKey = new azure.keyvault.Key("exampleKey", {
        keyVaultId: exampleKeyVault.id,
        keyType: "RSA",
        keySize: 2048,
        keyOpts: [
            "unwrapKey",
            "wrapKey",
        ],
    }, {
        dependsOn: [exampleKeyVault],
    });
    const exampleManagedInstanceTransparentDataEncryption = new azure.mssql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", {
        managedInstanceId: exampleManagedInstance.id,
        keyVaultKeyId: exampleKey.id,
    });
    
    resources:
      exampleResourceGroup:
        type: azure:core:ResourceGroup
        properties:
          location: EastUs
      exampleVirtualNetwork:
        type: azure:network:VirtualNetwork
        properties:
          resourceGroupName: ${exampleResourceGroup.name}
          addressSpaces:
            - 10.0.0.0/16
          location: ${azurerm_resource_group.test.location}
      exampleSubnet:
        type: azure:network:Subnet
        properties:
          resourceGroupName: ${exampleResourceGroup.name}
          virtualNetworkName: ${exampleVirtualNetwork.name}
          addressPrefixes:
            - 10.0.0.0/24
          delegations:
            - name: managedinstancedelegation
              serviceDelegation:
                name: Microsoft.Sql/managedInstances
                actions:
                  - Microsoft.Network/virtualNetworks/subnets/join/action
                  - Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action
                  - Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action
      exampleManagedInstance:
        type: azure:mssql:ManagedInstance
        properties:
          resourceGroupName: ${exampleResourceGroup.name}
          location: ${exampleResourceGroup.location}
          licenseType: BasePrice
          skuName: GP_Gen5
          storageSizeInGb: 32
          subnetId: ${exampleSubnet.id}
          vcores: 4
          administratorLogin: missadministrator
          administratorLoginPassword: NCC-1701-D
          identity:
            type: SystemAssigned
      # Create a key vault with policies for the deployer to create a key & SQL Managed Instance to wrap/unwrap/get key
      exampleKeyVault:
        type: azure:keyvault:KeyVault
        properties:
          location: ${exampleResourceGroup.location}
          resourceGroupName: ${exampleResourceGroup.name}
          enabledForDiskEncryption: true
          tenantId: ${current.tenantId}
          softDeleteRetentionDays: 7
          purgeProtectionEnabled: false
          skuName: standard
          accessPolicies:
            - tenantId: ${current.tenantId}
              objectId: ${current.objectId}
              keyPermissions:
                - Get
                - List
                - Create
                - Delete
                - Update
                - Recover
                - Purge
                - GetRotationPolicy
            - tenantId: ${exampleManagedInstance.identity.tenantId}
              objectId: ${exampleManagedInstance.identity.principalId}
              keyPermissions:
                - Get
                - WrapKey
                - UnwrapKey
      exampleKey:
        type: azure:keyvault:Key
        properties:
          keyVaultId: ${exampleKeyVault.id}
          keyType: RSA
          keySize: 2048
          keyOpts:
            - unwrapKey
            - wrapKey
        options:
          dependson:
            - ${exampleKeyVault}
      exampleManagedInstanceTransparentDataEncryption:
        type: azure:mssql:ManagedInstanceTransparentDataEncryption
        properties:
          managedInstanceId: ${exampleManagedInstance.id}
          keyVaultKeyId: ${exampleKey.id}
    variables:
      current:
        fn::invoke:
          Function: azure:core:getClientConfig
          Arguments: {}
    

    Create ManagedInstanceTransparentDataEncryption Resource

    new ManagedInstanceTransparentDataEncryption(name: string, args: ManagedInstanceTransparentDataEncryptionArgs, opts?: CustomResourceOptions);
    @overload
    def ManagedInstanceTransparentDataEncryption(resource_name: str,
                                                 opts: Optional[ResourceOptions] = None,
                                                 auto_rotation_enabled: Optional[bool] = None,
                                                 key_vault_key_id: Optional[str] = None,
                                                 managed_instance_id: Optional[str] = None)
    @overload
    def ManagedInstanceTransparentDataEncryption(resource_name: str,
                                                 args: ManagedInstanceTransparentDataEncryptionArgs,
                                                 opts: Optional[ResourceOptions] = None)
    func NewManagedInstanceTransparentDataEncryption(ctx *Context, name string, args ManagedInstanceTransparentDataEncryptionArgs, opts ...ResourceOption) (*ManagedInstanceTransparentDataEncryption, error)
    public ManagedInstanceTransparentDataEncryption(string name, ManagedInstanceTransparentDataEncryptionArgs args, CustomResourceOptions? opts = null)
    public ManagedInstanceTransparentDataEncryption(String name, ManagedInstanceTransparentDataEncryptionArgs args)
    public ManagedInstanceTransparentDataEncryption(String name, ManagedInstanceTransparentDataEncryptionArgs args, CustomResourceOptions options)
    
    type: azure:mssql:ManagedInstanceTransparentDataEncryption
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ManagedInstanceTransparentDataEncryptionArgs
    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 ManagedInstanceTransparentDataEncryptionArgs
    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 ManagedInstanceTransparentDataEncryptionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ManagedInstanceTransparentDataEncryptionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ManagedInstanceTransparentDataEncryptionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    ManagedInstanceId string
    Specifies the name of the MS SQL Managed Instance. Changing this forces a new resource to be created.
    AutoRotationEnabled bool
    When enabled, the SQL Managed Instance will continuously check the key vault for any new versions of the key being used as the TDE protector. If a new version of the key is detected, the TDE protector on the SQL Managed Instance will be automatically rotated to the latest key version within 60 minutes.
    KeyVaultKeyId string

    To use customer managed keys from Azure Key Vault, provide the AKV Key ID. To use service managed keys, omit this field.

    NOTE: In order to use customer managed keys, the identity of the MSSQL Managed Instance must have the following permissions on the key vault: 'get', 'wrapKey' and 'unwrapKey'

    NOTE: If managed_instance_id denotes a secondary instance deployed for disaster recovery purposes, then the key_vault_key_id should be the same key used for the primary instance's transparent data encryption. Both primary and secondary instances should be encrypted with same key material.

    ManagedInstanceId string
    Specifies the name of the MS SQL Managed Instance. Changing this forces a new resource to be created.
    AutoRotationEnabled bool
    When enabled, the SQL Managed Instance will continuously check the key vault for any new versions of the key being used as the TDE protector. If a new version of the key is detected, the TDE protector on the SQL Managed Instance will be automatically rotated to the latest key version within 60 minutes.
    KeyVaultKeyId string

    To use customer managed keys from Azure Key Vault, provide the AKV Key ID. To use service managed keys, omit this field.

    NOTE: In order to use customer managed keys, the identity of the MSSQL Managed Instance must have the following permissions on the key vault: 'get', 'wrapKey' and 'unwrapKey'

    NOTE: If managed_instance_id denotes a secondary instance deployed for disaster recovery purposes, then the key_vault_key_id should be the same key used for the primary instance's transparent data encryption. Both primary and secondary instances should be encrypted with same key material.

    managedInstanceId String
    Specifies the name of the MS SQL Managed Instance. Changing this forces a new resource to be created.
    autoRotationEnabled Boolean
    When enabled, the SQL Managed Instance will continuously check the key vault for any new versions of the key being used as the TDE protector. If a new version of the key is detected, the TDE protector on the SQL Managed Instance will be automatically rotated to the latest key version within 60 minutes.
    keyVaultKeyId String

    To use customer managed keys from Azure Key Vault, provide the AKV Key ID. To use service managed keys, omit this field.

    NOTE: In order to use customer managed keys, the identity of the MSSQL Managed Instance must have the following permissions on the key vault: 'get', 'wrapKey' and 'unwrapKey'

    NOTE: If managed_instance_id denotes a secondary instance deployed for disaster recovery purposes, then the key_vault_key_id should be the same key used for the primary instance's transparent data encryption. Both primary and secondary instances should be encrypted with same key material.

    managedInstanceId string
    Specifies the name of the MS SQL Managed Instance. Changing this forces a new resource to be created.
    autoRotationEnabled boolean
    When enabled, the SQL Managed Instance will continuously check the key vault for any new versions of the key being used as the TDE protector. If a new version of the key is detected, the TDE protector on the SQL Managed Instance will be automatically rotated to the latest key version within 60 minutes.
    keyVaultKeyId string

    To use customer managed keys from Azure Key Vault, provide the AKV Key ID. To use service managed keys, omit this field.

    NOTE: In order to use customer managed keys, the identity of the MSSQL Managed Instance must have the following permissions on the key vault: 'get', 'wrapKey' and 'unwrapKey'

    NOTE: If managed_instance_id denotes a secondary instance deployed for disaster recovery purposes, then the key_vault_key_id should be the same key used for the primary instance's transparent data encryption. Both primary and secondary instances should be encrypted with same key material.

    managed_instance_id str
    Specifies the name of the MS SQL Managed Instance. Changing this forces a new resource to be created.
    auto_rotation_enabled bool
    When enabled, the SQL Managed Instance will continuously check the key vault for any new versions of the key being used as the TDE protector. If a new version of the key is detected, the TDE protector on the SQL Managed Instance will be automatically rotated to the latest key version within 60 minutes.
    key_vault_key_id str

    To use customer managed keys from Azure Key Vault, provide the AKV Key ID. To use service managed keys, omit this field.

    NOTE: In order to use customer managed keys, the identity of the MSSQL Managed Instance must have the following permissions on the key vault: 'get', 'wrapKey' and 'unwrapKey'

    NOTE: If managed_instance_id denotes a secondary instance deployed for disaster recovery purposes, then the key_vault_key_id should be the same key used for the primary instance's transparent data encryption. Both primary and secondary instances should be encrypted with same key material.

    managedInstanceId String
    Specifies the name of the MS SQL Managed Instance. Changing this forces a new resource to be created.
    autoRotationEnabled Boolean
    When enabled, the SQL Managed Instance will continuously check the key vault for any new versions of the key being used as the TDE protector. If a new version of the key is detected, the TDE protector on the SQL Managed Instance will be automatically rotated to the latest key version within 60 minutes.
    keyVaultKeyId String

    To use customer managed keys from Azure Key Vault, provide the AKV Key ID. To use service managed keys, omit this field.

    NOTE: In order to use customer managed keys, the identity of the MSSQL Managed Instance must have the following permissions on the key vault: 'get', 'wrapKey' and 'unwrapKey'

    NOTE: If managed_instance_id denotes a secondary instance deployed for disaster recovery purposes, then the key_vault_key_id should be the same key used for the primary instance's transparent data encryption. Both primary and secondary instances should be encrypted with same key material.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ManagedInstanceTransparentDataEncryption 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 ManagedInstanceTransparentDataEncryption Resource

    Get an existing ManagedInstanceTransparentDataEncryption 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?: ManagedInstanceTransparentDataEncryptionState, opts?: CustomResourceOptions): ManagedInstanceTransparentDataEncryption
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            auto_rotation_enabled: Optional[bool] = None,
            key_vault_key_id: Optional[str] = None,
            managed_instance_id: Optional[str] = None) -> ManagedInstanceTransparentDataEncryption
    func GetManagedInstanceTransparentDataEncryption(ctx *Context, name string, id IDInput, state *ManagedInstanceTransparentDataEncryptionState, opts ...ResourceOption) (*ManagedInstanceTransparentDataEncryption, error)
    public static ManagedInstanceTransparentDataEncryption Get(string name, Input<string> id, ManagedInstanceTransparentDataEncryptionState? state, CustomResourceOptions? opts = null)
    public static ManagedInstanceTransparentDataEncryption get(String name, Output<String> id, ManagedInstanceTransparentDataEncryptionState 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.
    The following state arguments are supported:
    AutoRotationEnabled bool
    When enabled, the SQL Managed Instance will continuously check the key vault for any new versions of the key being used as the TDE protector. If a new version of the key is detected, the TDE protector on the SQL Managed Instance will be automatically rotated to the latest key version within 60 minutes.
    KeyVaultKeyId string

    To use customer managed keys from Azure Key Vault, provide the AKV Key ID. To use service managed keys, omit this field.

    NOTE: In order to use customer managed keys, the identity of the MSSQL Managed Instance must have the following permissions on the key vault: 'get', 'wrapKey' and 'unwrapKey'

    NOTE: If managed_instance_id denotes a secondary instance deployed for disaster recovery purposes, then the key_vault_key_id should be the same key used for the primary instance's transparent data encryption. Both primary and secondary instances should be encrypted with same key material.

    ManagedInstanceId string
    Specifies the name of the MS SQL Managed Instance. Changing this forces a new resource to be created.
    AutoRotationEnabled bool
    When enabled, the SQL Managed Instance will continuously check the key vault for any new versions of the key being used as the TDE protector. If a new version of the key is detected, the TDE protector on the SQL Managed Instance will be automatically rotated to the latest key version within 60 minutes.
    KeyVaultKeyId string

    To use customer managed keys from Azure Key Vault, provide the AKV Key ID. To use service managed keys, omit this field.

    NOTE: In order to use customer managed keys, the identity of the MSSQL Managed Instance must have the following permissions on the key vault: 'get', 'wrapKey' and 'unwrapKey'

    NOTE: If managed_instance_id denotes a secondary instance deployed for disaster recovery purposes, then the key_vault_key_id should be the same key used for the primary instance's transparent data encryption. Both primary and secondary instances should be encrypted with same key material.

    ManagedInstanceId string
    Specifies the name of the MS SQL Managed Instance. Changing this forces a new resource to be created.
    autoRotationEnabled Boolean
    When enabled, the SQL Managed Instance will continuously check the key vault for any new versions of the key being used as the TDE protector. If a new version of the key is detected, the TDE protector on the SQL Managed Instance will be automatically rotated to the latest key version within 60 minutes.
    keyVaultKeyId String

    To use customer managed keys from Azure Key Vault, provide the AKV Key ID. To use service managed keys, omit this field.

    NOTE: In order to use customer managed keys, the identity of the MSSQL Managed Instance must have the following permissions on the key vault: 'get', 'wrapKey' and 'unwrapKey'

    NOTE: If managed_instance_id denotes a secondary instance deployed for disaster recovery purposes, then the key_vault_key_id should be the same key used for the primary instance's transparent data encryption. Both primary and secondary instances should be encrypted with same key material.

    managedInstanceId String
    Specifies the name of the MS SQL Managed Instance. Changing this forces a new resource to be created.
    autoRotationEnabled boolean
    When enabled, the SQL Managed Instance will continuously check the key vault for any new versions of the key being used as the TDE protector. If a new version of the key is detected, the TDE protector on the SQL Managed Instance will be automatically rotated to the latest key version within 60 minutes.
    keyVaultKeyId string

    To use customer managed keys from Azure Key Vault, provide the AKV Key ID. To use service managed keys, omit this field.

    NOTE: In order to use customer managed keys, the identity of the MSSQL Managed Instance must have the following permissions on the key vault: 'get', 'wrapKey' and 'unwrapKey'

    NOTE: If managed_instance_id denotes a secondary instance deployed for disaster recovery purposes, then the key_vault_key_id should be the same key used for the primary instance's transparent data encryption. Both primary and secondary instances should be encrypted with same key material.

    managedInstanceId string
    Specifies the name of the MS SQL Managed Instance. Changing this forces a new resource to be created.
    auto_rotation_enabled bool
    When enabled, the SQL Managed Instance will continuously check the key vault for any new versions of the key being used as the TDE protector. If a new version of the key is detected, the TDE protector on the SQL Managed Instance will be automatically rotated to the latest key version within 60 minutes.
    key_vault_key_id str

    To use customer managed keys from Azure Key Vault, provide the AKV Key ID. To use service managed keys, omit this field.

    NOTE: In order to use customer managed keys, the identity of the MSSQL Managed Instance must have the following permissions on the key vault: 'get', 'wrapKey' and 'unwrapKey'

    NOTE: If managed_instance_id denotes a secondary instance deployed for disaster recovery purposes, then the key_vault_key_id should be the same key used for the primary instance's transparent data encryption. Both primary and secondary instances should be encrypted with same key material.

    managed_instance_id str
    Specifies the name of the MS SQL Managed Instance. Changing this forces a new resource to be created.
    autoRotationEnabled Boolean
    When enabled, the SQL Managed Instance will continuously check the key vault for any new versions of the key being used as the TDE protector. If a new version of the key is detected, the TDE protector on the SQL Managed Instance will be automatically rotated to the latest key version within 60 minutes.
    keyVaultKeyId String

    To use customer managed keys from Azure Key Vault, provide the AKV Key ID. To use service managed keys, omit this field.

    NOTE: In order to use customer managed keys, the identity of the MSSQL Managed Instance must have the following permissions on the key vault: 'get', 'wrapKey' and 'unwrapKey'

    NOTE: If managed_instance_id denotes a secondary instance deployed for disaster recovery purposes, then the key_vault_key_id should be the same key used for the primary instance's transparent data encryption. Both primary and secondary instances should be encrypted with same key material.

    managedInstanceId String
    Specifies the name of the MS SQL Managed Instance. Changing this forces a new resource to be created.

    Import

    SQL Managed Instance Transparent Data Encryption can be imported using the resource id, e.g.

    $ pulumi import azure:mssql/managedInstanceTransparentDataEncryption:ManagedInstanceTransparentDataEncryption example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/instance1/encryptionProtector/current
    

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.67.0 published on Wednesday, Feb 21, 2024 by Pulumi