@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
117 lines • 5.04 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.Model = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a SageMaker AI model resource.
*
* ## Example Usage
*
* Basic usage:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const assumeRole = aws.iam.getPolicyDocument({
* statements: [{
* actions: ["sts:AssumeRole"],
* principals: [{
* type: "Service",
* identifiers: ["sagemaker.amazonaws.com"],
* }],
* }],
* });
* const exampleRole = new aws.iam.Role("example", {assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json)});
* const test = aws.sagemaker.getPrebuiltEcrImage({
* repositoryName: "kmeans",
* });
* const example = new aws.sagemaker.Model("example", {
* name: "my-model",
* executionRoleArn: exampleRole.arn,
* primaryContainer: {
* image: test.then(test => test.registryPath),
* },
* });
* ```
*
* ## Inference Execution Config
*
* * `mode` - (Required) How containers in a multi-container are run. The following values are valid `Serial` and `Direct`.
*
* ## Import
*
* Using `pulumi import`, import models using the `name`. For example:
*
* ```sh
* $ pulumi import aws:sagemaker/model:Model test_model model-foo
* ```
*/
class Model extends pulumi.CustomResource {
/**
* Get an existing Model 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 Model(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Model. 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'] === Model.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["containers"] = state ? state.containers : undefined;
resourceInputs["enableNetworkIsolation"] = state ? state.enableNetworkIsolation : undefined;
resourceInputs["executionRoleArn"] = state ? state.executionRoleArn : undefined;
resourceInputs["inferenceExecutionConfig"] = state ? state.inferenceExecutionConfig : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["primaryContainer"] = state ? state.primaryContainer : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["vpcConfig"] = state ? state.vpcConfig : undefined;
}
else {
const args = argsOrState;
if ((!args || args.executionRoleArn === undefined) && !opts.urn) {
throw new Error("Missing required property 'executionRoleArn'");
}
resourceInputs["containers"] = args ? args.containers : undefined;
resourceInputs["enableNetworkIsolation"] = args ? args.enableNetworkIsolation : undefined;
resourceInputs["executionRoleArn"] = args ? args.executionRoleArn : undefined;
resourceInputs["inferenceExecutionConfig"] = args ? args.inferenceExecutionConfig : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["primaryContainer"] = args ? args.primaryContainer : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["vpcConfig"] = args ? args.vpcConfig : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Model.__pulumiType, name, resourceInputs, opts);
}
}
exports.Model = Model;
/** @internal */
Model.__pulumiType = 'aws:sagemaker/model:Model';
//# sourceMappingURL=model.js.map