@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:41.902Z") @Stability(value=Stable) public class CfnModel extends CfnResource implements IInspectable
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();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnModel.Builder
A fluent builder for
CfnModel. |
static interface |
CfnModel.ContainerDefinitionProperty
Describes the container, as part of model definition.
|
static interface |
CfnModel.ImageConfigProperty
Specifies whether the model container is in Amazon ECR or a private Docker registry accessible from your Amazon Virtual Private Cloud (VPC).
|
static interface |
CfnModel.InferenceExecutionConfigProperty
Specifies details about how containers in a multi-container endpoint are run.
|
static interface |
CfnModel.MultiModelConfigProperty
Specifies additional configuration for hosting multi-model endpoints.
|
static interface |
CfnModel.RepositoryAuthConfigProperty
Specifies an authentication configuration for the private docker registry where your model image is hosted.
|
static interface |
CfnModel.VpcConfigProperty
Specifies a VPC that your training jobs and hosted models have access to.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnModel(software.constructs.Construct scope,
String id,
CfnModelProps props)
Create a new `AWS::SageMaker::Model`.
|
protected |
CfnModel(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnModel(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrModelName()
The name of the model, such as `MyModel` .
|
protected Map<String,Object> |
getCfnProperties() |
Object |
getContainers()
Specifies the containers in the inference pipeline.
|
Object |
getEnableNetworkIsolation()
Isolates the model container.
|
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.
|
Object |
getInferenceExecutionConfig()
Specifies details of how containers in a multi-container endpoint are called.
|
String |
getModelName()
The name of the new model.
|
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.
|
TagManager |
getTags()
A list of key-value pairs to apply to this resource.
|
Object |
getVpcConfig()
A [VpcConfig](https://docs.aws.amazon.com/sagemaker/latest/dg/API_VpcConfig.html) object that specifies the VPC that you want your model to connect to.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setContainers(IResolvable value)
Specifies the containers in the inference pipeline.
|
void |
setContainers(List<Object> value)
Specifies the containers in the inference pipeline.
|
void |
setEnableNetworkIsolation(Boolean value)
Isolates the model container.
|
void |
setEnableNetworkIsolation(IResolvable value)
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 |
setInferenceExecutionConfig(CfnModel.InferenceExecutionConfigProperty value)
Specifies details of how containers in a multi-container endpoint are called.
|
void |
setInferenceExecutionConfig(IResolvable value)
Specifies details of how containers in a multi-container endpoint are called.
|
void |
setModelName(String value)
The name of the new model.
|
void |
setPrimaryContainer(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.
|
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 |
setVpcConfig(CfnModel.VpcConfigProperty value)
A [VpcConfig](https://docs.aws.amazon.com/sagemaker/latest/dg/API_VpcConfig.html) object that specifies the VPC that you want your model to connect to.
|
void |
setVpcConfig(IResolvable value)
A [VpcConfig](https://docs.aws.amazon.com/sagemaker/latest/dg/API_VpcConfig.html) object that specifies the VPC that you want your model to connect to.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnModel(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnModel(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnModel(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnModelProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrModelName()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
For more information, see Resource Tag and Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide .
@Stability(value=Stable) @NotNull public String getExecutionRoleArn()
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.
@Stability(value=Stable)
public void setExecutionRoleArn(@NotNull
String value)
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.
@Stability(value=Stable) @Nullable public Object getContainers()
@Stability(value=Stable)
public void setContainers(@Nullable
IResolvable value)
@Stability(value=Stable)
public void setContainers(@Nullable
List<Object> value)
@Stability(value=Stable) @Nullable public Object getEnableNetworkIsolation()
No inbound or outbound network calls can be made to or from the model container.
@Stability(value=Stable)
public void setEnableNetworkIsolation(@Nullable
Boolean value)
No inbound or outbound network calls can be made to or from the model container.
@Stability(value=Stable)
public void setEnableNetworkIsolation(@Nullable
IResolvable value)
No inbound or outbound network calls can be made to or from the model container.
@Stability(value=Stable) @Nullable public Object getInferenceExecutionConfig()
@Stability(value=Stable)
public void setInferenceExecutionConfig(@Nullable
CfnModel.InferenceExecutionConfigProperty value)
@Stability(value=Stable)
public void setInferenceExecutionConfig(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public String getModelName()
@Stability(value=Stable)
public void setModelName(@Nullable
String value)
@Stability(value=Stable) @Nullable public Object getPrimaryContainer()
@Stability(value=Stable)
public void setPrimaryContainer(@Nullable
CfnModel.ContainerDefinitionProperty value)
@Stability(value=Stable)
public void setPrimaryContainer(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Object getVpcConfig()
@Stability(value=Stable)
public void setVpcConfig(@Nullable
CfnModel.VpcConfigProperty value)
@Stability(value=Stable)
public void setVpcConfig(@Nullable
IResolvable value)
Copyright © 2022. All rights reserved.