We recommend using Azure Native.
Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi
azure.compute.getSnapshot
Explore with Pulumi AI
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",
});
import pulumi
import pulumi_azure as azure
example = azure.compute.get_snapshot(name="my-snapshot",
resource_group_name="my-resource-group")
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/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
})
}
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",
});
});
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());
}
}
variables:
example:
fn::invoke:
Function: azure:compute:getSnapshot
Arguments:
name: my-snapshot
resourceGroupName: my-resource-group
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>
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]
func LookupSnapshot(ctx *Context, args *LookupSnapshotArgs, opts ...InvokeOption) (*LookupSnapshotResult, error)
func LookupSnapshotOutput(ctx *Context, args *LookupSnapshotOutputArgs, opts ...InvokeOption) LookupSnapshotResultOutput
> 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)
}
public static CompletableFuture<GetSnapshotResult> getSnapshot(GetSnapshotArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: azure:compute/getSnapshot:getSnapshot
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- Specifies the name of the Snapshot.
- Resource
Group stringName - Specifies the name of the resource group the Snapshot is located in.
- Name string
- Specifies the name of the Snapshot.
- Resource
Group stringName - Specifies the name of the resource group the Snapshot is located in.
- name String
- Specifies the name of the Snapshot.
- resource
Group StringName - Specifies the name of the resource group the Snapshot is located in.
- name string
- Specifies the name of the Snapshot.
- resource
Group stringName - Specifies the name of the resource group the Snapshot is located in.
- name str
- Specifies the name of the Snapshot.
- resource_
group_ strname - Specifies the name of the resource group the Snapshot is located in.
- name String
- Specifies the name of the Snapshot.
- resource
Group StringName - Specifies the name of the resource group the Snapshot is located in.
getSnapshot Result
The following output properties are available:
- Creation
Option string - Disk
Size intGb - The size of the Snapshotted Disk in GB.
- Encryption
Settings List<GetSnapshot Encryption Setting> - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Os
Type string - Resource
Group stringName - Source
Resource stringId - The reference to an existing snapshot.
- Source
Uri string - The URI to a Managed or Unmanaged Disk.
- Storage
Account stringId - The ID of an storage account.
- Time
Created string - Trusted
Launch boolEnabled - Whether Trusted Launch is enabled for the Snapshot.
- Creation
Option string - Disk
Size intGb - The size of the Snapshotted Disk in GB.
- Encryption
Settings []GetSnapshot Encryption Setting - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Os
Type string - Resource
Group stringName - Source
Resource stringId - The reference to an existing snapshot.
- Source
Uri string - The URI to a Managed or Unmanaged Disk.
- Storage
Account stringId - The ID of an storage account.
- Time
Created string - Trusted
Launch boolEnabled - Whether Trusted Launch is enabled for the Snapshot.
- creation
Option String - disk
Size IntegerGb - The size of the Snapshotted Disk in GB.
- encryption
Settings List<GetSnapshot Encryption Setting> - id String
- The provider-assigned unique ID for this managed resource.
- name String
- os
Type String - resource
Group StringName - source
Resource StringId - The reference to an existing snapshot.
- source
Uri String - The URI to a Managed or Unmanaged Disk.
- storage
Account StringId - The ID of an storage account.
- time
Created String - trusted
Launch BooleanEnabled - Whether Trusted Launch is enabled for the Snapshot.
- creation
Option string - disk
Size numberGb - The size of the Snapshotted Disk in GB.
- encryption
Settings GetSnapshot Encryption Setting[] - id string
- The provider-assigned unique ID for this managed resource.
- name string
- os
Type string - resource
Group stringName - source
Resource stringId - The reference to an existing snapshot.
- source
Uri string - The URI to a Managed or Unmanaged Disk.
- storage
Account stringId - The ID of an storage account.
- time
Created string - trusted
Launch booleanEnabled - Whether Trusted Launch is enabled for the Snapshot.
- creation_
option str - disk_
size_ intgb - The size of the Snapshotted Disk in GB.
- encryption_
settings Sequence[GetSnapshot Encryption Setting] - id str
- The provider-assigned unique ID for this managed resource.
- name str
- os_
type str - resource_
group_ strname - source_
resource_ strid - The reference to an existing snapshot.
- source_
uri str - The URI to a Managed or Unmanaged Disk.
- storage_
account_ strid - The ID of an storage account.
- time_
created str - trusted_
launch_ boolenabled - Whether Trusted Launch is enabled for the Snapshot.
- creation
Option String - disk
Size NumberGb - The size of the Snapshotted Disk in GB.
- encryption
Settings List<Property Map> - id String
- The provider-assigned unique ID for this managed resource.
- name String
- os
Type String - resource
Group StringName - source
Resource StringId - The reference to an existing snapshot.
- source
Uri String - The URI to a Managed or Unmanaged Disk.
- storage
Account StringId - The ID of an storage account.
- time
Created String - trusted
Launch BooleanEnabled - Whether Trusted Launch is enabled for the Snapshot.
Supporting Types
GetSnapshotEncryptionSetting
GetSnapshotEncryptionSettingDiskEncryptionKey
- Secret
Url string - Source
Vault stringId
- Secret
Url string - Source
Vault stringId
- secret
Url String - source
Vault StringId
- secret
Url string - source
Vault stringId
- secret_
url str - source_
vault_ strid
- secret
Url String - source
Vault StringId
GetSnapshotEncryptionSettingKeyEncryptionKey
- Key
Url string - Source
Vault stringId
- Key
Url string - Source
Vault stringId
- key
Url String - source
Vault StringId
- key
Url string - source
Vault stringId
- key_
url str - source_
vault_ strid
- key
Url String - source
Vault StringId
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.