@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
365 lines (364 loc) • 14.2 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
/**
* Manages ModelArts notebook resource within HuaweiCloud.
*
* ## Example Usage
* ### Create a notebook with the EVS storage type
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const notebookName = config.requireObject("notebookName");
* const keyPairName = config.requireObject("keyPairName");
* const imageId = config.requireObject("imageId");
* const allowedIpAddresses = config.requireObject("allowedIpAddresses");
* const keyPairNameInput = config.requireObject("keyPairNameInput");
* const test = new huaweicloud.modelarts.Notebook("test", {
* flavorId: "modelarts.vm.cpu.2u",
* imageId: imageId,
* allowedAccessIps: allowedIpAddresses,
* keyPair: keyPairName,
* volume: {
* type: "EVS",
* size: 5,
* },
* });
* ```
* ### Create a notebook with the EFS storage type
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const notebookName = config.requireObject("notebookName");
* const imageId = config.requireObject("imageId");
* const resourcePoolId = config.requireObject("resourcePoolId");
* const sfsExportLocation = config.requireObject("sfsExportLocation");
* const sfsTurboId = config.requireObject("sfsTurboId");
* const test = new huaweicloud.modelarts.Notebook("test", {
* flavorId: "modelarts.vm.cpu.2u",
* imageId: imageId,
* poolId: resourcePoolId,
* volume: {
* type: "EFS",
* ownership: "DEDICATED",
* uri: sfsExportLocation,
* id: sfsTurboId,
* },
* });
* ```
*
* ## Import
*
* The notebook can be imported by `id`. bash
*
* ```sh
* $ pulumi import huaweicloud:ModelArts/notebook:Notebook test b11b407c-e604-4e8d-8bc4-92398320b847
* ```
*/
export declare class Notebook extends pulumi.CustomResource {
/**
* Get an existing Notebook 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?: NotebookState, opts?: pulumi.CustomResourceOptions): Notebook;
/**
* Returns true if the given object is an instance of Notebook. 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 Notebook;
/**
* Specifies public IP addresses that are allowed for remote SSH access.
* If the parameter is not specified, all IP addresses will be allowed for remote SSH access.
*/
readonly allowedAccessIps: pulumi.Output<string[] | undefined>;
/**
* Whether enabled the notebook instance to automatically stop.
*/
readonly autoStopEnabled: pulumi.Output<boolean>;
/**
* The notebook creation time.
*/
readonly createdAt: pulumi.Output<string>;
/**
* Specifies the description of notebook. It contains a maximum of `512` characters and
* cannot contain special characters `&<>"'/`.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Specifies the flavor ID. The options are as follows:
* - **modelarts.vm.cpu.2u**: General-purpose Intel CPU specifications, suitable for data exploration and algorithm
* discovery.
* - **modelarts.vm.cpu.8u**: General computing-plus Intel CPU specifications, suitable for compute-intensive
* applications.
* - **modelarts.bm.gpu.v100NV32**: One NVIDIA V100 GPU with 32GB of memory, suitable for deep learning algorithm
* training and debugging.
* - **modelarts.bm.d910.xlarge.1**: One Ascend 910 NPU with 32GB of memory, suitable for deep learning code running
* and debugging.
* - **modelarts.bm.d910.xlarge.2**: Two Ascend 910 NPU with 32GB of memory, suitable for deep learning code running
* and debugging.
* - **modelarts.bm.d910.xlarge.8**: Eight Ascend 910 NPU with 32GB of memory, suitable for deep learning code running
* and debugging.
*/
readonly flavorId: pulumi.Output<string>;
/**
* Specifies the image ID of notebook.
*/
readonly imageId: pulumi.Output<string>;
/**
* The image name.
*/
readonly imageName: pulumi.Output<string>;
/**
* The image path in swr.
*/
readonly imageSwrPath: pulumi.Output<string>;
/**
* The image type. Valid values include: `BUILD_IN`, `DEDICATED`.
*/
readonly imageType: pulumi.Output<string>;
/**
* Specifies the key pair name for remote SSH access.
* Changing this parameter will create a new resource.
*/
readonly keyPair: pulumi.Output<string | undefined>;
/**
* An array of storages which mount to the notebook. Structure is documented below.
*/
readonly mountStorages: pulumi.Output<outputs.ModelArts.NotebookMountStorage[]>;
/**
* Specifies the name of the notebook. The name consists of 1 to 64 characters,
* starting with a letter. Only letters, digits and underscores (_) are allowed.
*/
readonly name: pulumi.Output<string>;
/**
* Specifies the ID of Dedicated resource pool which the notebook used.
* Changing this parameter will create a new resource.
*/
readonly poolId: pulumi.Output<string | undefined>;
/**
* The name of Dedicated resource pool which the notebook used.
*/
readonly poolName: pulumi.Output<string>;
/**
* 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 uri for remote SSH access.
* * `volume/mount_path` - The local mount path of volume.
*/
readonly sshUri: pulumi.Output<string>;
/**
* The status of mount.
*/
readonly status: pulumi.Output<string>;
/**
* The notebook update time.
*/
readonly updatedAt: pulumi.Output<string>;
/**
* The web url of the notebook.
*/
readonly url: pulumi.Output<string>;
/**
* Specifies the volume information. Structure is documented below.
*/
readonly volume: pulumi.Output<outputs.ModelArts.NotebookVolume>;
/**
* Specifies the workspace ID which the notebook belongs to.
* The default value is `0`. Changing this parameter will create a new resource.
*/
readonly workspaceId: pulumi.Output<string>;
/**
* Create a Notebook 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: NotebookArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Notebook resources.
*/
export interface NotebookState {
/**
* Specifies public IP addresses that are allowed for remote SSH access.
* If the parameter is not specified, all IP addresses will be allowed for remote SSH access.
*/
allowedAccessIps?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Whether enabled the notebook instance to automatically stop.
*/
autoStopEnabled?: pulumi.Input<boolean>;
/**
* The notebook creation time.
*/
createdAt?: pulumi.Input<string>;
/**
* Specifies the description of notebook. It contains a maximum of `512` characters and
* cannot contain special characters `&<>"'/`.
*/
description?: pulumi.Input<string>;
/**
* Specifies the flavor ID. The options are as follows:
* - **modelarts.vm.cpu.2u**: General-purpose Intel CPU specifications, suitable for data exploration and algorithm
* discovery.
* - **modelarts.vm.cpu.8u**: General computing-plus Intel CPU specifications, suitable for compute-intensive
* applications.
* - **modelarts.bm.gpu.v100NV32**: One NVIDIA V100 GPU with 32GB of memory, suitable for deep learning algorithm
* training and debugging.
* - **modelarts.bm.d910.xlarge.1**: One Ascend 910 NPU with 32GB of memory, suitable for deep learning code running
* and debugging.
* - **modelarts.bm.d910.xlarge.2**: Two Ascend 910 NPU with 32GB of memory, suitable for deep learning code running
* and debugging.
* - **modelarts.bm.d910.xlarge.8**: Eight Ascend 910 NPU with 32GB of memory, suitable for deep learning code running
* and debugging.
*/
flavorId?: pulumi.Input<string>;
/**
* Specifies the image ID of notebook.
*/
imageId?: pulumi.Input<string>;
/**
* The image name.
*/
imageName?: pulumi.Input<string>;
/**
* The image path in swr.
*/
imageSwrPath?: pulumi.Input<string>;
/**
* The image type. Valid values include: `BUILD_IN`, `DEDICATED`.
*/
imageType?: pulumi.Input<string>;
/**
* Specifies the key pair name for remote SSH access.
* Changing this parameter will create a new resource.
*/
keyPair?: pulumi.Input<string>;
/**
* An array of storages which mount to the notebook. Structure is documented below.
*/
mountStorages?: pulumi.Input<pulumi.Input<inputs.ModelArts.NotebookMountStorage>[]>;
/**
* Specifies the name of the notebook. The name consists of 1 to 64 characters,
* starting with a letter. Only letters, digits and underscores (_) are allowed.
*/
name?: pulumi.Input<string>;
/**
* Specifies the ID of Dedicated resource pool which the notebook used.
* Changing this parameter will create a new resource.
*/
poolId?: pulumi.Input<string>;
/**
* The name of Dedicated resource pool which the notebook used.
*/
poolName?: pulumi.Input<string>;
/**
* 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 uri for remote SSH access.
* * `volume/mount_path` - The local mount path of volume.
*/
sshUri?: pulumi.Input<string>;
/**
* The status of mount.
*/
status?: pulumi.Input<string>;
/**
* The notebook update time.
*/
updatedAt?: pulumi.Input<string>;
/**
* The web url of the notebook.
*/
url?: pulumi.Input<string>;
/**
* Specifies the volume information. Structure is documented below.
*/
volume?: pulumi.Input<inputs.ModelArts.NotebookVolume>;
/**
* Specifies the workspace ID which the notebook belongs to.
* The default value is `0`. Changing this parameter will create a new resource.
*/
workspaceId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Notebook resource.
*/
export interface NotebookArgs {
/**
* Specifies public IP addresses that are allowed for remote SSH access.
* If the parameter is not specified, all IP addresses will be allowed for remote SSH access.
*/
allowedAccessIps?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the description of notebook. It contains a maximum of `512` characters and
* cannot contain special characters `&<>"'/`.
*/
description?: pulumi.Input<string>;
/**
* Specifies the flavor ID. The options are as follows:
* - **modelarts.vm.cpu.2u**: General-purpose Intel CPU specifications, suitable for data exploration and algorithm
* discovery.
* - **modelarts.vm.cpu.8u**: General computing-plus Intel CPU specifications, suitable for compute-intensive
* applications.
* - **modelarts.bm.gpu.v100NV32**: One NVIDIA V100 GPU with 32GB of memory, suitable for deep learning algorithm
* training and debugging.
* - **modelarts.bm.d910.xlarge.1**: One Ascend 910 NPU with 32GB of memory, suitable for deep learning code running
* and debugging.
* - **modelarts.bm.d910.xlarge.2**: Two Ascend 910 NPU with 32GB of memory, suitable for deep learning code running
* and debugging.
* - **modelarts.bm.d910.xlarge.8**: Eight Ascend 910 NPU with 32GB of memory, suitable for deep learning code running
* and debugging.
*/
flavorId: pulumi.Input<string>;
/**
* Specifies the image ID of notebook.
*/
imageId: pulumi.Input<string>;
/**
* Specifies the key pair name for remote SSH access.
* Changing this parameter will create a new resource.
*/
keyPair?: pulumi.Input<string>;
/**
* Specifies the name of the notebook. The name consists of 1 to 64 characters,
* starting with a letter. Only letters, digits and underscores (_) are allowed.
*/
name?: pulumi.Input<string>;
/**
* Specifies the ID of Dedicated resource pool which the notebook used.
* Changing this parameter will create a new resource.
*/
poolId?: pulumi.Input<string>;
/**
* 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 volume information. Structure is documented below.
*/
volume: pulumi.Input<inputs.ModelArts.NotebookVolume>;
/**
* Specifies the workspace ID which the notebook belongs to.
* The default value is `0`. Changing this parameter will create a new resource.
*/
workspaceId?: pulumi.Input<string>;
}