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.CustomResource
Provides a SageMaker model resource. ## Example Usage Basic usage: <!--Start PulumiCodeChooser -->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()); } }
-
-
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 Model
get(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.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:
- The Amazon Resource Name (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 `primary_container` 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 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:
- The name of the model (must be unique). If omitted, this provider will assign a random, unique name.
-
primaryContainer
public com.pulumi.core.Output<java.util.Optional<ModelPrimaryContainer>> primaryContainer()
- Returns:
- 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.
-
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 `default_tags` 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 `default_tags` 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. VpcConfig is used in hosting services and in batch transform.
-
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.
-
-