@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
106 lines • 4.72 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.ImageExport = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an IMS image export resource within HuaweiCloud.
*
* > 1. The whole image, ISO image, private images created by public images of Windows, SUSE, Red Hat, Ubuntu, and
* > Oracle Linux, and private images created by market images are not allowed to be exported.
* > <br/>2. The image size must be less than `1` TB. The images larger than `128` GB only support fast export, the
* > maximum image size supported for export in some regions may be greater than `128` GB, please refer to the actual
* > operation prompts on the console for accuracy.<br/>3. Destroying resource does not change the current action of the
* > image export resource.
*
* ## Example Usage
* ### Ordinary export image
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const imageId = config.requireObject("imageId");
* const bucketUrl = config.requireObject("bucketUrl");
* const fileFormat = config.requireObject("fileFormat");
* const test = new huaweicloud.ims.ImageExport("test", {
* imageId: imageId,
* bucketUrl: bucketUrl,
* fileFormat: fileFormat,
* });
* ```
* ### Quickly export image
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const imageId = config.requireObject("imageId");
* const bucketUrl = config.requireObject("bucketUrl");
* const test = new huaweicloud.ims.ImageExport("test", {
* imageId: imageId,
* bucketUrl: bucketUrl,
* isQuickExport: true,
* });
* ```
*/
class ImageExport extends pulumi.CustomResource {
/**
* Get an existing ImageExport 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 ImageExport(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ImageExport. 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'] === ImageExport.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["bucketUrl"] = state ? state.bucketUrl : undefined;
resourceInputs["fileFormat"] = state ? state.fileFormat : undefined;
resourceInputs["imageId"] = state ? state.imageId : undefined;
resourceInputs["isQuickExport"] = state ? state.isQuickExport : undefined;
resourceInputs["region"] = state ? state.region : undefined;
}
else {
const args = argsOrState;
if ((!args || args.bucketUrl === undefined) && !opts.urn) {
throw new Error("Missing required property 'bucketUrl'");
}
if ((!args || args.imageId === undefined) && !opts.urn) {
throw new Error("Missing required property 'imageId'");
}
resourceInputs["bucketUrl"] = args ? args.bucketUrl : undefined;
resourceInputs["fileFormat"] = args ? args.fileFormat : undefined;
resourceInputs["imageId"] = args ? args.imageId : undefined;
resourceInputs["isQuickExport"] = args ? args.isQuickExport : undefined;
resourceInputs["region"] = args ? args.region : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ImageExport.__pulumiType, name, resourceInputs, opts);
}
}
exports.ImageExport = ImageExport;
/** @internal */
ImageExport.__pulumiType = 'huaweicloud:Ims/imageExport:ImageExport';
//# sourceMappingURL=imageExport.js.map