UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

146 lines 6.15 kB
"use strict"; // *** 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.VolumeSnapshot = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * NetApp Volumes helps you manage your data usage with snapshots that can quickly restore lost data. * Snapshots are point-in-time versions of your volume's content. They are resources of volumes and are * instant captures of your data that consume space only for modified data. Because data changes over * time, snapshots usually consume more space as they get older. * NetApp Volumes volumes use just-in-time copy-on-write so that unmodified files in snapshots don't * consume any of the volume's capacity. * * To get more information about VolumeSnapshot, see: * * * [API documentation](https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.volumes.snapshots) * * How-to Guides * * [Documentation](https://cloud.google.com/netapp/volumes/docs/configure-and-use/volume-snapshots/overview) * * ## Example Usage * * ### Volume Snapshot Create * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = gcp.compute.getNetwork({ * name: "test-network", * }); * const defaultStoragePool = new gcp.netapp.StoragePool("default", { * name: "test-pool", * location: "us-west2", * serviceLevel: "PREMIUM", * capacityGib: "2048", * network: _default.then(_default => _default.id), * }); * const defaultVolume = new gcp.netapp.Volume("default", { * location: defaultStoragePool.location, * name: "test-volume", * capacityGib: "100", * shareName: "test-volume", * storagePool: defaultStoragePool.name, * protocols: ["NFSV3"], * }); * const testSnapshot = new gcp.netapp.VolumeSnapshot("test_snapshot", { * location: defaultVolume.location, * volumeName: defaultVolume.name, * name: "testvolumesnap", * }, { * dependsOn: [defaultVolume], * }); * ``` * * ## Import * * VolumeSnapshot can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/volumes/{{volume_name}}/snapshots/{{name}}` * * * `{{project}}/{{location}}/{{volume_name}}/{{name}}` * * * `{{location}}/{{volume_name}}/{{name}}` * * When using the `pulumi import` command, VolumeSnapshot can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:netapp/volumeSnapshot:VolumeSnapshot default projects/{{project}}/locations/{{location}}/volumes/{{volume_name}}/snapshots/{{name}} * ``` * * ```sh * $ pulumi import gcp:netapp/volumeSnapshot:VolumeSnapshot default {{project}}/{{location}}/{{volume_name}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:netapp/volumeSnapshot:VolumeSnapshot default {{location}}/{{volume_name}}/{{name}} * ``` */ class VolumeSnapshot extends pulumi.CustomResource { /** * Get an existing VolumeSnapshot resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new VolumeSnapshot(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of VolumeSnapshot. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === VolumeSnapshot.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state?.description; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["usedBytes"] = state?.usedBytes; resourceInputs["volumeName"] = state?.volumeName; } else { const args = argsOrState; if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.volumeName === undefined && !opts.urn) { throw new Error("Missing required property 'volumeName'"); } resourceInputs["description"] = args?.description; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["project"] = args?.project; resourceInputs["volumeName"] = args?.volumeName; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["usedBytes"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(VolumeSnapshot.__pulumiType, name, resourceInputs, opts); } } exports.VolumeSnapshot = VolumeSnapshot; /** @internal */ VolumeSnapshot.__pulumiType = 'gcp:netapp/volumeSnapshot:VolumeSnapshot'; //# sourceMappingURL=volumeSnapshot.js.map