@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
145 lines • 6.99 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotebookInstance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a SageMaker AI Notebook Instance resource.
*
* ## Example Usage
*
* ### Basic usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const ni = new aws.sagemaker.NotebookInstance("ni", {
* name: "my-notebook-instance",
* roleArn: role.arn,
* instanceType: "ml.t2.medium",
* tags: {
* Name: "foo",
* },
* });
* ```
*
* ### Code repository usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.sagemaker.CodeRepository("example", {
* codeRepositoryName: "my-notebook-instance-code-repo",
* gitConfig: {
* repositoryUrl: "https://github.com/github/docs.git",
* },
* });
* const ni = new aws.sagemaker.NotebookInstance("ni", {
* name: "my-notebook-instance",
* roleArn: role.arn,
* instanceType: "ml.t2.medium",
* defaultCodeRepository: example.codeRepositoryName,
* tags: {
* Name: "foo",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import SageMaker AI Notebook Instances using the `name`. For example:
*
* ```sh
* $ pulumi import aws:sagemaker/notebookInstance:NotebookInstance test_notebook_instance my-notebook-instance
* ```
*/
class NotebookInstance extends pulumi.CustomResource {
/**
* Get an existing NotebookInstance 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 NotebookInstance(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of NotebookInstance. 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'] === NotebookInstance.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["additionalCodeRepositories"] = state ? state.additionalCodeRepositories : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["defaultCodeRepository"] = state ? state.defaultCodeRepository : undefined;
resourceInputs["directInternetAccess"] = state ? state.directInternetAccess : undefined;
resourceInputs["instanceMetadataServiceConfiguration"] = state ? state.instanceMetadataServiceConfiguration : undefined;
resourceInputs["instanceType"] = state ? state.instanceType : undefined;
resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined;
resourceInputs["lifecycleConfigName"] = state ? state.lifecycleConfigName : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["networkInterfaceId"] = state ? state.networkInterfaceId : undefined;
resourceInputs["platformIdentifier"] = state ? state.platformIdentifier : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["roleArn"] = state ? state.roleArn : undefined;
resourceInputs["rootAccess"] = state ? state.rootAccess : undefined;
resourceInputs["securityGroups"] = state ? state.securityGroups : undefined;
resourceInputs["subnetId"] = state ? state.subnetId : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["url"] = state ? state.url : undefined;
resourceInputs["volumeSize"] = state ? state.volumeSize : undefined;
}
else {
const args = argsOrState;
if ((!args || args.instanceType === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceType'");
}
if ((!args || args.roleArn === undefined) && !opts.urn) {
throw new Error("Missing required property 'roleArn'");
}
resourceInputs["additionalCodeRepositories"] = args ? args.additionalCodeRepositories : undefined;
resourceInputs["defaultCodeRepository"] = args ? args.defaultCodeRepository : undefined;
resourceInputs["directInternetAccess"] = args ? args.directInternetAccess : undefined;
resourceInputs["instanceMetadataServiceConfiguration"] = args ? args.instanceMetadataServiceConfiguration : undefined;
resourceInputs["instanceType"] = args ? args.instanceType : undefined;
resourceInputs["kmsKeyId"] = args ? args.kmsKeyId : undefined;
resourceInputs["lifecycleConfigName"] = args ? args.lifecycleConfigName : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["platformIdentifier"] = args ? args.platformIdentifier : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["roleArn"] = args ? args.roleArn : undefined;
resourceInputs["rootAccess"] = args ? args.rootAccess : undefined;
resourceInputs["securityGroups"] = args ? args.securityGroups : undefined;
resourceInputs["subnetId"] = args ? args.subnetId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["volumeSize"] = args ? args.volumeSize : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["networkInterfaceId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["url"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NotebookInstance.__pulumiType, name, resourceInputs, opts);
}
}
exports.NotebookInstance = NotebookInstance;
/** @internal */
NotebookInstance.__pulumiType = 'aws:sagemaker/notebookInstance:NotebookInstance';
//# sourceMappingURL=notebookInstance.js.map