java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:24.327Z") @Stability(Stable) public class CfnModel extends CfnResource implements IInspectable, ITaggable
The AWS::SageMaker::Model resource to create a model to host at an Amazon SageMaker endpoint.

For more information, see Deploying a Model on Amazon SageMaker Hosting Services in the Amazon SageMaker Developer Guide .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.sagemaker.*;
 Object environment;
 CfnModel cfnModel = CfnModel.Builder.create(this, "MyCfnModel")
         .containers(List.of(ContainerDefinitionProperty.builder()
                 .containerHostname("containerHostname")
                 .environment(environment)
                 .image("image")
                 .imageConfig(ImageConfigProperty.builder()
                         .repositoryAccessMode("repositoryAccessMode")
                         // the properties below are optional
                         .repositoryAuthConfig(RepositoryAuthConfigProperty.builder()
                                 .repositoryCredentialsProviderArn("repositoryCredentialsProviderArn")
                                 .build())
                         .build())
                 .inferenceSpecificationName("inferenceSpecificationName")
                 .mode("mode")
                 .modelDataSource(ModelDataSourceProperty.builder()
                         .s3DataSource(S3DataSourceProperty.builder()
                                 .compressionType("compressionType")
                                 .s3DataType("s3DataType")
                                 .s3Uri("s3Uri")
                                 // the properties below are optional
                                 .modelAccessConfig(ModelAccessConfigProperty.builder()
                                         .acceptEula(false)
                                         .build())
                                 .build())
                         .build())
                 .modelDataUrl("modelDataUrl")
                 .modelPackageName("modelPackageName")
                 .multiModelConfig(MultiModelConfigProperty.builder()
                         .modelCacheSetting("modelCacheSetting")
                         .build())
                 .build()))
         .enableNetworkIsolation(false)
         .executionRoleArn("executionRoleArn")
         .inferenceExecutionConfig(InferenceExecutionConfigProperty.builder()
                 .mode("mode")
                 .build())
         .modelName("modelName")
         .primaryContainer(ContainerDefinitionProperty.builder()
                 .containerHostname("containerHostname")
                 .environment(environment)
                 .image("image")
                 .imageConfig(ImageConfigProperty.builder()
                         .repositoryAccessMode("repositoryAccessMode")
                         // the properties below are optional
                         .repositoryAuthConfig(RepositoryAuthConfigProperty.builder()
                                 .repositoryCredentialsProviderArn("repositoryCredentialsProviderArn")
                                 .build())
                         .build())
                 .inferenceSpecificationName("inferenceSpecificationName")
                 .mode("mode")
                 .modelDataSource(ModelDataSourceProperty.builder()
                         .s3DataSource(S3DataSourceProperty.builder()
                                 .compressionType("compressionType")
                                 .s3DataType("s3DataType")
                                 .s3Uri("s3Uri")
                                 // the properties below are optional
                                 .modelAccessConfig(ModelAccessConfigProperty.builder()
                                         .acceptEula(false)
                                         .build())
                                 .build())
                         .build())
                 .modelDataUrl("modelDataUrl")
                 .modelPackageName("modelPackageName")
                 .multiModelConfig(MultiModelConfigProperty.builder()
                         .modelCacheSetting("modelCacheSetting")
                         .build())
                 .build())
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .vpcConfig(VpcConfigProperty.builder()
                 .securityGroupIds(List.of("securityGroupIds"))
                 .subnets(List.of("subnets"))
                 .build())
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnModel

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

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

      @Stability(Stable) public CfnModel(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnModelProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties.
    • CfnModel

      @Stability(Stable) public CfnModel(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
    • getAttrModelName

      @Stability(Stable) @NotNull public String getAttrModelName()
      The name of the model, such as MyModel .
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getContainers

      @Stability(Stable) @Nullable public Object getContainers()
      Specifies the containers in the inference pipeline.
    • setContainers

      @Stability(Stable) public void setContainers(@Nullable IResolvable value)
      Specifies the containers in the inference pipeline.
    • setContainers

      @Stability(Stable) public void setContainers(@Nullable List<Object> value)
      Specifies the containers in the inference pipeline.
    • getEnableNetworkIsolation

      @Stability(Stable) @Nullable public Object getEnableNetworkIsolation()
      Isolates the model container.
    • setEnableNetworkIsolation

      @Stability(Stable) public void setEnableNetworkIsolation(@Nullable Boolean value)
      Isolates the model container.
    • setEnableNetworkIsolation

      @Stability(Stable) public void setEnableNetworkIsolation(@Nullable IResolvable value)
      Isolates the model container.
    • getExecutionRoleArn

      @Stability(Stable) @Nullable public String getExecutionRoleArn()
      The Amazon Resource Name (ARN) of the IAM role that SageMaker can assume to access model artifacts and docker image for deployment on ML compute instances or for batch transform jobs.
    • setExecutionRoleArn

      @Stability(Stable) public void setExecutionRoleArn(@Nullable String value)
      The Amazon Resource Name (ARN) of the IAM role that SageMaker can assume to access model artifacts and docker image for deployment on ML compute instances or for batch transform jobs.
    • getInferenceExecutionConfig

      @Stability(Stable) @Nullable public Object getInferenceExecutionConfig()
      Specifies details of how containers in a multi-container endpoint are called.
    • setInferenceExecutionConfig

      @Stability(Stable) public void setInferenceExecutionConfig(@Nullable IResolvable value)
      Specifies details of how containers in a multi-container endpoint are called.
    • setInferenceExecutionConfig

      @Stability(Stable) public void setInferenceExecutionConfig(@Nullable CfnModel.InferenceExecutionConfigProperty value)
      Specifies details of how containers in a multi-container endpoint are called.
    • getModelName

      @Stability(Stable) @Nullable public String getModelName()
      The name of the new model.
    • setModelName

      @Stability(Stable) public void setModelName(@Nullable String value)
      The name of the new model.
    • getPrimaryContainer

      @Stability(Stable) @Nullable public Object getPrimaryContainer()
      The location of the primary docker image containing inference code, associated artifacts, and custom environment map that the inference code uses when the model is deployed for predictions.
    • setPrimaryContainer

      @Stability(Stable) public void setPrimaryContainer(@Nullable IResolvable value)
      The location of the primary docker image containing inference code, associated artifacts, and custom environment map that the inference code uses when the model is deployed for predictions.
    • setPrimaryContainer

      @Stability(Stable) public void setPrimaryContainer(@Nullable CfnModel.ContainerDefinitionProperty value)
      The location of the primary docker image containing inference code, associated artifacts, and custom environment map that the inference code uses when the model is deployed for predictions.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      A list of key-value pairs to apply to this resource.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      A list of key-value pairs to apply to this resource.
    • getVpcConfig

      @Stability(Stable) @Nullable public Object getVpcConfig()
      A VpcConfig object that specifies the VPC that you want your model to connect to. Control access to and from your model container by configuring the VPC. VpcConfig is used in hosting services and in batch transform. For more information, see Protect Endpoints by Using an Amazon Virtual Private Cloud and Protect Data in Batch Transform Jobs by Using an Amazon Virtual Private Cloud .
    • setVpcConfig

      @Stability(Stable) public void setVpcConfig(@Nullable IResolvable value)
      A VpcConfig object that specifies the VPC that you want your model to connect to. Control access to and from your model container by configuring the VPC. VpcConfig is used in hosting services and in batch transform. For more information, see Protect Endpoints by Using an Amazon Virtual Private Cloud and Protect Data in Batch Transform Jobs by Using an Amazon Virtual Private Cloud .
    • setVpcConfig

      @Stability(Stable) public void setVpcConfig(@Nullable CfnModel.VpcConfigProperty value)
      A VpcConfig object that specifies the VPC that you want your model to connect to. Control access to and from your model container by configuring the VPC. VpcConfig is used in hosting services and in batch transform. For more information, see Protect Endpoints by Using an Amazon Virtual Private Cloud and Protect Data in Batch Transform Jobs by Using an Amazon Virtual Private Cloud .