1. Packages
  2. DigitalOcean
  3. API Docs
  4. VolumeSnapshot
DigitalOcean v4.27.0 published on Wednesday, Mar 13, 2024 by Pulumi

digitalocean.VolumeSnapshot

Explore with Pulumi AI

digitalocean logo
DigitalOcean v4.27.0 published on Wednesday, Mar 13, 2024 by Pulumi

    Provides a DigitalOcean Volume Snapshot which can be used to create a snapshot from an existing volume.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const foobarVolume = new digitalocean.Volume("foobarVolume", {
        region: "nyc1",
        size: 100,
        description: "an example volume",
    });
    const foobarVolumeSnapshot = new digitalocean.VolumeSnapshot("foobarVolumeSnapshot", {volumeId: foobarVolume.id});
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    foobar_volume = digitalocean.Volume("foobarVolume",
        region="nyc1",
        size=100,
        description="an example volume")
    foobar_volume_snapshot = digitalocean.VolumeSnapshot("foobarVolumeSnapshot", volume_id=foobar_volume.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foobarVolume, err := digitalocean.NewVolume(ctx, "foobarVolume", &digitalocean.VolumeArgs{
    			Region:      pulumi.String("nyc1"),
    			Size:        pulumi.Int(100),
    			Description: pulumi.String("an example volume"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = digitalocean.NewVolumeSnapshot(ctx, "foobarVolumeSnapshot", &digitalocean.VolumeSnapshotArgs{
    			VolumeId: foobarVolume.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DigitalOcean = Pulumi.DigitalOcean;
    
    return await Deployment.RunAsync(() => 
    {
        var foobarVolume = new DigitalOcean.Volume("foobarVolume", new()
        {
            Region = "nyc1",
            Size = 100,
            Description = "an example volume",
        });
    
        var foobarVolumeSnapshot = new DigitalOcean.VolumeSnapshot("foobarVolumeSnapshot", new()
        {
            VolumeId = foobarVolume.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.digitalocean.Volume;
    import com.pulumi.digitalocean.VolumeArgs;
    import com.pulumi.digitalocean.VolumeSnapshot;
    import com.pulumi.digitalocean.VolumeSnapshotArgs;
    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) {
            var foobarVolume = new Volume("foobarVolume", VolumeArgs.builder()        
                .region("nyc1")
                .size(100)
                .description("an example volume")
                .build());
    
            var foobarVolumeSnapshot = new VolumeSnapshot("foobarVolumeSnapshot", VolumeSnapshotArgs.builder()        
                .volumeId(foobarVolume.id())
                .build());
    
        }
    }
    
    resources:
      foobarVolume:
        type: digitalocean:Volume
        properties:
          region: nyc1
          size: 100
          description: an example volume
      foobarVolumeSnapshot:
        type: digitalocean:VolumeSnapshot
        properties:
          volumeId: ${foobarVolume.id}
    

    Create VolumeSnapshot Resource

    new VolumeSnapshot(name: string, args: VolumeSnapshotArgs, opts?: CustomResourceOptions);
    @overload
    def VolumeSnapshot(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       name: Optional[str] = None,
                       tags: Optional[Sequence[str]] = None,
                       volume_id: Optional[str] = None)
    @overload
    def VolumeSnapshot(resource_name: str,
                       args: VolumeSnapshotArgs,
                       opts: Optional[ResourceOptions] = None)
    func NewVolumeSnapshot(ctx *Context, name string, args VolumeSnapshotArgs, opts ...ResourceOption) (*VolumeSnapshot, error)
    public VolumeSnapshot(string name, VolumeSnapshotArgs args, CustomResourceOptions? opts = null)
    public VolumeSnapshot(String name, VolumeSnapshotArgs args)
    public VolumeSnapshot(String name, VolumeSnapshotArgs args, CustomResourceOptions options)
    
    type: digitalocean:VolumeSnapshot
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args VolumeSnapshotArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args VolumeSnapshotArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args VolumeSnapshotArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VolumeSnapshotArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VolumeSnapshotArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    VolumeSnapshot Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The VolumeSnapshot resource accepts the following input properties:

    VolumeId string
    The ID of the volume from which the volume snapshot originated.
    Name string
    A name for the volume snapshot.
    Tags List<string>
    A list of the tags to be applied to this volume snapshot.
    VolumeId string
    The ID of the volume from which the volume snapshot originated.
    Name string
    A name for the volume snapshot.
    Tags []string
    A list of the tags to be applied to this volume snapshot.
    volumeId String
    The ID of the volume from which the volume snapshot originated.
    name String
    A name for the volume snapshot.
    tags List<String>
    A list of the tags to be applied to this volume snapshot.
    volumeId string
    The ID of the volume from which the volume snapshot originated.
    name string
    A name for the volume snapshot.
    tags string[]
    A list of the tags to be applied to this volume snapshot.
    volume_id str
    The ID of the volume from which the volume snapshot originated.
    name str
    A name for the volume snapshot.
    tags Sequence[str]
    A list of the tags to be applied to this volume snapshot.
    volumeId String
    The ID of the volume from which the volume snapshot originated.
    name String
    A name for the volume snapshot.
    tags List<String>
    A list of the tags to be applied to this volume snapshot.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VolumeSnapshot resource produces the following output properties:

    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.
    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.
    createdAt String
    The date and time the volume snapshot was created.
    id String
    The provider-assigned unique ID for this managed resource.
    minDiskSize Integer
    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.
    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.
    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 int
    The minimum size in gigabytes required for a volume to be created based on this volume snapshot.
    regions Sequence[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.
    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 List<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.

    Look up Existing VolumeSnapshot Resource

    Get an existing VolumeSnapshot resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: VolumeSnapshotState, opts?: CustomResourceOptions): VolumeSnapshot
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            min_disk_size: Optional[int] = None,
            name: Optional[str] = None,
            regions: Optional[Sequence[str]] = None,
            size: Optional[float] = None,
            tags: Optional[Sequence[str]] = None,
            volume_id: Optional[str] = None) -> VolumeSnapshot
    func GetVolumeSnapshot(ctx *Context, name string, id IDInput, state *VolumeSnapshotState, opts ...ResourceOption) (*VolumeSnapshot, error)
    public static VolumeSnapshot Get(string name, Input<string> id, VolumeSnapshotState? state, CustomResourceOptions? opts = null)
    public static VolumeSnapshot get(String name, Output<String> id, VolumeSnapshotState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CreatedAt string
    The date and time the volume snapshot was created.
    MinDiskSize int
    The minimum size in gigabytes required for a volume to be created based on this volume snapshot.
    Name string
    A name for the 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 to be applied to this volume snapshot.
    VolumeId string
    The ID of the volume from which the volume snapshot originated.
    CreatedAt string
    The date and time the volume snapshot was created.
    MinDiskSize int
    The minimum size in gigabytes required for a volume to be created based on this volume snapshot.
    Name string
    A name for the 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 to be applied to this volume snapshot.
    VolumeId string
    The ID of the volume from which the volume snapshot originated.
    createdAt String
    The date and time the volume snapshot was created.
    minDiskSize Integer
    The minimum size in gigabytes required for a volume to be created based on this volume snapshot.
    name String
    A name for the 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 to be applied to this volume snapshot.
    volumeId String
    The ID of the volume from which the volume snapshot originated.
    createdAt string
    The date and time the volume snapshot was created.
    minDiskSize number
    The minimum size in gigabytes required for a volume to be created based on this volume snapshot.
    name string
    A name for the 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 to be applied to this volume snapshot.
    volumeId string
    The ID of the volume from which the volume snapshot originated.
    created_at str
    The date and time the volume snapshot was created.
    min_disk_size int
    The minimum size in gigabytes required for a volume to be created based on this volume snapshot.
    name str
    A name for the volume snapshot.
    regions Sequence[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 Sequence[str]
    A list of the tags to be applied to this volume snapshot.
    volume_id str
    The ID of the volume from which the volume snapshot originated.
    createdAt String
    The date and time the volume snapshot was created.
    minDiskSize Number
    The minimum size in gigabytes required for a volume to be created based on this volume snapshot.
    name String
    A name for the volume snapshot.
    regions List<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 List<String>
    A list of the tags to be applied to this volume snapshot.
    volumeId String
    The ID of the volume from which the volume snapshot originated.

    Import

    Volume Snapshots can be imported using the snapshot id, e.g.

    $ pulumi import digitalocean:index/volumeSnapshot:VolumeSnapshot snapshot 506f78a4-e098-11e5-ad9f-000f53306ae1
    

    Package Details

    Repository
    DigitalOcean pulumi/pulumi-digitalocean
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the digitalocean Terraform Provider.
    digitalocean logo
    DigitalOcean v4.27.0 published on Wednesday, Mar 13, 2024 by Pulumi