1. Packages
  2. Azure Classic
  3. API Docs
  4. compute
  5. getSnapshot

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.compute.getSnapshot

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Use this data source to access information about an existing Snapshot.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.compute.getSnapshot({
    name: "my-snapshot",
    resourceGroupName: "my-resource-group",
});
Copy
import pulumi
import pulumi_azure as azure

example = azure.compute.get_snapshot(name="my-snapshot",
    resource_group_name="my-resource-group")
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.LookupSnapshot(ctx, &compute.LookupSnapshotArgs{
			Name:              "my-snapshot",
			ResourceGroupName: "my-resource-group",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.Compute.GetSnapshot.Invoke(new()
    {
        Name = "my-snapshot",
        ResourceGroupName = "my-resource-group",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.compute.ComputeFunctions;
import com.pulumi.azure.compute.inputs.GetSnapshotArgs;
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 example = ComputeFunctions.getSnapshot(GetSnapshotArgs.builder()
            .name("my-snapshot")
            .resourceGroupName("my-resource-group")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:compute:getSnapshot
      arguments:
        name: my-snapshot
        resourceGroupName: my-resource-group
Copy

Using getSnapshot

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getSnapshot(args: GetSnapshotArgs, opts?: InvokeOptions): Promise<GetSnapshotResult>
function getSnapshotOutput(args: GetSnapshotOutputArgs, opts?: InvokeOptions): Output<GetSnapshotResult>
Copy
def get_snapshot(name: Optional[str] = None,
                 resource_group_name: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetSnapshotResult
def get_snapshot_output(name: Optional[pulumi.Input[str]] = None,
                 resource_group_name: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetSnapshotResult]
Copy
func LookupSnapshot(ctx *Context, args *LookupSnapshotArgs, opts ...InvokeOption) (*LookupSnapshotResult, error)
func LookupSnapshotOutput(ctx *Context, args *LookupSnapshotOutputArgs, opts ...InvokeOption) LookupSnapshotResultOutput
Copy

> Note: This function is named LookupSnapshot in the Go SDK.

public static class GetSnapshot 
{
    public static Task<GetSnapshotResult> InvokeAsync(GetSnapshotArgs args, InvokeOptions? opts = null)
    public static Output<GetSnapshotResult> Invoke(GetSnapshotInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSnapshotResult> getSnapshot(GetSnapshotArgs args, InvokeOptions options)
public static Output<GetSnapshotResult> getSnapshot(GetSnapshotArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:compute/getSnapshot:getSnapshot
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Specifies the name of the Snapshot.
ResourceGroupName This property is required. string
Specifies the name of the resource group the Snapshot is located in.
Name This property is required. string
Specifies the name of the Snapshot.
ResourceGroupName This property is required. string
Specifies the name of the resource group the Snapshot is located in.
name This property is required. String
Specifies the name of the Snapshot.
resourceGroupName This property is required. String
Specifies the name of the resource group the Snapshot is located in.
name This property is required. string
Specifies the name of the Snapshot.
resourceGroupName This property is required. string
Specifies the name of the resource group the Snapshot is located in.
name This property is required. str
Specifies the name of the Snapshot.
resource_group_name This property is required. str
Specifies the name of the resource group the Snapshot is located in.
name This property is required. String
Specifies the name of the Snapshot.
resourceGroupName This property is required. String
Specifies the name of the resource group the Snapshot is located in.

getSnapshot Result

The following output properties are available:

CreationOption string
DiskSizeGb int
The size of the Snapshotted Disk in GB.
EncryptionSettings List<GetSnapshotEncryptionSetting>
Id string
The provider-assigned unique ID for this managed resource.
Name string
OsType string
ResourceGroupName string
SourceResourceId string
The reference to an existing snapshot.
SourceUri string
The URI to a Managed or Unmanaged Disk.
StorageAccountId string
The ID of an storage account.
TimeCreated string
TrustedLaunchEnabled bool
Whether Trusted Launch is enabled for the Snapshot.
CreationOption string
DiskSizeGb int
The size of the Snapshotted Disk in GB.
EncryptionSettings []GetSnapshotEncryptionSetting
Id string
The provider-assigned unique ID for this managed resource.
Name string
OsType string
ResourceGroupName string
SourceResourceId string
The reference to an existing snapshot.
SourceUri string
The URI to a Managed or Unmanaged Disk.
StorageAccountId string
The ID of an storage account.
TimeCreated string
TrustedLaunchEnabled bool
Whether Trusted Launch is enabled for the Snapshot.
creationOption String
diskSizeGb Integer
The size of the Snapshotted Disk in GB.
encryptionSettings List<GetSnapshotEncryptionSetting>
id String
The provider-assigned unique ID for this managed resource.
name String
osType String
resourceGroupName String
sourceResourceId String
The reference to an existing snapshot.
sourceUri String
The URI to a Managed or Unmanaged Disk.
storageAccountId String
The ID of an storage account.
timeCreated String
trustedLaunchEnabled Boolean
Whether Trusted Launch is enabled for the Snapshot.
creationOption string
diskSizeGb number
The size of the Snapshotted Disk in GB.
encryptionSettings GetSnapshotEncryptionSetting[]
id string
The provider-assigned unique ID for this managed resource.
name string
osType string
resourceGroupName string
sourceResourceId string
The reference to an existing snapshot.
sourceUri string
The URI to a Managed or Unmanaged Disk.
storageAccountId string
The ID of an storage account.
timeCreated string
trustedLaunchEnabled boolean
Whether Trusted Launch is enabled for the Snapshot.
creation_option str
disk_size_gb int
The size of the Snapshotted Disk in GB.
encryption_settings Sequence[GetSnapshotEncryptionSetting]
id str
The provider-assigned unique ID for this managed resource.
name str
os_type str
resource_group_name str
source_resource_id str
The reference to an existing snapshot.
source_uri str
The URI to a Managed or Unmanaged Disk.
storage_account_id str
The ID of an storage account.
time_created str
trusted_launch_enabled bool
Whether Trusted Launch is enabled for the Snapshot.
creationOption String
diskSizeGb Number
The size of the Snapshotted Disk in GB.
encryptionSettings List<Property Map>
id String
The provider-assigned unique ID for this managed resource.
name String
osType String
resourceGroupName String
sourceResourceId String
The reference to an existing snapshot.
sourceUri String
The URI to a Managed or Unmanaged Disk.
storageAccountId String
The ID of an storage account.
timeCreated String
trustedLaunchEnabled Boolean
Whether Trusted Launch is enabled for the Snapshot.

Supporting Types

GetSnapshotEncryptionSetting

diskEncryptionKeys This property is required. GetSnapshotEncryptionSettingDiskEncryptionKey[]
enabled This property is required. boolean
keyEncryptionKeys This property is required. GetSnapshotEncryptionSettingKeyEncryptionKey[]
diskEncryptionKeys This property is required. List<Property Map>
enabled This property is required. Boolean
keyEncryptionKeys This property is required. List<Property Map>

GetSnapshotEncryptionSettingDiskEncryptionKey

SecretUrl This property is required. string
SourceVaultId This property is required. string
SecretUrl This property is required. string
SourceVaultId This property is required. string
secretUrl This property is required. String
sourceVaultId This property is required. String
secretUrl This property is required. string
sourceVaultId This property is required. string
secret_url This property is required. str
source_vault_id This property is required. str
secretUrl This property is required. String
sourceVaultId This property is required. String

GetSnapshotEncryptionSettingKeyEncryptionKey

KeyUrl This property is required. string
SourceVaultId This property is required. string
KeyUrl This property is required. string
SourceVaultId This property is required. string
keyUrl This property is required. String
sourceVaultId This property is required. String
keyUrl This property is required. string
sourceVaultId This property is required. string
key_url This property is required. str
source_vault_id This property is required. str
keyUrl This property is required. String
sourceVaultId This property is required. String

Package Details

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

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi