@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
144 lines • 7.18 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.ObsIsoImage = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an IMS ISO image resource created from external image file in the OBS bucket within HuaweiCloud.
*
* ## Example Usage
* ### Creating an IMS ISO 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 osVersion = config.requireObject("osVersion");
* const test = new huaweicloud.ims.ObsIsoImage("test", {
* imageUrl: imageUrl,
* minDisk: minDisk,
* osVersion: osVersion,
* });
* ```
*
* ## Import
*
* The IMS OBS ISO image resource can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Ims/obsIsoImage:ObsIsoImage 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_config`. 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_iso_image" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* is_config,
*
* ]
*
* } }
*/
class ObsIsoImage extends pulumi.CustomResource {
/**
* Get an existing ObsIsoImage 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 ObsIsoImage(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ObsIsoImage. 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'] === ObsIsoImage.__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["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["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'");
}
if ((!args || args.osVersion === undefined) && !opts.urn) {
throw new Error("Missing required property 'osVersion'");
}
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["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["activeAt"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["dataOrigin"] = undefined /*out*/;
resourceInputs["diskFormat"] = undefined /*out*/;
resourceInputs["imageSize"] = undefined /*out*/;
resourceInputs["osType"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
resourceInputs["visibility"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ObsIsoImage.__pulumiType, name, resourceInputs, opts);
}
}
exports.ObsIsoImage = ObsIsoImage;
/** @internal */
ObsIsoImage.__pulumiType = 'huaweicloud:Ims/obsIsoImage:ObsIsoImage';
//# sourceMappingURL=obsIsoImage.js.map