UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

138 lines 6.9 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.EcsWholeImage = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an IMS whole image resource created from ECS instance within HuaweiCloud. * * > After deleting the image, the CBR backup that has not been deleted will be retained and continue to be charged. * If you need to delete it later, you can delete the corresponding CBR backup in the CBR backup console. * * ## Example Usage * ### Creating an IMS 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.EcsWholeImage("test", { * instanceId: instanceId, * vaultId: vaultId, * }); * ``` * * ## Import * * The IMS ECS whole image resource can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Ims/ecsWholeImage:EcsWholeImage 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`is_delete_backup`. 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 image. Also, you can ignore changes as below. resource "huaweicloud_ims_ecs_whole_image" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * is_delete_backup, * * ] * * } } */ class EcsWholeImage extends pulumi.CustomResource { /** * Get an existing EcsWholeImage 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 EcsWholeImage(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of EcsWholeImage. 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'] === EcsWholeImage.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["activeAt"] = state ? state.activeAt : undefined; resourceInputs["backupId"] = state ? state.backupId : 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["instanceId"] = state ? state.instanceId : undefined; resourceInputs["isDeleteBackup"] = state ? state.isDeleteBackup : 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["updatedAt"] = state ? state.updatedAt : undefined; resourceInputs["vaultId"] = state ? state.vaultId : undefined; resourceInputs["visibility"] = state ? state.visibility : undefined; } else { const args = argsOrState; if ((!args || args.instanceId === undefined) && !opts.urn) { throw new Error("Missing required property 'instanceId'"); } if ((!args || args.vaultId === undefined) && !opts.urn) { throw new Error("Missing required property 'vaultId'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined; resourceInputs["instanceId"] = args ? args.instanceId : undefined; resourceInputs["isDeleteBackup"] = args ? args.isDeleteBackup : 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["tags"] = args ? args.tags : undefined; resourceInputs["vaultId"] = args ? args.vaultId : undefined; resourceInputs["activeAt"] = undefined /*out*/; resourceInputs["backupId"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["dataOrigin"] = undefined /*out*/; resourceInputs["diskFormat"] = 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(EcsWholeImage.__pulumiType, name, resourceInputs, opts); } } exports.EcsWholeImage = EcsWholeImage; /** @internal */ EcsWholeImage.__pulumiType = 'huaweicloud:Ims/ecsWholeImage:EcsWholeImage'; //# sourceMappingURL=ecsWholeImage.js.map