@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
108 lines • 3.42 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getVolumeSnapshotOutput = exports.getVolumeSnapshot = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* 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
*
* Get the volume snapshot:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const snapshot = digitalocean.getVolumeSnapshot({
* nameRegex: "^web",
* region: "nyc3",
* mostRecent: true,
* });
* ```
*
* Reuse the data about a volume snapshot to create a new volume based on it:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const snapshot = digitalocean.getVolumeSnapshot({
* nameRegex: "^web",
* region: "nyc3",
* mostRecent: true,
* });
* const foobar = new digitalocean.Volume("foobar", {
* region: digitalocean.Region.NYC3,
* name: "baz",
* size: 100,
* snapshotId: snapshot.then(snapshot => snapshot.id),
* });
* ```
*/
function getVolumeSnapshot(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("digitalocean:index/getVolumeSnapshot:getVolumeSnapshot", {
"mostRecent": args.mostRecent,
"name": args.name,
"nameRegex": args.nameRegex,
"region": args.region,
}, opts);
}
exports.getVolumeSnapshot = 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
*
* Get the volume snapshot:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const snapshot = digitalocean.getVolumeSnapshot({
* nameRegex: "^web",
* region: "nyc3",
* mostRecent: true,
* });
* ```
*
* Reuse the data about a volume snapshot to create a new volume based on it:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const snapshot = digitalocean.getVolumeSnapshot({
* nameRegex: "^web",
* region: "nyc3",
* mostRecent: true,
* });
* const foobar = new digitalocean.Volume("foobar", {
* region: digitalocean.Region.NYC3,
* name: "baz",
* size: 100,
* snapshotId: snapshot.then(snapshot => snapshot.id),
* });
* ```
*/
function getVolumeSnapshotOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("digitalocean:index/getVolumeSnapshot:getVolumeSnapshot", {
"mostRecent": args.mostRecent,
"name": args.name,
"nameRegex": args.nameRegex,
"region": args.region,
}, opts);
}
exports.getVolumeSnapshotOutput = getVolumeSnapshotOutput;
//# sourceMappingURL=getVolumeSnapshot.js.map