DiskEncryptionSet

class DiskEncryptionSet : KotlinCustomResource

disk encryption set resource. Uses Azure REST API version 2024-03-02. In version 2.x of the Azure Native provider, it used API version 2022-07-02. Other available API versions: 2022-07-02, 2023-01-02, 2023-04-02, 2023-10-02. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native compute [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create a disk encryption set with key vault from a different subscription.

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var diskEncryptionSet = new AzureNative.Compute.DiskEncryptionSet("diskEncryptionSet", new()
{
ActiveKey = new AzureNative.Compute.Inputs.KeyForDiskEncryptionSetArgs
{
KeyUrl = "https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}",
},
DiskEncryptionSetName = "myDiskEncryptionSet",
EncryptionType = AzureNative.Compute.DiskEncryptionSetType.EncryptionAtRestWithCustomerKey,
Identity = new AzureNative.Compute.Inputs.EncryptionSetIdentityArgs
{
Type = AzureNative.Compute.DiskEncryptionSetIdentityType.SystemAssigned,
},
Location = "West US",
ResourceGroupName = "myResourceGroup",
});
});
package main
import (
compute "github.com/pulumi/pulumi-azure-native-sdk/compute/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewDiskEncryptionSet(ctx, "diskEncryptionSet", &compute.DiskEncryptionSetArgs{
ActiveKey: &compute.KeyForDiskEncryptionSetArgs{
KeyUrl: pulumi.String("https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}"),
},
DiskEncryptionSetName: pulumi.String("myDiskEncryptionSet"),
EncryptionType: pulumi.String(compute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey),
Identity: &compute.EncryptionSetIdentityArgs{
Type: pulumi.String(compute.DiskEncryptionSetIdentityTypeSystemAssigned),
},
Location: pulumi.String("West US"),
ResourceGroupName: pulumi.String("myResourceGroup"),
})
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.compute.DiskEncryptionSet;
import com.pulumi.azurenative.compute.DiskEncryptionSetArgs;
import com.pulumi.azurenative.compute.inputs.KeyForDiskEncryptionSetArgs;
import com.pulumi.azurenative.compute.inputs.EncryptionSetIdentityArgs;
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 diskEncryptionSet = new DiskEncryptionSet("diskEncryptionSet", DiskEncryptionSetArgs.builder()
.activeKey(KeyForDiskEncryptionSetArgs.builder()
.keyUrl("https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}")
.build())
.diskEncryptionSetName("myDiskEncryptionSet")
.encryptionType("EncryptionAtRestWithCustomerKey")
.identity(EncryptionSetIdentityArgs.builder()
.type("SystemAssigned")
.build())
.location("West US")
.resourceGroupName("myResourceGroup")
.build());
}
}

Create a disk encryption set.

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var diskEncryptionSet = new AzureNative.Compute.DiskEncryptionSet("diskEncryptionSet", new()
{
ActiveKey = new AzureNative.Compute.Inputs.KeyForDiskEncryptionSetArgs
{
KeyUrl = "https://myvmvault.vault-int.azure-int.net/keys/{key}",
SourceVault = new AzureNative.Compute.Inputs.SourceVaultArgs
{
Id = "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault",
},
},
DiskEncryptionSetName = "myDiskEncryptionSet",
EncryptionType = AzureNative.Compute.DiskEncryptionSetType.EncryptionAtRestWithCustomerKey,
Identity = new AzureNative.Compute.Inputs.EncryptionSetIdentityArgs
{
Type = AzureNative.Compute.DiskEncryptionSetIdentityType.SystemAssigned,
},
Location = "West US",
ResourceGroupName = "myResourceGroup",
});
});
package main
import (
compute "github.com/pulumi/pulumi-azure-native-sdk/compute/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewDiskEncryptionSet(ctx, "diskEncryptionSet", &compute.DiskEncryptionSetArgs{
ActiveKey: &compute.KeyForDiskEncryptionSetArgs{
KeyUrl: pulumi.String("https://myvmvault.vault-int.azure-int.net/keys/{key}"),
SourceVault: &compute.SourceVaultArgs{
Id: pulumi.String("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"),
},
},
DiskEncryptionSetName: pulumi.String("myDiskEncryptionSet"),
EncryptionType: pulumi.String(compute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey),
Identity: &compute.EncryptionSetIdentityArgs{
Type: pulumi.String(compute.DiskEncryptionSetIdentityTypeSystemAssigned),
},
Location: pulumi.String("West US"),
ResourceGroupName: pulumi.String("myResourceGroup"),
})
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.compute.DiskEncryptionSet;
import com.pulumi.azurenative.compute.DiskEncryptionSetArgs;
import com.pulumi.azurenative.compute.inputs.KeyForDiskEncryptionSetArgs;
import com.pulumi.azurenative.compute.inputs.SourceVaultArgs;
import com.pulumi.azurenative.compute.inputs.EncryptionSetIdentityArgs;
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 diskEncryptionSet = new DiskEncryptionSet("diskEncryptionSet", DiskEncryptionSetArgs.builder()
.activeKey(KeyForDiskEncryptionSetArgs.builder()
.keyUrl("https://myvmvault.vault-int.azure-int.net/keys/{key}")
.sourceVault(SourceVaultArgs.builder()
.id("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault")
.build())
.build())
.diskEncryptionSetName("myDiskEncryptionSet")
.encryptionType("EncryptionAtRestWithCustomerKey")
.identity(EncryptionSetIdentityArgs.builder()
.type("SystemAssigned")
.build())
.location("West US")
.resourceGroupName("myResourceGroup")
.build());
}
}

Import

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

$ pulumi import azure-native:compute:DiskEncryptionSet myDiskEncryptionSet /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}

Properties

Link copied to clipboard

The key vault key which is currently used by this disk encryption set.

Link copied to clipboard

The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will not be attempted until the error on this disk encryption set is fixed.

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val encryptionType: Output<String>?

The type of key used to encrypt the data of the disk.

Link copied to clipboard

Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks.

Link copied to clipboard

The time when the active key of this disk encryption set was updated.

Link copied to clipboard
val location: Output<String>

Resource location

Link copied to clipboard
val name: Output<String>

Resource name

Link copied to clipboard

A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation.

Link copied to clipboard

The disk encryption set provisioning state.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Set this flag to true to enable auto-updating of this disk encryption set to the latest key version.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Resource tags

Link copied to clipboard
val type: Output<String>

Resource type

Link copied to clipboard
val urn: Output<String>