@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
117 lines • 4.63 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, { ...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?.arn;
resourceInputs["containers"] = state?.containers;
resourceInputs["enableNetworkIsolation"] = state?.enableNetworkIsolation;
resourceInputs["executionRoleArn"] = state?.executionRoleArn;
resourceInputs["inferenceExecutionConfig"] = state?.inferenceExecutionConfig;
resourceInputs["name"] = state?.name;
resourceInputs["primaryContainer"] = state?.primaryContainer;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["vpcConfig"] = state?.vpcConfig;
}
else {
const args = argsOrState;
if (args?.executionRoleArn === undefined && !opts.urn) {
throw new Error("Missing required property 'executionRoleArn'");
}
resourceInputs["containers"] = args?.containers;
resourceInputs["enableNetworkIsolation"] = args?.enableNetworkIsolation;
resourceInputs["executionRoleArn"] = args?.executionRoleArn;
resourceInputs["inferenceExecutionConfig"] = args?.inferenceExecutionConfig;
resourceInputs["name"] = args?.name;
resourceInputs["primaryContainer"] = args?.primaryContainer;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["vpcConfig"] = args?.vpcConfig;
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
;