digitalocean.VolumeSnapshot
Explore with Pulumi AI
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 foobar = new digitalocean.Volume("foobar", {
region: digitalocean.Region.NYC1,
name: "baz",
size: 100,
description: "an example volume",
});
const foobarVolumeSnapshot = new digitalocean.VolumeSnapshot("foobar", {
name: "foo",
volumeId: foobar.id,
});
import pulumi
import pulumi_digitalocean as digitalocean
foobar = digitalocean.Volume("foobar",
region=digitalocean.Region.NYC1,
name="baz",
size=100,
description="an example volume")
foobar_volume_snapshot = digitalocean.VolumeSnapshot("foobar",
name="foo",
volume_id=foobar.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 {
foobar, err := digitalocean.NewVolume(ctx, "foobar", &digitalocean.VolumeArgs{
Region: pulumi.String(digitalocean.RegionNYC1),
Name: pulumi.String("baz"),
Size: pulumi.Int(100),
Description: pulumi.String("an example volume"),
})
if err != nil {
return err
}
_, err = digitalocean.NewVolumeSnapshot(ctx, "foobar", &digitalocean.VolumeSnapshotArgs{
Name: pulumi.String("foo"),
VolumeId: foobar.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 foobar = new DigitalOcean.Volume("foobar", new()
{
Region = DigitalOcean.Region.NYC1,
Name = "baz",
Size = 100,
Description = "an example volume",
});
var foobarVolumeSnapshot = new DigitalOcean.VolumeSnapshot("foobar", new()
{
Name = "foo",
VolumeId = foobar.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 foobar = new Volume("foobar", VolumeArgs.builder()
.region("nyc1")
.name("baz")
.size(100)
.description("an example volume")
.build());
var foobarVolumeSnapshot = new VolumeSnapshot("foobarVolumeSnapshot", VolumeSnapshotArgs.builder()
.name("foo")
.volumeId(foobar.id())
.build());
}
}
resources:
foobar:
type: digitalocean:Volume
properties:
region: nyc1
name: baz
size: 100
description: an example volume
foobarVolumeSnapshot:
type: digitalocean:VolumeSnapshot
name: foobar
properties:
name: foo
volumeId: ${foobar.id}
Create VolumeSnapshot Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VolumeSnapshot(name: string, args: VolumeSnapshotArgs, opts?: CustomResourceOptions);
@overload
def VolumeSnapshot(resource_name: str,
args: VolumeSnapshotArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VolumeSnapshot(resource_name: str,
opts: Optional[ResourceOptions] = None,
volume_id: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[Sequence[str]] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var volumeSnapshotResource = new DigitalOcean.VolumeSnapshot("volumeSnapshotResource", new()
{
VolumeId = "string",
Name = "string",
Tags = new[]
{
"string",
},
});
example, err := digitalocean.NewVolumeSnapshot(ctx, "volumeSnapshotResource", &digitalocean.VolumeSnapshotArgs{
VolumeId: pulumi.String("string"),
Name: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
})
var volumeSnapshotResource = new VolumeSnapshot("volumeSnapshotResource", VolumeSnapshotArgs.builder()
.volumeId("string")
.name("string")
.tags("string")
.build());
volume_snapshot_resource = digitalocean.VolumeSnapshot("volumeSnapshotResource",
volume_id="string",
name="string",
tags=["string"])
const volumeSnapshotResource = new digitalocean.VolumeSnapshot("volumeSnapshotResource", {
volumeId: "string",
name: "string",
tags: ["string"],
});
type: digitalocean:VolumeSnapshot
properties:
name: string
tags:
- string
volumeId: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VolumeSnapshot resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the VolumeSnapshot resource produces the following output properties:
- Created
At string - The date and time the volume snapshot was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Min
Disk intSize - 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.
- Created
At string - The date and time the volume snapshot was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Min
Disk intSize - 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.
- created
At String - The date and time the volume snapshot was created.
- id String
- The provider-assigned unique ID for this managed resource.
- min
Disk IntegerSize - 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.
- created
At string - The date and time the volume snapshot was created.
- id string
- The provider-assigned unique ID for this managed resource.
- min
Disk numberSize - 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_ intsize - 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.
- created
At String - The date and time the volume snapshot was created.
- id String
- The provider-assigned unique ID for this managed resource.
- min
Disk NumberSize - 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.
- Created
At string - The date and time the volume snapshot was created.
- Min
Disk intSize - 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.
- List<string>
- A list of the tags to be applied to this volume snapshot.
- Volume
Id string - The ID of the volume from which the volume snapshot originated.
- Created
At string - The date and time the volume snapshot was created.
- Min
Disk intSize - 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.
- []string
- A list of the tags to be applied to this volume snapshot.
- Volume
Id string - The ID of the volume from which the volume snapshot originated.
- created
At String - The date and time the volume snapshot was created.
- min
Disk IntegerSize - 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.
- List<String>
- A list of the tags to be applied to this volume snapshot.
- volume
Id String - The ID of the volume from which the volume snapshot originated.
- created
At string - The date and time the volume snapshot was created.
- min
Disk numberSize - 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.
- string[]
- A list of the tags to be applied to this volume snapshot.
- volume
Id 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_ intsize - 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.
- 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.
- created
At String - The date and time the volume snapshot was created.
- min
Disk NumberSize - 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.
- List<String>
- A list of the tags to be applied to this volume snapshot.
- volume
Id 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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitalocean
Terraform Provider.