ModelProps

class aws_cdk.aws_sagemaker_alpha.ModelProps(*, allow_all_outbound=None, containers=None, model_name=None, role=None, security_groups=None, vpc=None, vpc_subnets=None)

Bases: object

(experimental) Construction properties for a SageMaker Model.

Parameters:
  • allow_all_outbound (Optional[bool]) – (experimental) 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. Default: true

  • containers (Optional[Sequence[Union[ContainerDefinition, Dict[str, Any]]]]) – (experimental) Specifies the container definitions for this model, consisting of either a single primary container or an inference pipeline of multiple containers. Default: - none

  • model_name (Optional[str]) – (experimental) Name of the SageMaker Model. Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the model’s name.

  • role (Optional[IRole]) – (experimental) The IAM role that the Amazon SageMaker service assumes. Default: - a new IAM role will be created with the AmazonSageMakerFullAccess policy attached.

  • security_groups (Optional[Sequence[ISecurityGroup]]) – (experimental) The security groups to associate to the Model. If no security groups are provided and ‘vpc’ is configured, one security group will be created automatically. Default: - A security group will be automatically created if ‘vpc’ is supplied

  • vpc (Optional[IVpc]) – (experimental) The VPC to deploy model containers to. Default: - none

  • vpc_subnets (Union[SubnetSelection, Dict[str, Any], None]) – (experimental) The VPC subnets to use when deploying model containers. Default: - none

Stability:

experimental

ExampleMetadata:

infused

Example:

import aws_cdk.aws_sagemaker_alpha as sagemaker
import path as path


image = sagemaker.ContainerImage.from_asset(path.join("path", "to", "Dockerfile", "directory"))
model_data = sagemaker.ModelData.from_asset(path.join("path", "to", "artifact", "file.tar.gz"))

model = sagemaker.Model(self, "PrimaryContainerModel",
    containers=[sagemaker.ContainerDefinition(
        image=image,
        model_data=model_data
    )
    ]
)

Attributes

allow_all_outbound

(experimental) 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.

Default:

true

Stability:

experimental

containers

(experimental) Specifies the container definitions for this model, consisting of either a single primary container or an inference pipeline of multiple containers.

Default:
  • none

Stability:

experimental

model_name

(experimental) Name of the SageMaker Model.

Default:

  • AWS CloudFormation generates a unique physical ID and uses that ID for the model’s

name.

Stability:

experimental

role

(experimental) The IAM role that the Amazon SageMaker service assumes.

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

See:

https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html#sagemaker-roles-createmodel-perms

Stability:

experimental

security_groups

(experimental) The security groups to associate to the Model.

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

Default:
  • A security group will be automatically created if ‘vpc’ is supplied

Stability:

experimental

vpc

(experimental) The VPC to deploy model containers to.

Default:
  • none

Stability:

experimental

vpc_subnets

(experimental) The VPC subnets to use when deploying model containers.

Default:
  • none

Stability:

experimental