java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.sagemaker.alpha.Model
All Implemented Interfaces:
IEnvironmentAware, IResource, IConnectable, IGrantable, IModel, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.133.0 (build 0f43e37)", date="2026-06-16T16:14:49.669Z") @Stability(Experimental) public class Model extends Resource implements IModel
(experimental) Defines a SageMaker Model.

Example:

 import software.amazon.awscdk.services.sagemaker.alpha.*;
 ContainerImage image;
 ModelData modelData;
 Model model = Model.Builder.create(this, "ContainerModel")
         .containers(List.of(ContainerDefinition.builder()
                 .image(image)
                 .modelData(modelData)
                 .build()))
         .networkIsolation(true)
         .build();
 
  • Field Details

    • PROPERTY_INJECTION_ID

      @Stability(Experimental) public static final String PROPERTY_INJECTION_ID
      (experimental) Uniquely identifies this class.
  • Constructor Details

    • Model

      protected Model(software.amazon.jsii.JsiiObjectRef objRef)
    • Model

      protected Model(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Model

      @Stability(Experimental) public Model(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ModelProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • Model

      @Stability(Experimental) public Model(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • fromModelArn

      @Stability(Experimental) @NotNull public static IModel fromModelArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String modelArn)
      (experimental) Imports a Model defined either outside the CDK or in a different CDK stack.

      Parameters:
      scope - the Construct scope. This parameter is required.
      id - the resource id. This parameter is required.
      modelArn - the ARN of the model. This parameter is required.
    • fromModelAttributes

      @Stability(Experimental) @NotNull public static IModel fromModelAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ModelAttributes attrs)
      (experimental) Imports a Model defined either outside the CDK or in a different CDK stack.

      Parameters:
      scope - the Construct scope. This parameter is required.
      id - the resource id. This parameter is required.
      attrs - the attributes of the model to import. This parameter is required.
    • fromModelName

      @Stability(Experimental) @NotNull public static IModel fromModelName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String modelName)
      (experimental) Imports a Model defined either outside the CDK or in a different CDK stack.

      Parameters:
      scope - the Construct scope. This parameter is required.
      id - the resource id. This parameter is required.
      modelName - the name of the model. This parameter is required.
    • addContainer

      @Stability(Experimental) public void addContainer(@NotNull ContainerDefinition container)
      (experimental) Add containers to the model.

      Parameters:
      container - The container definition to add. This parameter is required.
    • addToRolePolicy

      @Stability(Experimental) public void addToRolePolicy(@NotNull PolicyStatement statement)
      (experimental) Adds a statement to the IAM role assumed by the instance.

      Specified by:
      addToRolePolicy in interface IModel
      Parameters:
      statement - This parameter is required.
    • getConnections

      @Stability(Experimental) @NotNull public Connections getConnections()
      (experimental) An accessor for the Connections object that will fail if this Model does not have a VPC configured.
      Specified by:
      getConnections in interface IConnectable
    • getGrantPrincipal

      @Stability(Experimental) @NotNull public IPrincipal getGrantPrincipal()
      (experimental) The principal this Model is running as.
      Specified by:
      getGrantPrincipal in interface IGrantable
    • getModelArn

      @Stability(Experimental) @NotNull public String getModelArn()
      (experimental) Returns the ARN of this model.
      Specified by:
      getModelArn in interface IModel
    • getModelName

      @Stability(Experimental) @NotNull public String getModelName()
      (experimental) Returns the name of the model.
      Specified by:
      getModelName in interface IModel
    • getRole

      @Stability(Experimental) @Nullable public IRole getRole()
      (experimental) Execution role for SageMaker Model.
      Specified by:
      getRole in interface IModel