AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::SageMaker::Model

CfnModel

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](https://docs.aws.amazon.com/sagemaker/latest/dg/how-it-works-hosting.html) in the *Amazon SageMaker Developer Guide* .

Import

import { CfnModel } from 'aws-cdk-lib/aws-sagemaker';

Or use the module namespace:

import * as sagemaker from 'aws-cdk-lib/aws-sagemaker';
// sagemaker.CfnModel

Properties

Configuration passed to the constructor as CfnModelProps.

containersOptional
IResolvable | IResolvable | ContainerDefinitionProperty[]

Specifies the containers in the inference pipeline.

enableNetworkIsolationOptional
boolean | IResolvable

Isolates the model container. No inbound or outbound network calls can be made to or from the model container.

executionRoleArnOptional
string

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](https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html) . > To be able to pass this role to SageMaker, the caller of this API must have the `iam:PassRole` permission.

inferenceExecutionConfigOptional
IResolvable | InferenceExecutionConfigProperty

Specifies details of how containers in a multi-container endpoint are called.

modelNameOptional
string

The name of the new model.

primaryContainerOptional
IResolvable | ContainerDefinitionProperty

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.

tagsOptional
CfnTag[]

A list of key-value pairs to apply to this resource. For more information, see [Resource Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) and [Using Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) in the *AWS Billing and Cost Management User Guide* .

vpcConfigOptional
IResolvable | VpcConfigProperty

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. 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](https://docs.aws.amazon.com/sagemaker/latest/dg/host-vpc.html) and [Protect Data in Batch Transform Jobs by Using an Amazon Virtual Private Cloud](https://docs.aws.amazon.com/sagemaker/latest/dg/batch-vpc.html) .

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter