We recommend using Azure Native.
azure.compute.Snapshot
Explore with Pulumi AI
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)
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
	})
}
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 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}
Create Snapshot Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Snapshot(name: string, args: SnapshotArgs, opts?: CustomResourceOptions);@overload
def Snapshot(resource_name: str,
             args: SnapshotArgs,
             opts: Optional[ResourceOptions] = None)
@overload
def Snapshot(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             create_option: Optional[str] = None,
             resource_group_name: Optional[str] = None,
             encryption_settings: Optional[SnapshotEncryptionSettingsArgs] = None,
             disk_size_gb: Optional[int] = None,
             incremental_enabled: Optional[bool] = None,
             location: Optional[str] = None,
             name: Optional[str] = None,
             network_access_policy: Optional[str] = None,
             public_network_access_enabled: Optional[bool] = None,
             disk_access_id: Optional[str] = None,
             source_resource_id: Optional[str] = None,
             source_uri: Optional[str] = None,
             storage_account_id: Optional[str] = None,
             tags: Optional[Mapping[str, str]] = None)func NewSnapshot(ctx *Context, name string, args SnapshotArgs, opts ...ResourceOption) (*Snapshot, error)public Snapshot(string name, SnapshotArgs args, CustomResourceOptions? opts = null)
public Snapshot(String name, SnapshotArgs args)
public Snapshot(String name, SnapshotArgs args, CustomResourceOptions options)
type: azure:compute:Snapshot
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 SnapshotArgs
- 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 SnapshotArgs
- 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 SnapshotArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SnapshotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SnapshotArgs
- 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 snapshotResource = new Azure.Compute.Snapshot("snapshotResource", new()
{
    CreateOption = "string",
    ResourceGroupName = "string",
    EncryptionSettings = new Azure.Compute.Inputs.SnapshotEncryptionSettingsArgs
    {
        DiskEncryptionKey = new Azure.Compute.Inputs.SnapshotEncryptionSettingsDiskEncryptionKeyArgs
        {
            SecretUrl = "string",
            SourceVaultId = "string",
        },
        KeyEncryptionKey = new Azure.Compute.Inputs.SnapshotEncryptionSettingsKeyEncryptionKeyArgs
        {
            KeyUrl = "string",
            SourceVaultId = "string",
        },
    },
    DiskSizeGb = 0,
    IncrementalEnabled = false,
    Location = "string",
    Name = "string",
    NetworkAccessPolicy = "string",
    PublicNetworkAccessEnabled = false,
    DiskAccessId = "string",
    SourceResourceId = "string",
    SourceUri = "string",
    StorageAccountId = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
example, err := compute.NewSnapshot(ctx, "snapshotResource", &compute.SnapshotArgs{
	CreateOption:      pulumi.String("string"),
	ResourceGroupName: pulumi.String("string"),
	EncryptionSettings: &compute.SnapshotEncryptionSettingsArgs{
		DiskEncryptionKey: &compute.SnapshotEncryptionSettingsDiskEncryptionKeyArgs{
			SecretUrl:     pulumi.String("string"),
			SourceVaultId: pulumi.String("string"),
		},
		KeyEncryptionKey: &compute.SnapshotEncryptionSettingsKeyEncryptionKeyArgs{
			KeyUrl:        pulumi.String("string"),
			SourceVaultId: pulumi.String("string"),
		},
	},
	DiskSizeGb:                 pulumi.Int(0),
	IncrementalEnabled:         pulumi.Bool(false),
	Location:                   pulumi.String("string"),
	Name:                       pulumi.String("string"),
	NetworkAccessPolicy:        pulumi.String("string"),
	PublicNetworkAccessEnabled: pulumi.Bool(false),
	DiskAccessId:               pulumi.String("string"),
	SourceResourceId:           pulumi.String("string"),
	SourceUri:                  pulumi.String("string"),
	StorageAccountId:           pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
var snapshotResource = new Snapshot("snapshotResource", SnapshotArgs.builder()
    .createOption("string")
    .resourceGroupName("string")
    .encryptionSettings(SnapshotEncryptionSettingsArgs.builder()
        .diskEncryptionKey(SnapshotEncryptionSettingsDiskEncryptionKeyArgs.builder()
            .secretUrl("string")
            .sourceVaultId("string")
            .build())
        .keyEncryptionKey(SnapshotEncryptionSettingsKeyEncryptionKeyArgs.builder()
            .keyUrl("string")
            .sourceVaultId("string")
            .build())
        .build())
    .diskSizeGb(0)
    .incrementalEnabled(false)
    .location("string")
    .name("string")
    .networkAccessPolicy("string")
    .publicNetworkAccessEnabled(false)
    .diskAccessId("string")
    .sourceResourceId("string")
    .sourceUri("string")
    .storageAccountId("string")
    .tags(Map.of("string", "string"))
    .build());
snapshot_resource = azure.compute.Snapshot("snapshotResource",
    create_option="string",
    resource_group_name="string",
    encryption_settings={
        "disk_encryption_key": {
            "secret_url": "string",
            "source_vault_id": "string",
        },
        "key_encryption_key": {
            "key_url": "string",
            "source_vault_id": "string",
        },
    },
    disk_size_gb=0,
    incremental_enabled=False,
    location="string",
    name="string",
    network_access_policy="string",
    public_network_access_enabled=False,
    disk_access_id="string",
    source_resource_id="string",
    source_uri="string",
    storage_account_id="string",
    tags={
        "string": "string",
    })
const snapshotResource = new azure.compute.Snapshot("snapshotResource", {
    createOption: "string",
    resourceGroupName: "string",
    encryptionSettings: {
        diskEncryptionKey: {
            secretUrl: "string",
            sourceVaultId: "string",
        },
        keyEncryptionKey: {
            keyUrl: "string",
            sourceVaultId: "string",
        },
    },
    diskSizeGb: 0,
    incrementalEnabled: false,
    location: "string",
    name: "string",
    networkAccessPolicy: "string",
    publicNetworkAccessEnabled: false,
    diskAccessId: "string",
    sourceResourceId: "string",
    sourceUri: "string",
    storageAccountId: "string",
    tags: {
        string: "string",
    },
});
type: azure:compute:Snapshot
properties:
    createOption: string
    diskAccessId: string
    diskSizeGb: 0
    encryptionSettings:
        diskEncryptionKey:
            secretUrl: string
            sourceVaultId: string
        keyEncryptionKey:
            keyUrl: string
            sourceVaultId: string
    incrementalEnabled: false
    location: string
    name: string
    networkAccessPolicy: string
    publicNetworkAccessEnabled: false
    resourceGroupName: string
    sourceResourceId: string
    sourceUri: string
    storageAccountId: string
    tags:
        string: string
Snapshot Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Snapshot resource accepts the following input properties:
- CreateOption string
- Indicates how the snapshot is to be created. Possible values are - Copyor- Import.- Note: One of - source_uri,- source_resource_idor- storage_account_idmust be specified.
- ResourceGroup stringName 
- The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
- DiskAccess stringId 
- Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting network_access_policytoAllowPrivate.
- DiskSize intGb 
- The size of the Snapshotted Disk in GB.
- EncryptionSettings SnapshotEncryption Settings 
- A - encryption_settingsblock as defined below.- NOTE: Removing - encryption_settingsforces a new resource to be created.
- IncrementalEnabled bool
- Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
- Location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
- Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
- NetworkAccess stringPolicy 
- Policy for accessing the disk via network. Possible values are AllowAll,AllowPrivate, orDenyAll. Defaults toAllowAll.
- PublicNetwork boolAccess Enabled 
- Policy for controlling export on the disk. Possible values are trueorfalse. Defaults totrue.
- SourceResource stringId 
- Specifies a reference to an existing snapshot, when create_optionisCopy. Changing this forces a new resource to be created.
- SourceUri string
- Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
- StorageAccount stringId 
- Specifies the ID of an storage account. Used with source_urito allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- CreateOption string
- Indicates how the snapshot is to be created. Possible values are - Copyor- Import.- Note: One of - source_uri,- source_resource_idor- storage_account_idmust be specified.
- ResourceGroup stringName 
- The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
- DiskAccess stringId 
- Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting network_access_policytoAllowPrivate.
- DiskSize intGb 
- The size of the Snapshotted Disk in GB.
- EncryptionSettings SnapshotEncryption Settings Args 
- A - encryption_settingsblock as defined below.- NOTE: Removing - encryption_settingsforces a new resource to be created.
- IncrementalEnabled bool
- Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
- Location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
- Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
- NetworkAccess stringPolicy 
- Policy for accessing the disk via network. Possible values are AllowAll,AllowPrivate, orDenyAll. Defaults toAllowAll.
- PublicNetwork boolAccess Enabled 
- Policy for controlling export on the disk. Possible values are trueorfalse. Defaults totrue.
- SourceResource stringId 
- Specifies a reference to an existing snapshot, when create_optionisCopy. Changing this forces a new resource to be created.
- SourceUri string
- Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
- StorageAccount stringId 
- Specifies the ID of an storage account. Used with source_urito allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
- map[string]string
- A mapping of tags to assign to the resource.
- createOption String
- Indicates how the snapshot is to be created. Possible values are - Copyor- Import.- Note: One of - source_uri,- source_resource_idor- storage_account_idmust be specified.
- resourceGroup StringName 
- The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
- diskAccess StringId 
- Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting network_access_policytoAllowPrivate.
- diskSize IntegerGb 
- The size of the Snapshotted Disk in GB.
- encryptionSettings SnapshotEncryption Settings 
- A - encryption_settingsblock as defined below.- NOTE: Removing - encryption_settingsforces a new resource to be created.
- incrementalEnabled Boolean
- Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
- location String
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name String
- Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
- networkAccess StringPolicy 
- Policy for accessing the disk via network. Possible values are AllowAll,AllowPrivate, orDenyAll. Defaults toAllowAll.
- publicNetwork BooleanAccess Enabled 
- Policy for controlling export on the disk. Possible values are trueorfalse. Defaults totrue.
- sourceResource StringId 
- Specifies a reference to an existing snapshot, when create_optionisCopy. Changing this forces a new resource to be created.
- sourceUri String
- Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
- storageAccount StringId 
- Specifies the ID of an storage account. Used with source_urito allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
- Map<String,String>
- A mapping of tags to assign to the resource.
- createOption string
- Indicates how the snapshot is to be created. Possible values are - Copyor- Import.- Note: One of - source_uri,- source_resource_idor- storage_account_idmust be specified.
- resourceGroup stringName 
- The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
- diskAccess stringId 
- Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting network_access_policytoAllowPrivate.
- diskSize numberGb 
- The size of the Snapshotted Disk in GB.
- encryptionSettings SnapshotEncryption Settings 
- A - encryption_settingsblock as defined below.- NOTE: Removing - encryption_settingsforces a new resource to be created.
- incrementalEnabled boolean
- Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
- location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name string
- Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
- networkAccess stringPolicy 
- Policy for accessing the disk via network. Possible values are AllowAll,AllowPrivate, orDenyAll. Defaults toAllowAll.
- publicNetwork booleanAccess Enabled 
- Policy for controlling export on the disk. Possible values are trueorfalse. Defaults totrue.
- sourceResource stringId 
- Specifies a reference to an existing snapshot, when create_optionisCopy. Changing this forces a new resource to be created.
- sourceUri string
- Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
- storageAccount stringId 
- Specifies the ID of an storage account. Used with source_urito allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- create_option str
- Indicates how the snapshot is to be created. Possible values are - Copyor- Import.- Note: One of - source_uri,- source_resource_idor- storage_account_idmust be specified.
- resource_group_ strname 
- The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
- disk_access_ strid 
- Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting network_access_policytoAllowPrivate.
- disk_size_ intgb 
- The size of the Snapshotted Disk in GB.
- encryption_settings SnapshotEncryption Settings Args 
- A - encryption_settingsblock as defined below.- NOTE: Removing - encryption_settingsforces a new resource to be created.
- incremental_enabled bool
- Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
- location str
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name str
- Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
- network_access_ strpolicy 
- Policy for accessing the disk via network. Possible values are AllowAll,AllowPrivate, orDenyAll. Defaults toAllowAll.
- public_network_ boolaccess_ enabled 
- Policy for controlling export on the disk. Possible values are trueorfalse. Defaults totrue.
- source_resource_ strid 
- Specifies a reference to an existing snapshot, when create_optionisCopy. Changing this forces a new resource to be created.
- source_uri str
- Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
- storage_account_ strid 
- Specifies the ID of an storage account. Used with source_urito allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- createOption String
- Indicates how the snapshot is to be created. Possible values are - Copyor- Import.- Note: One of - source_uri,- source_resource_idor- storage_account_idmust be specified.
- resourceGroup StringName 
- The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
- diskAccess StringId 
- Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting network_access_policytoAllowPrivate.
- diskSize NumberGb 
- The size of the Snapshotted Disk in GB.
- encryptionSettings Property Map
- A - encryption_settingsblock as defined below.- NOTE: Removing - encryption_settingsforces a new resource to be created.
- incrementalEnabled Boolean
- Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
- location String
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name String
- Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
- networkAccess StringPolicy 
- Policy for accessing the disk via network. Possible values are AllowAll,AllowPrivate, orDenyAll. Defaults toAllowAll.
- publicNetwork BooleanAccess Enabled 
- Policy for controlling export on the disk. Possible values are trueorfalse. Defaults totrue.
- sourceResource StringId 
- Specifies a reference to an existing snapshot, when create_optionisCopy. Changing this forces a new resource to be created.
- sourceUri String
- Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
- storageAccount StringId 
- Specifies the ID of an storage account. Used with source_urito allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
- Map<String>
- A mapping of tags to assign to the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the Snapshot resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- TrustedLaunch boolEnabled 
- Whether Trusted Launch is enabled for the Snapshot.
- Id string
- The provider-assigned unique ID for this managed resource.
- TrustedLaunch boolEnabled 
- Whether Trusted Launch is enabled for the Snapshot.
- id String
- The provider-assigned unique ID for this managed resource.
- trustedLaunch BooleanEnabled 
- Whether Trusted Launch is enabled for the Snapshot.
- id string
- The provider-assigned unique ID for this managed resource.
- trustedLaunch booleanEnabled 
- Whether Trusted Launch is enabled for the Snapshot.
- id str
- The provider-assigned unique ID for this managed resource.
- trusted_launch_ boolenabled 
- Whether Trusted Launch is enabled for the Snapshot.
- id String
- The provider-assigned unique ID for this managed resource.
- trustedLaunch BooleanEnabled 
- Whether Trusted Launch is enabled for the Snapshot.
Look up Existing Snapshot Resource
Get an existing Snapshot 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?: SnapshotState, opts?: CustomResourceOptions): Snapshot@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        create_option: Optional[str] = None,
        disk_access_id: Optional[str] = None,
        disk_size_gb: Optional[int] = None,
        encryption_settings: Optional[SnapshotEncryptionSettingsArgs] = None,
        incremental_enabled: Optional[bool] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        network_access_policy: Optional[str] = None,
        public_network_access_enabled: Optional[bool] = None,
        resource_group_name: Optional[str] = None,
        source_resource_id: Optional[str] = None,
        source_uri: Optional[str] = None,
        storage_account_id: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        trusted_launch_enabled: Optional[bool] = None) -> Snapshotfunc GetSnapshot(ctx *Context, name string, id IDInput, state *SnapshotState, opts ...ResourceOption) (*Snapshot, error)public static Snapshot Get(string name, Input<string> id, SnapshotState? state, CustomResourceOptions? opts = null)public static Snapshot get(String name, Output<String> id, SnapshotState state, CustomResourceOptions options)resources:  _:    type: azure:compute:Snapshot    get:      id: ${id}- 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.
- CreateOption string
- Indicates how the snapshot is to be created. Possible values are - Copyor- Import.- Note: One of - source_uri,- source_resource_idor- storage_account_idmust be specified.
- DiskAccess stringId 
- Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting network_access_policytoAllowPrivate.
- DiskSize intGb 
- The size of the Snapshotted Disk in GB.
- EncryptionSettings SnapshotEncryption Settings 
- A - encryption_settingsblock as defined below.- NOTE: Removing - encryption_settingsforces a new resource to be created.
- IncrementalEnabled bool
- Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
- Location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
- Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
- NetworkAccess stringPolicy 
- Policy for accessing the disk via network. Possible values are AllowAll,AllowPrivate, orDenyAll. Defaults toAllowAll.
- PublicNetwork boolAccess Enabled 
- Policy for controlling export on the disk. Possible values are trueorfalse. Defaults totrue.
- ResourceGroup stringName 
- The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
- SourceResource stringId 
- Specifies a reference to an existing snapshot, when create_optionisCopy. Changing this forces a new resource to be created.
- SourceUri string
- Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
- StorageAccount stringId 
- Specifies the ID of an storage account. Used with source_urito allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- TrustedLaunch boolEnabled 
- Whether Trusted Launch is enabled for the Snapshot.
- CreateOption string
- Indicates how the snapshot is to be created. Possible values are - Copyor- Import.- Note: One of - source_uri,- source_resource_idor- storage_account_idmust be specified.
- DiskAccess stringId 
- Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting network_access_policytoAllowPrivate.
- DiskSize intGb 
- The size of the Snapshotted Disk in GB.
- EncryptionSettings SnapshotEncryption Settings Args 
- A - encryption_settingsblock as defined below.- NOTE: Removing - encryption_settingsforces a new resource to be created.
- IncrementalEnabled bool
- Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
- Location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
- Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
- NetworkAccess stringPolicy 
- Policy for accessing the disk via network. Possible values are AllowAll,AllowPrivate, orDenyAll. Defaults toAllowAll.
- PublicNetwork boolAccess Enabled 
- Policy for controlling export on the disk. Possible values are trueorfalse. Defaults totrue.
- ResourceGroup stringName 
- The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
- SourceResource stringId 
- Specifies a reference to an existing snapshot, when create_optionisCopy. Changing this forces a new resource to be created.
- SourceUri string
- Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
- StorageAccount stringId 
- Specifies the ID of an storage account. Used with source_urito allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
- map[string]string
- A mapping of tags to assign to the resource.
- TrustedLaunch boolEnabled 
- Whether Trusted Launch is enabled for the Snapshot.
- createOption String
- Indicates how the snapshot is to be created. Possible values are - Copyor- Import.- Note: One of - source_uri,- source_resource_idor- storage_account_idmust be specified.
- diskAccess StringId 
- Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting network_access_policytoAllowPrivate.
- diskSize IntegerGb 
- The size of the Snapshotted Disk in GB.
- encryptionSettings SnapshotEncryption Settings 
- A - encryption_settingsblock as defined below.- NOTE: Removing - encryption_settingsforces a new resource to be created.
- incrementalEnabled Boolean
- Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
- location String
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name String
- Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
- networkAccess StringPolicy 
- Policy for accessing the disk via network. Possible values are AllowAll,AllowPrivate, orDenyAll. Defaults toAllowAll.
- publicNetwork BooleanAccess Enabled 
- Policy for controlling export on the disk. Possible values are trueorfalse. Defaults totrue.
- resourceGroup StringName 
- The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
- sourceResource StringId 
- Specifies a reference to an existing snapshot, when create_optionisCopy. Changing this forces a new resource to be created.
- sourceUri String
- Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
- storageAccount StringId 
- Specifies the ID of an storage account. Used with source_urito allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
- Map<String,String>
- A mapping of tags to assign to the resource.
- trustedLaunch BooleanEnabled 
- Whether Trusted Launch is enabled for the Snapshot.
- createOption string
- Indicates how the snapshot is to be created. Possible values are - Copyor- Import.- Note: One of - source_uri,- source_resource_idor- storage_account_idmust be specified.
- diskAccess stringId 
- Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting network_access_policytoAllowPrivate.
- diskSize numberGb 
- The size of the Snapshotted Disk in GB.
- encryptionSettings SnapshotEncryption Settings 
- A - encryption_settingsblock as defined below.- NOTE: Removing - encryption_settingsforces a new resource to be created.
- incrementalEnabled boolean
- Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
- location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name string
- Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
- networkAccess stringPolicy 
- Policy for accessing the disk via network. Possible values are AllowAll,AllowPrivate, orDenyAll. Defaults toAllowAll.
- publicNetwork booleanAccess Enabled 
- Policy for controlling export on the disk. Possible values are trueorfalse. Defaults totrue.
- resourceGroup stringName 
- The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
- sourceResource stringId 
- Specifies a reference to an existing snapshot, when create_optionisCopy. Changing this forces a new resource to be created.
- sourceUri string
- Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
- storageAccount stringId 
- Specifies the ID of an storage account. Used with source_urito allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- trustedLaunch booleanEnabled 
- Whether Trusted Launch is enabled for the Snapshot.
- create_option str
- Indicates how the snapshot is to be created. Possible values are - Copyor- Import.- Note: One of - source_uri,- source_resource_idor- storage_account_idmust be specified.
- disk_access_ strid 
- Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting network_access_policytoAllowPrivate.
- disk_size_ intgb 
- The size of the Snapshotted Disk in GB.
- encryption_settings SnapshotEncryption Settings Args 
- A - encryption_settingsblock as defined below.- NOTE: Removing - encryption_settingsforces a new resource to be created.
- incremental_enabled bool
- Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
- location str
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name str
- Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
- network_access_ strpolicy 
- Policy for accessing the disk via network. Possible values are AllowAll,AllowPrivate, orDenyAll. Defaults toAllowAll.
- public_network_ boolaccess_ enabled 
- Policy for controlling export on the disk. Possible values are trueorfalse. Defaults totrue.
- resource_group_ strname 
- The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
- source_resource_ strid 
- Specifies a reference to an existing snapshot, when create_optionisCopy. Changing this forces a new resource to be created.
- source_uri str
- Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
- storage_account_ strid 
- Specifies the ID of an storage account. Used with source_urito allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- trusted_launch_ boolenabled 
- Whether Trusted Launch is enabled for the Snapshot.
- createOption String
- Indicates how the snapshot is to be created. Possible values are - Copyor- Import.- Note: One of - source_uri,- source_resource_idor- storage_account_idmust be specified.
- diskAccess StringId 
- Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting network_access_policytoAllowPrivate.
- diskSize NumberGb 
- The size of the Snapshotted Disk in GB.
- encryptionSettings Property Map
- A - encryption_settingsblock as defined below.- NOTE: Removing - encryption_settingsforces a new resource to be created.
- incrementalEnabled Boolean
- Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
- location String
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name String
- Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
- networkAccess StringPolicy 
- Policy for accessing the disk via network. Possible values are AllowAll,AllowPrivate, orDenyAll. Defaults toAllowAll.
- publicNetwork BooleanAccess Enabled 
- Policy for controlling export on the disk. Possible values are trueorfalse. Defaults totrue.
- resourceGroup StringName 
- The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
- sourceResource StringId 
- Specifies a reference to an existing snapshot, when create_optionisCopy. Changing this forces a new resource to be created.
- sourceUri String
- Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
- storageAccount StringId 
- Specifies the ID of an storage account. Used with source_urito allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
- Map<String>
- A mapping of tags to assign to the resource.
- trustedLaunch BooleanEnabled 
- Whether Trusted Launch is enabled for the Snapshot.
Supporting Types
SnapshotEncryptionSettings, SnapshotEncryptionSettingsArgs      
- DiskEncryption SnapshotKey Encryption Settings Disk Encryption Key 
- A disk_encryption_keyblock as defined below.
- KeyEncryption SnapshotKey Encryption Settings Key Encryption Key 
- A key_encryption_keyblock as defined below.
- DiskEncryption SnapshotKey Encryption Settings Disk Encryption Key 
- A disk_encryption_keyblock as defined below.
- KeyEncryption SnapshotKey Encryption Settings Key Encryption Key 
- A key_encryption_keyblock as defined below.
- diskEncryption SnapshotKey Encryption Settings Disk Encryption Key 
- A disk_encryption_keyblock as defined below.
- keyEncryption SnapshotKey Encryption Settings Key Encryption Key 
- A key_encryption_keyblock as defined below.
- diskEncryption SnapshotKey Encryption Settings Disk Encryption Key 
- A disk_encryption_keyblock as defined below.
- keyEncryption SnapshotKey Encryption Settings Key Encryption Key 
- A key_encryption_keyblock as defined below.
- disk_encryption_ Snapshotkey Encryption Settings Disk Encryption Key 
- A disk_encryption_keyblock as defined below.
- key_encryption_ Snapshotkey Encryption Settings Key Encryption Key 
- A key_encryption_keyblock as defined below.
- diskEncryption Property MapKey 
- A disk_encryption_keyblock as defined below.
- keyEncryption Property MapKey 
- A key_encryption_keyblock as defined below.
SnapshotEncryptionSettingsDiskEncryptionKey, SnapshotEncryptionSettingsDiskEncryptionKeyArgs            
- SecretUrl string
- The URL to the Key Vault Secret used as the Disk Encryption Key. This can be found as idon theazure.keyvault.Secretresource.
- SourceVault stringId 
- The ID of the source Key Vault. This can be found as idon theazure.keyvault.KeyVaultresource.
- SecretUrl string
- The URL to the Key Vault Secret used as the Disk Encryption Key. This can be found as idon theazure.keyvault.Secretresource.
- SourceVault stringId 
- The ID of the source Key Vault. This can be found as idon theazure.keyvault.KeyVaultresource.
- secretUrl String
- The URL to the Key Vault Secret used as the Disk Encryption Key. This can be found as idon theazure.keyvault.Secretresource.
- sourceVault StringId 
- The ID of the source Key Vault. This can be found as idon theazure.keyvault.KeyVaultresource.
- secretUrl string
- The URL to the Key Vault Secret used as the Disk Encryption Key. This can be found as idon theazure.keyvault.Secretresource.
- sourceVault stringId 
- The ID of the source Key Vault. This can be found as idon theazure.keyvault.KeyVaultresource.
- secret_url str
- The URL to the Key Vault Secret used as the Disk Encryption Key. This can be found as idon theazure.keyvault.Secretresource.
- source_vault_ strid 
- The ID of the source Key Vault. This can be found as idon theazure.keyvault.KeyVaultresource.
- secretUrl String
- The URL to the Key Vault Secret used as the Disk Encryption Key. This can be found as idon theazure.keyvault.Secretresource.
- sourceVault StringId 
- The ID of the source Key Vault. This can be found as idon theazure.keyvault.KeyVaultresource.
SnapshotEncryptionSettingsKeyEncryptionKey, SnapshotEncryptionSettingsKeyEncryptionKeyArgs            
- KeyUrl string
- The URL to the Key Vault Key used as the Key Encryption Key. This can be found as idon theazure.keyvault.Keyresource.
- SourceVault stringId 
- The ID of the source Key Vault. This can be found as idon theazure.keyvault.KeyVaultresource.
- KeyUrl string
- The URL to the Key Vault Key used as the Key Encryption Key. This can be found as idon theazure.keyvault.Keyresource.
- SourceVault stringId 
- The ID of the source Key Vault. This can be found as idon theazure.keyvault.KeyVaultresource.
- keyUrl String
- The URL to the Key Vault Key used as the Key Encryption Key. This can be found as idon theazure.keyvault.Keyresource.
- sourceVault StringId 
- The ID of the source Key Vault. This can be found as idon theazure.keyvault.KeyVaultresource.
- keyUrl string
- The URL to the Key Vault Key used as the Key Encryption Key. This can be found as idon theazure.keyvault.Keyresource.
- sourceVault stringId 
- The ID of the source Key Vault. This can be found as idon theazure.keyvault.KeyVaultresource.
- key_url str
- The URL to the Key Vault Key used as the Key Encryption Key. This can be found as idon theazure.keyvault.Keyresource.
- source_vault_ strid 
- The ID of the source Key Vault. This can be found as idon theazure.keyvault.KeyVaultresource.
- keyUrl String
- The URL to the Key Vault Key used as the Key Encryption Key. This can be found as idon theazure.keyvault.Keyresource.
- sourceVault StringId 
- The ID of the source Key Vault. This can be found as idon theazure.keyvault.KeyVaultresource.
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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.