SnapshotArgs

data class SnapshotArgs(val createOption: Output<String>? = null, val diskAccessId: Output<String>? = null, val diskSizeGb: Output<Int>? = null, val encryptionSettings: Output<SnapshotEncryptionSettingsArgs>? = null, val incrementalEnabled: Output<Boolean>? = null, val location: Output<String>? = null, val name: Output<String>? = null, val networkAccessPolicy: Output<String>? = null, val publicNetworkAccessEnabled: Output<Boolean>? = null, val resourceGroupName: Output<String>? = null, val sourceResourceId: Output<String>? = null, val sourceUri: Output<String>? = null, val storageAccountId: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<SnapshotArgs>

Manages a Disk Snapshot.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "snapshot-rg",
location: "West Europe",
});
const exampleManagedDisk = new azure.compute.ManagedDisk("example", {
name: "managed-disk",
location: example.location,
resourceGroupName: example.name,
storageAccountType: "Standard_LRS",
createOption: "Empty",
diskSizeGb: 10,
});
const exampleSnapshot = new azure.compute.Snapshot("example", {
name: "snapshot",
location: example.location,
resourceGroupName: example.name,
createOption: "Copy",
sourceUri: exampleManagedDisk.id,
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="snapshot-rg",
location="West Europe")
example_managed_disk = azure.compute.ManagedDisk("example",
name="managed-disk",
location=example.location,
resource_group_name=example.name,
storage_account_type="Standard_LRS",
create_option="Empty",
disk_size_gb=10)
example_snapshot = azure.compute.Snapshot("example",
name="snapshot",
location=example.location,
resource_group_name=example.name,
create_option="Copy",
source_uri=example_managed_disk.id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "snapshot-rg",
Location = "West Europe",
});
var exampleManagedDisk = new Azure.Compute.ManagedDisk("example", new()
{
Name = "managed-disk",
Location = example.Location,
ResourceGroupName = example.Name,
StorageAccountType = "Standard_LRS",
CreateOption = "Empty",
DiskSizeGb = 10,
});
var exampleSnapshot = new Azure.Compute.Snapshot("example", new()
{
Name = "snapshot",
Location = example.Location,
ResourceGroupName = example.Name,
CreateOption = "Copy",
SourceUri = exampleManagedDisk.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("snapshot-rg"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleManagedDisk, err := compute.NewManagedDisk(ctx, "example", &compute.ManagedDiskArgs{
Name: pulumi.String("managed-disk"),
Location: example.Location,
ResourceGroupName: example.Name,
StorageAccountType: pulumi.String("Standard_LRS"),
CreateOption: pulumi.String("Empty"),
DiskSizeGb: pulumi.Int(10),
})
if err != nil {
return err
}
_, err = compute.NewSnapshot(ctx, "example", &compute.SnapshotArgs{
Name: pulumi.String("snapshot"),
Location: example.Location,
ResourceGroupName: example.Name,
CreateOption: pulumi.String("Copy"),
SourceUri: exampleManagedDisk.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.compute.ManagedDisk;
import com.pulumi.azure.compute.ManagedDiskArgs;
import com.pulumi.azure.compute.Snapshot;
import com.pulumi.azure.compute.SnapshotArgs;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("snapshot-rg")
.location("West Europe")
.build());
var exampleManagedDisk = new ManagedDisk("exampleManagedDisk", ManagedDiskArgs.builder()
.name("managed-disk")
.location(example.location())
.resourceGroupName(example.name())
.storageAccountType("Standard_LRS")
.createOption("Empty")
.diskSizeGb(10)
.build());
var exampleSnapshot = new Snapshot("exampleSnapshot", SnapshotArgs.builder()
.name("snapshot")
.location(example.location())
.resourceGroupName(example.name())
.createOption("Copy")
.sourceUri(exampleManagedDisk.id())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: snapshot-rg
location: West Europe
exampleManagedDisk:
type: azure:compute:ManagedDisk
name: example
properties:
name: managed-disk
location: ${example.location}
resourceGroupName: ${example.name}
storageAccountType: Standard_LRS
createOption: Empty
diskSizeGb: '10'
exampleSnapshot:
type: azure:compute:Snapshot
name: example
properties:
name: snapshot
location: ${example.location}
resourceGroupName: ${example.name}
createOption: Copy
sourceUri: ${exampleManagedDisk.id}

Import

Snapshots can be imported using the resource id, e.g.

$ pulumi import azure:compute/snapshot:Snapshot example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/snapshots/snapshot1

Constructors

Link copied to clipboard
constructor(createOption: Output<String>? = null, diskAccessId: Output<String>? = null, diskSizeGb: Output<Int>? = null, encryptionSettings: Output<SnapshotEncryptionSettingsArgs>? = null, incrementalEnabled: Output<Boolean>? = null, location: Output<String>? = null, name: Output<String>? = null, networkAccessPolicy: Output<String>? = null, publicNetworkAccessEnabled: Output<Boolean>? = null, resourceGroupName: Output<String>? = null, sourceResourceId: Output<String>? = null, sourceUri: Output<String>? = null, storageAccountId: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val createOption: Output<String>? = null

Indicates how the snapshot is to be created. Possible values are Copy or Import.

Link copied to clipboard
val diskAccessId: Output<String>? = null

Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting network_access_policy to AllowPrivate.

Link copied to clipboard
val diskSizeGb: Output<Int>? = null

The size of the Snapshotted Disk in GB.

Link copied to clipboard

A encryption_settings block as defined below.

Link copied to clipboard
val incrementalEnabled: Output<Boolean>? = null

Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.

Link copied to clipboard
val location: Output<String>? = null

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

Link copied to clipboard
val name: Output<String>? = null

Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.

Link copied to clipboard
val networkAccessPolicy: Output<String>? = null

Policy for accessing the disk via network. Possible values are AllowAll, AllowPrivate, or DenyAll. Defaults to AllowAll.

Link copied to clipboard
val publicNetworkAccessEnabled: Output<Boolean>? = null

Policy for controlling export on the disk. Possible values are true or false. Defaults to true.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.

Link copied to clipboard
val sourceResourceId: Output<String>? = null

Specifies a reference to an existing snapshot, when create_option is Copy. Changing this forces a new resource to be created.

Link copied to clipboard
val sourceUri: Output<String>? = null

Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.

Link copied to clipboard
val storageAccountId: Output<String>? = null

Specifies the ID of an storage account. Used with source_uri to allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.

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

A mapping of tags to assign to the resource.

Functions

Link copied to clipboard
open override fun toJava(): SnapshotArgs