Package com.pulumi.aws.sagemaker
Class Model
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.sagemaker.Model
-
public class Model extends com.pulumi.resources.CustomResourceManages an Amazon SageMaker AI Model. ## Example Usage ### Basic Usage
## Import Using `pulumi import`, import models using the `name`. For example: ```sh $ pulumi import aws:sagemaker/model:Model example model-foo ```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.inputs.GetPolicyDocumentStatementArgs; import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementPrincipalArgs; 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.ArrayList; import java.util.Arrays; 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() .principals(GetPolicyDocumentStatementPrincipalArgs.builder() .type("Service") .identifiers("sagemaker.amazonaws.com") .build()) .actions("sts:AssumeRole") .build()) .build()); var exampleRole = new Role("exampleRole", RoleArgs.builder() .assumeRolePolicy(assumeRole.json()) .build()); final var test = SagemakerFunctions.getPrebuiltEcrImage(GetPrebuiltEcrImageArgs.builder() .repositoryName("kmeans") .build()); var example = new Model("example", ModelArgs.builder() .primaryContainer(ModelPrimaryContainerArgs.builder() .image(test.registryPath()) .build()) .name("my-model") .executionRoleArn(exampleRole.arn()) .build()); } }
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>arn()com.pulumi.core.Output<java.util.Optional<java.util.List<ModelContainer>>>containers()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>enableNetworkIsolation()com.pulumi.core.Output<java.lang.String>executionRoleArn()static Modelget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ModelState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<ModelInferenceExecutionConfig>inferenceExecutionConfig()com.pulumi.core.Output<java.lang.String>name()com.pulumi.core.Output<java.util.Optional<ModelPrimaryContainer>>primaryContainer()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>tags()com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>tagsAll()com.pulumi.core.Output<java.util.Optional<ModelVpcConfig>>vpcConfig()
-
-
-
Constructor Detail
-
Model
public Model(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
Model
public Model(java.lang.String name, ModelArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
Model
public Model(java.lang.String name, ModelArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN assigned by AWS to this model.
-
containers
public com.pulumi.core.Output<java.util.Optional<java.util.List<ModelContainer>>> containers()
- Returns:
- Specifies containers in the inference pipeline. If not specified, the `primaryContainer` argument is required. Fields are documented below.
-
enableNetworkIsolation
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enableNetworkIsolation()
- Returns:
- Isolates the model container. No inbound or outbound network calls can be made to or from the model container.
-
executionRoleArn
public com.pulumi.core.Output<java.lang.String> executionRoleArn()
- Returns:
- A role that SageMaker AI can assume to access model artifacts and docker images for deployment.
-
inferenceExecutionConfig
public com.pulumi.core.Output<ModelInferenceExecutionConfig> inferenceExecutionConfig()
- Returns:
- Specifies details of how containers in a multi-container endpoint are called. See Inference Execution Config.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Name of the model (must be unique). If omitted, the provider will assign a random, unique name.
-
primaryContainer
public com.pulumi.core.Output<java.util.Optional<ModelPrimaryContainer>> primaryContainer()
- Returns:
- 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.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
-
vpcConfig
public com.pulumi.core.Output<java.util.Optional<ModelVpcConfig>> vpcConfig()
- Returns:
- Specifies the VPC that you want your model to connect to. This configuration is used in hosting services and in batch transform. See VPC Config.
-
get
public static Model get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable ModelState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-