@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
119 lines • 5.04 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Snapshot = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an EVS snapshot resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const testVolume = new huaweicloud.evs.Volume("testVolume", {
* description: "my volume",
* volumeType: "SATA",
* size: 20,
* availabilityZone: "cn-north-4a",
* tags: {
* foo: "bar",
* key: "value",
* },
* });
* const testSnapshot = new huaweicloud.evs.Snapshot("testSnapshot", {
* description: "Daily backup",
* volumeId: testVolume.id,
* });
* ```
*
* ## Import
*
* EVS snapshot can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Evs/snapshot:Snapshot test <id>
* ```
*
* Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`metadata`, `force`. It is generally recommended running `terraform plan` after importing the resource. You can then decide if changes should be applied to the resource, or the resource definition should be updated to align with the snapshot. Also, you can ignore changes as below. hcl resource "huaweicloud_evs_snapshot" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* metadata, force,
*
* ]
*
* } }
*/
class Snapshot extends pulumi.CustomResource {
/**
* Get an existing Snapshot 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 Snapshot(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Snapshot. 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'] === Snapshot.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["force"] = state ? state.force : undefined;
resourceInputs["metadata"] = state ? state.metadata : undefined;
resourceInputs["metadataOrigin"] = state ? state.metadataOrigin : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["size"] = state ? state.size : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
resourceInputs["volumeId"] = state ? state.volumeId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.volumeId === undefined) && !opts.urn) {
throw new Error("Missing required property 'volumeId'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["force"] = args ? args.force : undefined;
resourceInputs["metadata"] = args ? args.metadata : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["volumeId"] = args ? args.volumeId : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["metadataOrigin"] = undefined /*out*/;
resourceInputs["size"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Snapshot.__pulumiType, name, resourceInputs, opts);
}
}
exports.Snapshot = Snapshot;
/** @internal */
Snapshot.__pulumiType = 'huaweicloud:Evs/snapshot:Snapshot';
//# sourceMappingURL=snapshot.js.map