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

We recommend using Azure Native.

Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi

azure.elasticsan.getVolumeSnapshot

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v6.2.0 published on Friday, Sep 27, 2024 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);
    
    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)
    
    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
    	})
    }
    
    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),
        };
    });
    
    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()));
        }
    }
    
    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}
    

    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>
    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]
    func GetVolumeSnapshot(ctx *Context, args *GetVolumeSnapshotArgs, opts ...InvokeOption) (*GetVolumeSnapshotResult, error)
    func GetVolumeSnapshotOutput(ctx *Context, args *GetVolumeSnapshotOutputArgs, opts ...InvokeOption) GetVolumeSnapshotResultOutput

    > 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)
    }
    public static CompletableFuture<GetVolumeSnapshotResult> getVolumeSnapshot(GetVolumeSnapshotArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:elasticsan/getVolumeSnapshot:getVolumeSnapshot
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the Elastic SAN Volume Snapshot.
    VolumeGroupId string
    The Elastic SAN Volume Group ID within which the Elastic SAN Volume Snapshot exists.
    Name string
    The name of the Elastic SAN Volume Snapshot.
    VolumeGroupId string
    The Elastic SAN Volume Group ID within which the Elastic SAN Volume Snapshot exists.
    name String
    The name of the Elastic SAN Volume Snapshot.
    volumeGroupId String
    The Elastic SAN Volume Group ID within which the Elastic SAN Volume Snapshot exists.
    name string
    The name of the Elastic SAN Volume Snapshot.
    volumeGroupId string
    The Elastic SAN Volume Group ID within which the Elastic SAN Volume Snapshot exists.
    name str
    The name of the Elastic SAN Volume Snapshot.
    volume_group_id str
    The Elastic SAN Volume Group ID within which the Elastic SAN Volume Snapshot exists.
    name String
    The name of the Elastic SAN Volume Snapshot.
    volumeGroupId 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.
    azure logo

    We recommend using Azure Native.

    Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi