com.pulumi.aws.sagemaker.Model Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws Show documentation
Show all versions of aws Show documentation
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
The newest version!
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.aws.sagemaker;
import com.pulumi.aws.Utilities;
import com.pulumi.aws.sagemaker.ModelArgs;
import com.pulumi.aws.sagemaker.inputs.ModelState;
import com.pulumi.aws.sagemaker.outputs.ModelContainer;
import com.pulumi.aws.sagemaker.outputs.ModelInferenceExecutionConfig;
import com.pulumi.aws.sagemaker.outputs.ModelPrimaryContainer;
import com.pulumi.aws.sagemaker.outputs.ModelVpcConfig;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Provides a SageMaker model resource.
*
* ## Example Usage
*
* Basic usage:
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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 example = new Model("example", ModelArgs.builder()
* .name("my-model")
* .executionRoleArn(exampleRole.arn())
* .primaryContainer(ModelPrimaryContainerArgs.builder()
* .image(test.applyValue(getPrebuiltEcrImageResult -> getPrebuiltEcrImageResult.registryPath()))
* .build())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## 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
* ```
*
*/
@ResourceType(type="aws:sagemaker/model:Model")
public class Model extends com.pulumi.resources.CustomResource {
/**
* The Amazon Resource Name (ARN) assigned by AWS to this model.
*
*/
@Export(name="arn", refs={String.class}, tree="[0]")
private Output arn;
/**
* @return The Amazon Resource Name (ARN) assigned by AWS to this model.
*
*/
public Output arn() {
return this.arn;
}
/**
* Specifies containers in the inference pipeline. If not specified, the `primary_container` argument is required. Fields are documented below.
*
*/
@Export(name="containers", refs={List.class,ModelContainer.class}, tree="[0,1]")
private Output* @Nullable */ List> containers;
/**
* @return Specifies containers in the inference pipeline. If not specified, the `primary_container` argument is required. Fields are documented below.
*
*/
public Output>> containers() {
return Codegen.optional(this.containers);
}
/**
* Isolates the model container. No inbound or outbound network calls can be made to or from the model container.
*
*/
@Export(name="enableNetworkIsolation", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> enableNetworkIsolation;
/**
* @return Isolates the model container. No inbound or outbound network calls can be made to or from the model container.
*
*/
public Output> enableNetworkIsolation() {
return Codegen.optional(this.enableNetworkIsolation);
}
/**
* A role that SageMaker can assume to access model artifacts and docker images for deployment.
*
*/
@Export(name="executionRoleArn", refs={String.class}, tree="[0]")
private Output executionRoleArn;
/**
* @return A role that SageMaker can assume to access model artifacts and docker images for deployment.
*
*/
public Output executionRoleArn() {
return this.executionRoleArn;
}
/**
* Specifies details of how containers in a multi-container endpoint are called. see Inference Execution Config.
*
*/
@Export(name="inferenceExecutionConfig", refs={ModelInferenceExecutionConfig.class}, tree="[0]")
private Output inferenceExecutionConfig;
/**
* @return Specifies details of how containers in a multi-container endpoint are called. see Inference Execution Config.
*
*/
public Output inferenceExecutionConfig() {
return this.inferenceExecutionConfig;
}
/**
* The name of the model (must be unique). If omitted, this provider will assign a random, unique name.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the model (must be unique). If omitted, this provider will assign a random, unique name.
*
*/
public Output name() {
return this.name;
}
/**
* 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.
*
*/
@Export(name="primaryContainer", refs={ModelPrimaryContainer.class}, tree="[0]")
private Output* @Nullable */ ModelPrimaryContainer> primaryContainer;
/**
* @return 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.
*
*/
public Output> primaryContainer() {
return Codegen.optional(this.primaryContainer);
}
/**
* 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.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return 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.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
*
* @deprecated
* Please use `tags` instead.
*
*/
@Deprecated /* Please use `tags` instead. */
@Export(name="tagsAll", refs={Map.class,String.class}, tree="[0,1,1]")
private Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy