@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
192 lines • 8.55 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.Image = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* !> **WARNING:** It has been deprecated, please select the corresponding resource replacement based on the image type and
* creation method, please use resources named in `huaweicloudImsXxxXxxImage` format instead.
*
* Manages an IMS image resource within HuaweiCloud.
*
* ## Example Usage
* ### Creating a system image from an existing ECS instance
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const name = config.requireObject("name");
* const instanceId = config.requireObject("instanceId");
* const test = new huaweicloud.ims.Image("test", {
* instanceId: instanceId,
* tags: {
* foo: "bar",
* key: "value",
* },
* });
* ```
* ### Creating a system image from OBS bucket
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const name = config.requireObject("name");
* const imageUrl = config.requireObject("imageUrl");
* const minDisk = config.requireObject("minDisk");
* const test = new huaweicloud.ims.Image("test", {
* imageUrl: imageUrl,
* minDisk: minDisk,
* });
* ```
* ### Creating a whole image from an existing ECS instance
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const name = config.requireObject("name");
* const instanceId = config.requireObject("instanceId");
* const vaultId = config.requireObject("vaultId");
* const test = new huaweicloud.ims.Image("test", {
* instanceId: instanceId,
* vaultId: vaultId,
* });
* ```
* ### Creating a whole image from CBR backup
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const name = config.requireObject("name");
* const backupId = config.requireObject("backupId");
* const test = new huaweicloud.ims.Image("test", {backupId: backupId});
* ```
* ### Creating a data image from the data disk bound to the ECS instance
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const name = config.requireObject("name");
* const volumeId = config.requireObject("volumeId");
* const test = new huaweicloud.ims.Image("test", {volumeId: volumeId});
* ```
*
* ## Import
*
* Image can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Ims/image:Image test <id>
* ```
*
* Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response. The missing attributes include`vault_id`. It is generally recommended running `terraform plan` after importing the image. You can then decide if changes should be applied to the image, or the resource definition should be updated to align with the image. Also, you can ignore changes as below. hcl resource "huaweicloud_images_image" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* vault_id,
*
* ]
*
* } }
*/
class Image extends pulumi.CustomResource {
/**
* Get an existing Image 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 Image(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Image. 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'] === Image.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["backupId"] = state ? state.backupId : undefined;
resourceInputs["checksum"] = state ? state.checksum : undefined;
resourceInputs["cmkId"] = state ? state.cmkId : 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["imageUrl"] = state ? state.imageUrl : undefined;
resourceInputs["instanceId"] = state ? state.instanceId : undefined;
resourceInputs["isConfig"] = state ? state.isConfig : 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["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["vaultId"] = state ? state.vaultId : undefined;
resourceInputs["visibility"] = state ? state.visibility : undefined;
resourceInputs["volumeId"] = state ? state.volumeId : undefined;
}
else {
const args = argsOrState;
resourceInputs["backupId"] = args ? args.backupId : undefined;
resourceInputs["cmkId"] = args ? args.cmkId : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined;
resourceInputs["imageUrl"] = args ? args.imageUrl : undefined;
resourceInputs["instanceId"] = args ? args.instanceId : undefined;
resourceInputs["isConfig"] = args ? args.isConfig : undefined;
resourceInputs["maxRam"] = args ? args.maxRam : undefined;
resourceInputs["minDisk"] = args ? args.minDisk : undefined;
resourceInputs["minRam"] = args ? args.minRam : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["osVersion"] = args ? args.osVersion : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["vaultId"] = args ? args.vaultId : undefined;
resourceInputs["volumeId"] = args ? args.volumeId : undefined;
resourceInputs["checksum"] = undefined /*out*/;
resourceInputs["dataOrigin"] = undefined /*out*/;
resourceInputs["diskFormat"] = undefined /*out*/;
resourceInputs["imageSize"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["visibility"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Image.__pulumiType, name, resourceInputs, opts);
}
}
exports.Image = Image;
/** @internal */
Image.__pulumiType = 'huaweicloud:Ims/image:Image';
//# sourceMappingURL=image.js.map