UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

290 lines (289 loc) 10.9 kB
import * as pulumi from "@pulumi/pulumi"; /** * Manages an IMS whole image resource created from CBR backup 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 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.CbrWholeImage("test", {backupId: backupId}); * ``` * * ## Import * * The IMS CBR whole image resource can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Ims/cbrWholeImage:CbrWholeImage 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_cbr_whole_image" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * is_delete_backup, * * ] * * } } */ export declare class CbrWholeImage extends pulumi.CustomResource { /** * Get an existing CbrWholeImage 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: string, id: pulumi.Input<pulumi.ID>, state?: CbrWholeImageState, opts?: pulumi.CustomResourceOptions): CbrWholeImage; /** * Returns true if the given object is an instance of CbrWholeImage. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is CbrWholeImage; /** * The time when the image status changes to active, in RFC3339 format. */ readonly activeAt: pulumi.Output<string>; /** * Specifies the CBR instance backup ID used to create the image. * Changing this parameter will create a new resource. */ readonly backupId: pulumi.Output<string>; /** * The creation time of the image, in RFC3339 format. */ readonly createdAt: pulumi.Output<string>; /** * The image source. The format is **server_backup,backup_id**. */ readonly dataOrigin: pulumi.Output<string>; /** * Specifies the description of the image. */ readonly description: pulumi.Output<string | undefined>; /** * The image format. The value can be **zvhd2**, **vhd**, **zvhd**, **raw**, or **qcow2**. */ readonly diskFormat: pulumi.Output<string>; /** * Specifies the enterprise project ID to which the IMS image belongs. * For enterprise users, if omitted, default enterprise project will be used. */ readonly enterpriseProjectId: pulumi.Output<string>; /** * Specifies whether to delete the associated CBR backup when deleting image. * The value can be **true** or **false**. */ readonly isDeleteBackup: pulumi.Output<boolean | undefined>; /** * Specifies the maximum memory of the image, in MB unit. */ readonly maxRam: pulumi.Output<number>; /** * The minimum disk space required to run an image, in GB unit. */ readonly minDisk: pulumi.Output<number>; /** * Specifies the minimum memory of the image, in MB unit. * The default value is `0`, indicating that the memory is not restricted. */ readonly minRam: pulumi.Output<number>; /** * Specifies the name of the image. * The valid length is limited from `1` to `128` characters. * The first and last letters of the name cannot be spaces. * The name can contain uppercase letters, lowercase letters, numbers, spaces, chinese, and special characters (-._). */ readonly name: pulumi.Output<string>; /** * The operating system version of the image. */ readonly osVersion: pulumi.Output<string>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ readonly region: pulumi.Output<string>; /** * The status of the image. The value can be **active**, **queued**, **saving**, **deleted**, or **killed*, * only image with a status of **active** can be used. */ readonly status: pulumi.Output<string>; /** * Specifies the key/value pairs to associate with the image. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The last update time of the image, in RFC3339 format. */ readonly updatedAt: pulumi.Output<string>; /** * Whether the image is visible to other tenants. */ readonly visibility: pulumi.Output<string>; /** * Create a CbrWholeImage resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: CbrWholeImageArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering CbrWholeImage resources. */ export interface CbrWholeImageState { /** * The time when the image status changes to active, in RFC3339 format. */ activeAt?: pulumi.Input<string>; /** * Specifies the CBR instance backup ID used to create the image. * Changing this parameter will create a new resource. */ backupId?: pulumi.Input<string>; /** * The creation time of the image, in RFC3339 format. */ createdAt?: pulumi.Input<string>; /** * The image source. The format is **server_backup,backup_id**. */ dataOrigin?: pulumi.Input<string>; /** * Specifies the description of the image. */ description?: pulumi.Input<string>; /** * The image format. The value can be **zvhd2**, **vhd**, **zvhd**, **raw**, or **qcow2**. */ diskFormat?: pulumi.Input<string>; /** * Specifies the enterprise project ID to which the IMS image belongs. * For enterprise users, if omitted, default enterprise project will be used. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies whether to delete the associated CBR backup when deleting image. * The value can be **true** or **false**. */ isDeleteBackup?: pulumi.Input<boolean>; /** * Specifies the maximum memory of the image, in MB unit. */ maxRam?: pulumi.Input<number>; /** * The minimum disk space required to run an image, in GB unit. */ minDisk?: pulumi.Input<number>; /** * Specifies the minimum memory of the image, in MB unit. * The default value is `0`, indicating that the memory is not restricted. */ minRam?: pulumi.Input<number>; /** * Specifies the name of the image. * The valid length is limited from `1` to `128` characters. * The first and last letters of the name cannot be spaces. * The name can contain uppercase letters, lowercase letters, numbers, spaces, chinese, and special characters (-._). */ name?: pulumi.Input<string>; /** * The operating system version of the image. */ osVersion?: pulumi.Input<string>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; /** * The status of the image. The value can be **active**, **queued**, **saving**, **deleted**, or **killed*, * only image with a status of **active** can be used. */ status?: pulumi.Input<string>; /** * Specifies the key/value pairs to associate with the image. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The last update time of the image, in RFC3339 format. */ updatedAt?: pulumi.Input<string>; /** * Whether the image is visible to other tenants. */ visibility?: pulumi.Input<string>; } /** * The set of arguments for constructing a CbrWholeImage resource. */ export interface CbrWholeImageArgs { /** * Specifies the CBR instance backup ID used to create the image. * Changing this parameter will create a new resource. */ backupId: pulumi.Input<string>; /** * Specifies the description of the image. */ description?: pulumi.Input<string>; /** * Specifies the enterprise project ID to which the IMS image belongs. * For enterprise users, if omitted, default enterprise project will be used. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies whether to delete the associated CBR backup when deleting image. * The value can be **true** or **false**. */ isDeleteBackup?: pulumi.Input<boolean>; /** * Specifies the maximum memory of the image, in MB unit. */ maxRam?: pulumi.Input<number>; /** * Specifies the minimum memory of the image, in MB unit. * The default value is `0`, indicating that the memory is not restricted. */ minRam?: pulumi.Input<number>; /** * Specifies the name of the image. * The valid length is limited from `1` to `128` characters. * The first and last letters of the name cannot be spaces. * The name can contain uppercase letters, lowercase letters, numbers, spaces, chinese, and special characters (-._). */ name?: pulumi.Input<string>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; /** * Specifies the key/value pairs to associate with the image. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; }