ModelArgs

data class ModelArgs(val containers: Output<List<ModelContainerArgs>>? = null, val enableNetworkIsolation: Output<Boolean>? = null, val executionRoleArn: Output<String>? = null, val inferenceExecutionConfig: Output<ModelInferenceExecutionConfigArgs>? = null, val name: Output<String>? = null, val primaryContainer: Output<ModelPrimaryContainerArgs>? = null, val tags: Output<Map<String, String>>? = null, val vpcConfig: Output<ModelVpcConfigArgs>? = null) : ConvertibleToJava<ModelArgs>

Provides a SageMaker model resource.

Example Usage

Basic usage:

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.sagemaker.SagemakerFunctions;
import com.pulumi.aws.sagemaker.inputs.GetPrebuiltEcrImageArgs;
import com.pulumi.aws.sagemaker.Model;
import com.pulumi.aws.sagemaker.ModelArgs;
import com.pulumi.aws.sagemaker.inputs.ModelPrimaryContainerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var assumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.actions("sts:AssumeRole")
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.type("Service")
.identifiers("sagemaker.amazonaws.com")
.build())
.build())
.build());
var exampleRole = new Role("exampleRole", RoleArgs.builder()
.assumeRolePolicy(assumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
.build());
final var test = SagemakerFunctions.getPrebuiltEcrImage(GetPrebuiltEcrImageArgs.builder()
.repositoryName("kmeans")
.build());
var exampleModel = new Model("exampleModel", ModelArgs.builder()
.executionRoleArn(exampleRole.arn())
.primaryContainer(ModelPrimaryContainerArgs.builder()
.image(test.applyValue(getPrebuiltEcrImageResult -> getPrebuiltEcrImageResult.registryPath()))
.build())
.build());
}
}

Inference Execution Config

  • mode - (Required) How containers in a multi-container are run. The following values are valid Serial and Direct.

Import

Models can be imported using the name, e.g.,

$ pulumi import aws:sagemaker/model:Model test_model model-foo

Constructors

Link copied to clipboard
fun ModelArgs(containers: Output<List<ModelContainerArgs>>? = null, enableNetworkIsolation: Output<Boolean>? = null, executionRoleArn: Output<String>? = null, inferenceExecutionConfig: Output<ModelInferenceExecutionConfigArgs>? = null, name: Output<String>? = null, primaryContainer: Output<ModelPrimaryContainerArgs>? = null, tags: Output<Map<String, String>>? = null, vpcConfig: Output<ModelVpcConfigArgs>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ModelArgs

Properties

Link copied to clipboard
val containers: Output<List<ModelContainerArgs>>? = null

Specifies containers in the inference pipeline. If not specified, the primary_container argument is required. Fields are documented below.

Link copied to clipboard
val enableNetworkIsolation: Output<Boolean>? = null

Isolates the model container. No inbound or outbound network calls can be made to or from the model container.

Link copied to clipboard
val executionRoleArn: Output<String>? = null

A role that SageMaker can assume to access model artifacts and docker images for deployment.

Link copied to clipboard

Specifies details of how containers in a multi-container endpoint are called. see Inference Execution Config.

Link copied to clipboard
val name: Output<String>? = null

The name of the model (must be unique). If omitted, this provider will assign a random, unique name.

Link copied to clipboard

The primary docker image containing inference code that is used when the model is deployed for predictions. If not specified, the container argument is required. Fields are documented below.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. The primary_container and container block both support:

Link copied to clipboard
val vpcConfig: Output<ModelVpcConfigArgs>? = null

Specifies the VPC that you want your model to connect to. VpcConfig is used in hosting services and in batch transform.