@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
191 lines • 8.66 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.VolumeReplication = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* ## Example Usage
*
* ### Netapp Volume Replication Create
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = gcp.compute.getNetwork({
* name: "test-network",
* });
* const sourcePool = new gcp.netapp.StoragePool("source_pool", {
* name: "source-pool",
* location: "us-central1",
* serviceLevel: "PREMIUM",
* capacityGib: "2048",
* network: _default.then(_default => _default.id),
* });
* const destinationPool = new gcp.netapp.StoragePool("destination_pool", {
* name: "destination-pool",
* location: "us-west2",
* serviceLevel: "PREMIUM",
* capacityGib: "2048",
* network: _default.then(_default => _default.id),
* allowAutoTiering: true,
* });
* const sourceVolume = new gcp.netapp.Volume("source_volume", {
* location: sourcePool.location,
* name: "source-volume",
* capacityGib: "100",
* shareName: "source-volume",
* storagePool: sourcePool.name,
* protocols: ["NFSV3"],
* deletionPolicy: "FORCE",
* });
* const testReplication = new gcp.netapp.VolumeReplication("test_replication", {
* location: sourceVolume.location,
* volumeName: sourceVolume.name,
* name: "test-replication",
* replicationSchedule: "EVERY_10_MINUTES",
* description: "This is a replication resource",
* destinationVolumeParameters: {
* storagePool: destinationPool.id,
* volumeId: "destination-volume",
* shareName: "source-volume",
* description: "This is a replicated volume",
* tieringPolicy: {
* coolingThresholdDays: 20,
* tierAction: "ENABLED",
* },
* },
* deleteDestinationVolume: true,
* waitForMirror: true,
* }, {
* dependsOn: [sourceVolume],
* });
* ```
*
* ## Import
*
* VolumeReplication can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/volumes/{{volume_name}}/replications/{{name}}`
*
* * `{{project}}/{{location}}/{{volume_name}}/{{name}}`
*
* * `{{location}}/{{volume_name}}/{{name}}`
*
* When using the `pulumi import` command, VolumeReplication can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:netapp/volumeReplication:VolumeReplication default projects/{{project}}/locations/{{location}}/volumes/{{volume_name}}/replications/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:netapp/volumeReplication:VolumeReplication default {{project}}/{{location}}/{{volume_name}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:netapp/volumeReplication:VolumeReplication default {{location}}/{{volume_name}}/{{name}}
* ```
*/
class VolumeReplication extends pulumi.CustomResource {
/**
* Get an existing VolumeReplication 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 VolumeReplication(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of VolumeReplication. 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'] === VolumeReplication.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["deleteDestinationVolume"] = state?.deleteDestinationVolume;
resourceInputs["description"] = state?.description;
resourceInputs["destinationVolume"] = state?.destinationVolume;
resourceInputs["destinationVolumeParameters"] = state?.destinationVolumeParameters;
resourceInputs["effectiveLabels"] = state?.effectiveLabels;
resourceInputs["forceStopping"] = state?.forceStopping;
resourceInputs["healthy"] = state?.healthy;
resourceInputs["hybridPeeringDetails"] = state?.hybridPeeringDetails;
resourceInputs["hybridReplicationType"] = state?.hybridReplicationType;
resourceInputs["labels"] = state?.labels;
resourceInputs["location"] = state?.location;
resourceInputs["mirrorState"] = state?.mirrorState;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["pulumiLabels"] = state?.pulumiLabels;
resourceInputs["replicationEnabled"] = state?.replicationEnabled;
resourceInputs["replicationSchedule"] = state?.replicationSchedule;
resourceInputs["role"] = state?.role;
resourceInputs["sourceVolume"] = state?.sourceVolume;
resourceInputs["state"] = state?.state;
resourceInputs["stateDetails"] = state?.stateDetails;
resourceInputs["transferStats"] = state?.transferStats;
resourceInputs["volumeName"] = state?.volumeName;
resourceInputs["waitForMirror"] = state?.waitForMirror;
}
else {
const args = argsOrState;
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if (args?.replicationSchedule === undefined && !opts.urn) {
throw new Error("Missing required property 'replicationSchedule'");
}
if (args?.volumeName === undefined && !opts.urn) {
throw new Error("Missing required property 'volumeName'");
}
resourceInputs["deleteDestinationVolume"] = args?.deleteDestinationVolume;
resourceInputs["description"] = args?.description;
resourceInputs["destinationVolumeParameters"] = args?.destinationVolumeParameters;
resourceInputs["forceStopping"] = args?.forceStopping;
resourceInputs["labels"] = args?.labels;
resourceInputs["location"] = args?.location;
resourceInputs["name"] = args?.name;
resourceInputs["project"] = args?.project;
resourceInputs["replicationEnabled"] = args?.replicationEnabled;
resourceInputs["replicationSchedule"] = args?.replicationSchedule;
resourceInputs["volumeName"] = args?.volumeName;
resourceInputs["waitForMirror"] = args?.waitForMirror;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["destinationVolume"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["healthy"] = undefined /*out*/;
resourceInputs["hybridPeeringDetails"] = undefined /*out*/;
resourceInputs["hybridReplicationType"] = undefined /*out*/;
resourceInputs["mirrorState"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["role"] = undefined /*out*/;
resourceInputs["sourceVolume"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["stateDetails"] = undefined /*out*/;
resourceInputs["transferStats"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(VolumeReplication.__pulumiType, name, resourceInputs, opts);
}
}
exports.VolumeReplication = VolumeReplication;
/** @internal */
VolumeReplication.__pulumiType = 'gcp:netapp/volumeReplication:VolumeReplication';
//# sourceMappingURL=volumeReplication.js.map
;