UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

143 lines 7.37 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.ObsSystemImage = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an IMS system image resource created from external image file in the OBS bucket within HuaweiCloud. * * ## Example Usage * ### Creating an IMS system image from an external image file in the 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.ObsSystemImage("test", { * imageUrl: imageUrl, * minDisk: minDisk, * }); * ``` * * ## Import * * The IMS OBS system image resource can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Ims/obsSystemImage:ObsSystemImage 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`type`, `is_config`, `is_quick_import`. 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_obs_system_image" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * type, is_config, is_quick_import, * * ] * * } } */ class ObsSystemImage extends pulumi.CustomResource { /** * Get an existing ObsSystemImage 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 ObsSystemImage(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ObsSystemImage. 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'] === ObsSystemImage.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["activeAt"] = state ? state.activeAt : undefined; resourceInputs["architecture"] = state ? state.architecture : undefined; resourceInputs["cmkId"] = state ? state.cmkId : 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["imageUrl"] = state ? state.imageUrl : undefined; resourceInputs["isConfig"] = state ? state.isConfig : undefined; resourceInputs["isQuickImport"] = state ? state.isQuickImport : 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["osType"] = state ? state.osType : 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["updatedAt"] = state ? state.updatedAt : undefined; resourceInputs["visibility"] = state ? state.visibility : undefined; } else { const args = argsOrState; if ((!args || args.imageUrl === undefined) && !opts.urn) { throw new Error("Missing required property 'imageUrl'"); } if ((!args || args.minDisk === undefined) && !opts.urn) { throw new Error("Missing required property 'minDisk'"); } resourceInputs["architecture"] = args ? args.architecture : 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["isConfig"] = args ? args.isConfig : undefined; resourceInputs["isQuickImport"] = args ? args.isQuickImport : 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["osType"] = args ? args.osType : 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["activeAt"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["dataOrigin"] = undefined /*out*/; resourceInputs["diskFormat"] = undefined /*out*/; resourceInputs["imageSize"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; resourceInputs["visibility"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ObsSystemImage.__pulumiType, name, resourceInputs, opts); } } exports.ObsSystemImage = ObsSystemImage; /** @internal */ ObsSystemImage.__pulumiType = 'huaweicloud:Ims/obsSystemImage:ObsSystemImage'; //# sourceMappingURL=obsSystemImage.js.map