1. Packages
  2. Azure Classic
  3. API Docs
  4. elasticsan
  5. getVolumeSnapshot

We recommend using Azure Native.

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

azure.elasticsan.getVolumeSnapshot

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 Elastic SAN Volume Snapshot.

Example Usage

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

const example = azure.elasticsan.get({
    name: "existing",
    resourceGroupName: "existing",
});
const exampleGetVolumeGroup = example.then(example => azure.elasticsan.getVolumeGroup({
    name: "existing",
    elasticSanId: example.id,
}));
const exampleGetVolumeSnapshot = exampleGetVolumeGroup.then(exampleGetVolumeGroup => azure.elasticsan.getVolumeSnapshot({
    name: "existing",
    volumeGroupId: exampleGetVolumeGroup.id,
}));
export const id = exampleGetVolumeSnapshot.then(exampleGetVolumeSnapshot => exampleGetVolumeSnapshot.id);
Copy
import pulumi
import pulumi_azure as azure

example = azure.elasticsan.get(name="existing",
    resource_group_name="existing")
example_get_volume_group = azure.elasticsan.get_volume_group(name="existing",
    elastic_san_id=example.id)
example_get_volume_snapshot = azure.elasticsan.get_volume_snapshot(name="existing",
    volume_group_id=example_get_volume_group.id)
