Class CfnModel
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.sagemaker.CfnModel
- All Implemented Interfaces:
IInspectable
,ITaggable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-10-05T03:43:50.917Z")
@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 .hubAccessConfig(HubAccessConfigProperty.builder() .hubContentArn("hubContentArn") .build()) .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 .hubAccessConfig(HubAccessConfigProperty.builder() .hubContentArn("hubContentArn") .build()) .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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnModel
.static interface
Describes the container, as part of model definition.static interface
Example:static interface
Specifies whether the model container is in Amazon ECR or a private Docker registry accessible from your Amazon Virtual Private Cloud (VPC).static interface
Specifies details about how containers in a multi-container endpoint are run.static interface
The access configuration file to control access to the ML model.static interface
Specifies the location of ML model data to deploy.static interface
Specifies additional configuration for hosting multi-model endpoints.static interface
Specifies an authentication configuration for the private docker registry where your model image is hosted.static interface
Describes the S3 data source.static interface
Specifies an Amazon Virtual Private Cloud (VPC) that your SageMaker jobs, hosted models, and compute resources have access to.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnModel
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnModel
(software.amazon.jsii.JsiiObjectRef objRef) CfnModel
(software.constructs.Construct scope, String id, CfnModelProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe name of the model, such asMyModel
.Specifies the containers in the inference pipeline.Isolates the model container.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.Specifies details of how containers in a multi-container endpoint are called.The name of the new model.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.getTags()
Tag Manager which manages the tags for this resource.A list of key-value pairs to apply to this resource.A VpcConfig object that specifies the VPC that you want your model to connect to.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setContainers
(List<Object> value) Specifies the containers in the inference pipeline.void
setContainers
(IResolvable value) Specifies the containers in the inference pipeline.void
setEnableNetworkIsolation
(Boolean value) Isolates the model container.void
Isolates the model container.void
setExecutionRoleArn
(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.void
Specifies details of how containers in a multi-container endpoint are called.void
Specifies details of how containers in a multi-container endpoint are called.void
setModelName
(String value) The name of the new model.void
setPrimaryContainer
(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.void
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.void
setTagsRaw
(List<CfnTag> value) A list of key-value pairs to apply to this resource.void
setVpcConfig
(IResolvable value) A VpcConfig object that specifies the VPC that you want your model to connect to.void
A VpcConfig object that specifies the VPC that you want your model to connect to.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- 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 classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrId
-
getAttrModelName
The name of the model, such asMyModel
. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getContainers
Specifies the containers in the inference pipeline. -
setContainers
Specifies the containers in the inference pipeline. -
setContainers
Specifies the containers in the inference pipeline. -
getEnableNetworkIsolation
Isolates the model container. -
setEnableNetworkIsolation
Isolates the model container. -
setEnableNetworkIsolation
Isolates the model container. -
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
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
Specifies details of how containers in a multi-container endpoint are called. -
setInferenceExecutionConfig
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
The name of the new model. -
setModelName
The name of the new model. -
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
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
A list of key-value pairs to apply to this resource. -
setTagsRaw
A list of key-value pairs to apply to this resource. -
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
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
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 .
-