UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

135 lines 6.79 kB
"use strict"; // *** 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.ImageCopy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an IMS image copy resource within HuaweiCloud. * * ## Example Usage * ### Copy image within region * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const sourceImageId = config.requireObject("sourceImageId"); * const name = config.requireObject("name"); * const kmsKeyId = config.requireObject("kmsKeyId"); * const test = new huaweicloud.ims.ImageCopy("test", { * sourceImageId: sourceImageId, * kmsKeyId: kmsKeyId, * }); * ``` * ### Copy image cross region * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const sourceImageId = config.requireObject("sourceImageId"); * const name = config.requireObject("name"); * const targetRegion = config.requireObject("targetRegion"); * const agencyName = config.requireObject("agencyName"); * const test = new huaweicloud.ims.ImageCopy("test", { * sourceImageId: sourceImageId, * targetRegion: targetRegion, * agencyName: agencyName, * }); * ``` */ class ImageCopy extends pulumi.CustomResource { /** * Get an existing ImageCopy 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 ImageCopy(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ImageCopy. 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'] === ImageCopy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["activeAt"] = state ? state.activeAt : undefined; resourceInputs["agencyName"] = state ? state.agencyName : undefined; resourceInputs["checksum"] = state ? state.checksum : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["dataOrigin"] = state ? state.dataOrigin : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["diskFormat"] = state ? state.diskFormat : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["imageSize"] = state ? state.imageSize : undefined; resourceInputs["instanceId"] = state ? state.instanceId : undefined; resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined; resourceInputs["maxRam"] = state ? state.maxRam : undefined; resourceInputs["minDisk"] = state ? state.minDisk : undefined; resourceInputs["minRam"] = state ? state.minRam : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["osVersion"] = state ? state.osVersion : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["sourceImageId"] = state ? state.sourceImageId : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["targetRegion"] = state ? state.targetRegion : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; resourceInputs["vaultId"] = state ? state.vaultId : undefined; resourceInputs["visibility"] = state ? state.visibility : undefined; } else { const args = argsOrState; if ((!args || args.sourceImageId === undefined) && !opts.urn) { throw new Error("Missing required property 'sourceImageId'"); } resourceInputs["agencyName"] = args ? args.agencyName : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined; resourceInputs["kmsKeyId"] = args ? args.kmsKeyId : undefined; resourceInputs["maxRam"] = args ? args.maxRam : undefined; resourceInputs["minRam"] = args ? args.minRam : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["sourceImageId"] = args ? args.sourceImageId : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["targetRegion"] = args ? args.targetRegion : undefined; resourceInputs["vaultId"] = args ? args.vaultId : undefined; resourceInputs["activeAt"] = undefined /*out*/; resourceInputs["checksum"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["dataOrigin"] = undefined /*out*/; resourceInputs["diskFormat"] = undefined /*out*/; resourceInputs["imageSize"] = undefined /*out*/; resourceInputs["instanceId"] = undefined /*out*/; resourceInputs["minDisk"] = undefined /*out*/; resourceInputs["osVersion"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; resourceInputs["visibility"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ImageCopy.__pulumiType, name, resourceInputs, opts); } } exports.ImageCopy = ImageCopy; /** @internal */ ImageCopy.__pulumiType = 'huaweicloud:Ims/imageCopy:ImageCopy'; //# sourceMappingURL=imageCopy.js.map