Class CfnModel
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::SageMaker::Model
.
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") .executionRoleArn("executionRoleArn") // the properties below are optional .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") .modelDataUrl("modelDataUrl") .modelPackageName("modelPackageName") .multiModelConfig(MultiModelConfigProperty.builder() .modelCacheSetting("modelCacheSetting") .build()) .build())) .enableNetworkIsolation(false) .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") .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();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
A fluent builder forCfnModel
.static interface
Describes the container, as part of model definition.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
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
Specifies a VPC that your training jobs and hosted models 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.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
Constructors -
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()
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
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.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
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 Construct scope, @NotNull String id, @NotNull CfnModelProps props) Create a newAWS::SageMaker::Model
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrModelName
The name of the model, such asMyModel
. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
A list of key-value pairs to apply to this resource.For more information, see Resource Tag and Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide .
-
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.Deploying on ML compute instances is part of model hosting. For more information, see SageMaker Roles .
To be able to pass this role to SageMaker, the caller of this API must have the
iam:PassRole
permission. -
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.Deploying on ML compute instances is part of model hosting. For more information, see SageMaker Roles .
To be able to pass this role to SageMaker, the caller of this API must have the
iam:PassRole
permission. -
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.No inbound or outbound network calls can be made to or from the model container.
-
setEnableNetworkIsolation
Isolates the model container.No inbound or outbound network calls can be made to or from the model container.
-
setEnableNetworkIsolation
Isolates the model container.No inbound or outbound network calls can be made to or from the model container.
-
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. -
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 .
-