GetVolumeSnapshot

Volume snapshots are saved instances of a block storage volume. Use this data source to retrieve the ID of a DigitalOcean volume snapshot for use in other resources.

Example Usage

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var snapshot = Output.Create(DigitalOcean.GetVolumeSnapshot.InvokeAsync(new DigitalOcean.GetVolumeSnapshotArgs
        {
            MostRecent = true,
            NameRegex = "^web",
            Region = "nyc3",
        }));
    }

}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

snapshot = digitalocean.get_volume_snapshot(most_recent=True,
    name_regex="^web",
    region="nyc3")
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const snapshot = pulumi.output(digitalocean.getVolumeSnapshot({
    mostRecent: true,
    nameRegex: "^web",
    region: "nyc3",
}, { async: true }));

Using GetVolumeSnapshot

function getVolumeSnapshot(args: GetVolumeSnapshotArgs, opts?: InvokeOptions): Promise<GetVolumeSnapshotResult>
function  get_volume_snapshot(most_recent=None, name=None, name_regex=None, region=None, opts=None)
func LookupVolumeSnapshot(ctx *Context, args *LookupVolumeSnapshotArgs, opts ...InvokeOption) (*LookupVolumeSnapshotResult, error)

Note: This function is named LookupVolumeSnapshot in the Go SDK.

public static class GetVolumeSnapshot {
    public static Task<GetVolumeSnapshotResult> InvokeAsync(GetVolumeSnapshotArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

MostRecent bool

If more than one result is returned, use the most recent volume snapshot.

Name string

The name of the volume snapshot.

NameRegex string

A regex string to apply to the volume snapshot list returned by DigitalOcean. This allows more advanced filtering not supported from the DigitalOcean API. This filtering is done locally on what DigitalOcean returns.

Region string

A “slug” representing a DigitalOcean region (e.g. nyc1). If set, only volume snapshots available in the region will be returned.

MostRecent bool

If more than one result is returned, use the most recent volume snapshot.

Name string

The name of the volume snapshot.

NameRegex string

A regex string to apply to the volume snapshot list returned by DigitalOcean. This allows more advanced filtering not supported from the DigitalOcean API. This filtering is done locally on what DigitalOcean returns.

Region string

A “slug” representing a DigitalOcean region (e.g. nyc1). If set, only volume snapshots available in the region will be returned.

mostRecent boolean

If more than one result is returned, use the most recent volume snapshot.

name string

The name of the volume snapshot.

nameRegex string

A regex string to apply to the volume snapshot list returned by DigitalOcean. This allows more advanced filtering not supported from the DigitalOcean API. This filtering is done locally on what DigitalOcean returns.

region string

A “slug” representing a DigitalOcean region (e.g. nyc1). If set, only volume snapshots available in the region will be returned.

most_recent bool

If more than one result is returned, use the most recent volume snapshot.

name str

The name of the volume snapshot.

name_regex str

A regex string to apply to the volume snapshot list returned by DigitalOcean. This allows more advanced filtering not supported from the DigitalOcean API. This filtering is done locally on what DigitalOcean returns.

region str

A “slug” representing a DigitalOcean region (e.g. nyc1). If set, only volume snapshots available in the region will be returned.

GetVolumeSnapshot Result

The following output properties are available:

CreatedAt string

The date and time the volume snapshot was created.

Id string

The provider-assigned unique ID for this managed resource.

MinDiskSize int

The minimum size in gigabytes required for a volume to be created based on this volume snapshot.

Regions List<string>

A list of DigitalOcean region “slugs” indicating where the volume snapshot is available.

Size double

The billable size of the volume snapshot in gigabytes.

Tags List<string>

A list of the tags associated to the volume snapshot.

VolumeId string

The ID of the volume from which the volume snapshot originated.

MostRecent bool
Name string
NameRegex string
Region string
CreatedAt string

The date and time the volume snapshot was created.

Id string

The provider-assigned unique ID for this managed resource.

MinDiskSize int

The minimum size in gigabytes required for a volume to be created based on this volume snapshot.

Regions []string

A list of DigitalOcean region “slugs” indicating where the volume snapshot is available.

Size float64

The billable size of the volume snapshot in gigabytes.

Tags []string

A list of the tags associated to the volume snapshot.

VolumeId string

The ID of the volume from which the volume snapshot originated.

MostRecent bool
Name string
NameRegex string
Region string
createdAt string

The date and time the volume snapshot was created.

id string

The provider-assigned unique ID for this managed resource.

minDiskSize number

The minimum size in gigabytes required for a volume to be created based on this volume snapshot.

regions string[]

A list of DigitalOcean region “slugs” indicating where the volume snapshot is available.

size number

The billable size of the volume snapshot in gigabytes.

tags string[]

A list of the tags associated to the volume snapshot.

volumeId string

The ID of the volume from which the volume snapshot originated.

mostRecent boolean
name string
nameRegex string
region string
created_at str

The date and time the volume snapshot was created.

id str

The provider-assigned unique ID for this managed resource.

min_disk_size float

The minimum size in gigabytes required for a volume to be created based on this volume snapshot.

regions List[str]

A list of DigitalOcean region “slugs” indicating where the volume snapshot is available.

size float

The billable size of the volume snapshot in gigabytes.

tags List[str]

A list of the tags associated to the volume snapshot.

volume_id str

The ID of the volume from which the volume snapshot originated.

most_recent bool
name str
name_regex str
region str

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.