Skip to content
v2.274.0

Experimental

@aws-cdk/aws-sagemaker-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

ModelProps Struct ​

Construction properties for a SageMaker Model.

Example ​

ts
import * as sagemaker from '@aws-cdk/aws-sagemaker-alpha';

declare const image: sagemaker.ContainerImage;
declare const modelData: sagemaker.ModelData;

const model = new sagemaker.Model(this, 'ContainerModel', {
  containers: [
    {
      image,
      modelData,
    }
  ],
  networkIsolation: true,
});

Properties ​

allowAllOutboundbooleanallow_all_outboundboolallowAllOutboundBooleanAllowAllOutboundboolAllowAllOutbound*bool= true#
Whether to allow the SageMaker Model to send all network traffic.

If set to false, you must individually add traffic rules to allow the SageMaker Model to connect to network targets.

Only used if 'vpc' is supplied.

containersContainerDefinition[]containerstyping.List[ContainerDefinition]containersList<ContainerDefinition>ContainersContainerDefinition[]Containers*[]ContainerDefinition= none#
Specifies the container definitions for this model, consisting of either a single primary container or an inference pipeline of multiple containers.
modelNamestringmodel_namestrmodelNameStringModelNamestringModelName*string#
Name of the SageMaker Model.

Default: AWS CloudFormation generates a unique physical ID and uses that ID for the model's name.

networkIsolationbooleannetwork_isolationboolnetworkIsolationBooleanNetworkIsolationboolNetworkIsolation*bool= false#
Whether to enable network isolation for the model container.

When enabled, no inbound or outbound network calls can be made to or from the model container.

roleIRoleroleIRoleroleIRoleRoleIRoleRoleIRole#
The IAM role that the Amazon SageMaker service assumes.

Default: a new IAM role will be created with the AmazonSageMakerFullAccess policy attached.

securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup#
The security groups to associate to the Model.

Default: A security group will be automatically created if 'vpc' is supplied

If no security groups are provided and 'vpc' is configured, one security group will be created automatically.

vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpc= none#
The VPC to deploy model containers to.
vpcSubnetsSubnetSelectionvpc_subnetsSubnetSelectionvpcSubnetsSubnetSelectionVpcSubnetsSubnetSelectionVpcSubnetsSubnetSelection= none#
The VPC subnets to use when deploying model containers.