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 classA fluent builder forCfnModel.static interfaceDescribes the container, as part of model definition.static interfaceSpecifies whether the model container is in Amazon ECR or a private Docker registry accessible from your Amazon Virtual Private Cloud (VPC).static interfaceSpecifies details about how containers in a multi-container endpoint are run.static interfaceSpecifies additional configuration for hosting multi-model endpoints.static interfaceSpecifies an authentication configuration for the private docker registry where your model image is hosted.static interfaceSpecifies 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.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe 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.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetContainers(List<Object> value) Specifies the containers in the inference pipeline.voidsetContainers(IResolvable value) Specifies the containers in the inference pipeline.voidsetEnableNetworkIsolation(Boolean value) Isolates the model container.voidIsolates the model container.voidsetExecutionRoleArn(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.voidSpecifies details of how containers in a multi-container endpoint are called.voidSpecifies details of how containers in a multi-container endpoint are called.voidsetModelName(String value) The name of the new model.voidsetPrimaryContainer(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.voidThe 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.voidsetVpcConfig(IResolvable value) A VpcConfig object that specifies the VPC that you want your model to connect to.voidA 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, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
inspectin 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrModelName
The name of the model, such asMyModel. -
getCfnProperties
- Overrides:
getCfnPropertiesin 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:PassRolepermission. -
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:PassRolepermission. -
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.VpcConfigis 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.VpcConfigis 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.VpcConfigis 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 .
-