pulumi.export("id", example_get_volume_snapshot.id)
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := elasticsan.Get(ctx, &elasticsan.GetArgs{
			Name:              "existing",
			ResourceGroupName: "existing",
		}, nil)
		if err != nil {
			return err
		}
		exampleGetVolumeGroup, err := elasticsan.LookupVolumeGroup(ctx, &elasticsan.LookupVolumeGroupArgs{
			Name:         "existing",
			ElasticSanId: example.Id,
		}, nil)
		if err != nil {
			return err
		}
		exampleGetVolumeSnapshot, err := elasticsan.GetVolumeSnapshot(ctx, &elasticsan.GetVolumeSnapshotArgs{
			Name:          "existing",
			VolumeGroupId: exampleGetVolumeGroup.Id,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", exampleGetVolumeSnapshot.Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.ElasticSan.Get.Invoke(new()
    {
        Name = "existing",
        ResourceGroupName = "existing",
    });

    var exampleGetVolumeGroup = Azure.ElasticSan.GetVolumeGroup.Invoke(new()
    {
        Name = "existing",
        ElasticSanId = example.Apply(getResult => getResult.Id),
    });

    var exampleGetVolumeSnapshot = Azure.ElasticSan.GetVolumeSnapshot.Invoke(new()
    {
        Name = "existing",
        VolumeGroupId = exampleGetVolumeGroup.Apply(getVolumeGroupResult => getVolumeGroupResult.Id),
    });

    return new Dictionary<string, object?>
    {
        ["id"] = exampleGetVolumeSnapshot.Apply(getVolumeSnapshotResult => getVolumeSnapshotResult.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.elasticsan.ElasticsanFunctions;
import com.pulumi.azure.elasticsan.inputs.GetArgs;
import com.pulumi.azure.elasticsan.inputs.GetVolumeGroupArgs;
import com.pulumi.azure.elasticsan.inputs.GetVolumeSnapshotArgs;
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 = ElasticsanFunctions.get(GetArgs.builder()
            .name("existing")
            .resourceGroupName("existing")
            .build());

        final var exampleGetVolumeGroup = ElasticsanFunctions.getVolumeGroup(GetVolumeGroupArgs.builder()
            .name("existing")
            .elasticSanId(example.applyValue(getResult -> getResult.id()))
            .build());

        final var exampleGetVolumeSnapshot = ElasticsanFunctions.getVolumeSnapshot(GetVolumeSnapshotArgs.builder()
            .name("existing")
            .volumeGroupId(exampleGetVolumeGroup.applyValue(getVolumeGroupResult -> getVolumeGroupResult.id()))
            .build());

        ctx.export("id", exampleGetVolumeSnapshot.applyValue(getVolumeSnapshotResult -> getVolumeSnapshotResult.id()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:elasticsan:get
      arguments:
        name: existing
        resourceGroupName: existing
  exampleGetVolumeGroup:
    fn::invoke:
      function: azure:elasticsan:getVolumeGroup
      arguments:
        name: existing
        elasticSanId: ${example.id}
  exampleGetVolumeSnapshot:
    fn::invoke:
      function: azure:elasticsan:getVolumeSnapshot
      arguments:
        name: existing
        volumeGroupId: ${exampleGetVolumeGroup.id}
outputs:
  id: ${exampleGetVolumeSnapshot.id}
Copy

Using getVolumeSnapshot

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 getVolumeSnapshot(args: GetVolumeSnapshotArgs, opts?: InvokeOptions): Promise<GetVolumeSnapshotResult>
function getVolumeSnapshotOutput(args: GetVolumeSnapshotOutputArgs, opts?: InvokeOptions): Output<GetVolumeSnapshotResult>
Copy
def get_volume_snapshot(name: Optional[str] = None,
                        volume_group_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetVolumeSnapshotResult
def get_volume_snapshot_output(name: Optional[pulumi.Input[str]] = None,
                        volume_group_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetVolumeSnapshotResult]
Copy
func GetVolumeSnapshot(ctx *Context, args *GetVolumeSnapshotArgs, opts ...InvokeOption) (*GetVolumeSnapshotResult, error)
func GetVolumeSnapshotOutput(ctx *Context, args *GetVolumeSnapshotOutputArgs, opts ...InvokeOption) GetVolumeSnapshotResultOutput
Copy

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

public static class GetVolumeSnapshot 
{
    public static Task<GetVolumeSnapshotResult> InvokeAsync(GetVolumeSnapshotArgs args, InvokeOptions? opts = null)
    public static Output<GetVolumeSnapshotResult> Invoke(GetVolumeSnapshotInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetVolumeSnapshotResult> getVolumeSnapshot(GetVolumeSnapshotArgs args, InvokeOptions options)
public static Output<GetVolumeSnapshotResult> getVolumeSnapshot(GetVolumeSnapshotArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:elasticsan/getVolumeSnapshot:getVolumeSnapshot
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
The name of the Elastic SAN Volume Snapshot.
VolumeGroupId
This property is required.
Changes to this property will trigger replacement.
string
The Elastic SAN Volume Group ID within which the Elastic SAN Volume Snapshot exists.
Name This property is required. string
The name of the Elastic SAN Volume Snapshot.
VolumeGroupId
This property is required.
Changes to this property will trigger replacement.
string
The Elastic SAN Volume Group ID within which the Elastic SAN Volume Snapshot exists.
name This property is required. String
The name of the Elastic SAN Volume Snapshot.
volumeGroupId
This property is required.
Changes to this property will trigger replacement.
String
The Elastic SAN Volume Group ID within which the Elastic SAN Volume Snapshot exists.
name This property is required. string
The name of the Elastic SAN Volume Snapshot.
volumeGroupId
This property is required.
Changes to this property will trigger replacement.
string
The Elastic SAN Volume Group ID within which the Elastic SAN Volume Snapshot exists.
name This property is required. str
The name of the Elastic SAN Volume Snapshot.
volume_group_id
This property is required.
Changes to this property will trigger replacement.
str
The Elastic SAN Volume Group ID within which the Elastic SAN Volume Snapshot exists.
name This property is required. String
The name of the Elastic SAN Volume Snapshot.
volumeGroupId
This property is required.
Changes to this property will trigger replacement.
String
The Elastic SAN Volume Group ID within which the Elastic SAN Volume Snapshot exists.

getVolumeSnapshot Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Name string
SourceId string
The resource ID from which the Snapshot is created.
SourceVolumeSizeInGib int
The size of source volume.
VolumeGroupId string
VolumeName string
The source volume name of the Snapshot.
Id string
The provider-assigned unique ID for this managed resource.
Name string
SourceId string
The resource ID from which the Snapshot is created.
SourceVolumeSizeInGib int
The size of source volume.
VolumeGroupId string
VolumeName string
The source volume name of the Snapshot.
id String
The provider-assigned unique ID for this managed resource.
name String
sourceId String
The resource ID from which the Snapshot is created.
sourceVolumeSizeInGib Integer
The size of source volume.
volumeGroupId String
volumeName String
The source volume name of the Snapshot.
id string
The provider-assigned unique ID for this managed resource.
name string
sourceId string
The resource ID from which the Snapshot is created.
sourceVolumeSizeInGib number
The size of source volume.
volumeGroupId string
volumeName string
The source volume name of the Snapshot.
id str
The provider-assigned unique ID for this managed resource.
name str
source_id str
The resource ID from which the Snapshot is created.
source_volume_size_in_gib int
The size of source volume.
volume_group_id str
volume_name str
The source volume name of the Snapshot.
id String
The provider-assigned unique ID for this managed resource.
name String
sourceId String
The resource ID from which the Snapshot is created.
sourceVolumeSizeInGib Number
The size of source volume.
volumeGroupId String
volumeName String
The source volume name of the Snapshot.

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