CfnModelProps
- class aws_cdk.aws_sagemaker.CfnModelProps(*, execution_role_arn, containers=None, enable_network_isolation=None, inference_execution_config=None, model_name=None, primary_container=None, tags=None, vpc_config=None)
Bases:
object
Properties for defining a
CfnModel
.- Parameters:
execution_role_arn (
str
) – 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 . .. epigraph:: To be able to pass this role to SageMaker, the caller of this API must have theiam:PassRole
permission.containers (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ContainerDefinitionProperty
,Dict
[str
,Any
]]],None
]) – Specifies the containers in the inference pipeline.enable_network_isolation (
Union
[bool
,IResolvable
,None
]) – Isolates the model container. No inbound or outbound network calls can be made to or from the model container.inference_execution_config (
Union
[IResolvable
,InferenceExecutionConfigProperty
,Dict
[str
,Any
],None
]) – Specifies details of how containers in a multi-container endpoint are called.model_name (
Optional
[str
]) – The name of the new model.primary_container (
Union
[IResolvable
,ContainerDefinitionProperty
,Dict
[str
,Any
],None
]) – 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.tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – 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 .vpc_config (
Union
[IResolvable
,VpcConfigProperty
,Dict
[str
,Any
],None
]) – 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.VpcConfig
is 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 .
- Link:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-model.html
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_sagemaker as sagemaker # environment: Any cfn_model_props = sagemaker.CfnModelProps( execution_role_arn="executionRoleArn", # the properties below are optional containers=[sagemaker.CfnModel.ContainerDefinitionProperty( container_hostname="containerHostname", environment=environment, image="image", image_config=sagemaker.CfnModel.ImageConfigProperty( repository_access_mode="repositoryAccessMode", # the properties below are optional repository_auth_config=sagemaker.CfnModel.RepositoryAuthConfigProperty( repository_credentials_provider_arn="repositoryCredentialsProviderArn" ) ), inference_specification_name="inferenceSpecificationName", mode="mode", model_data_url="modelDataUrl", model_package_name="modelPackageName", multi_model_config=sagemaker.CfnModel.MultiModelConfigProperty( model_cache_setting="modelCacheSetting" ) )], enable_network_isolation=False, inference_execution_config=sagemaker.CfnModel.InferenceExecutionConfigProperty( mode="mode" ), model_name="modelName", primary_container=sagemaker.CfnModel.ContainerDefinitionProperty( container_hostname="containerHostname", environment=environment, image="image", image_config=sagemaker.CfnModel.ImageConfigProperty( repository_access_mode="repositoryAccessMode", # the properties below are optional repository_auth_config=sagemaker.CfnModel.RepositoryAuthConfigProperty( repository_credentials_provider_arn="repositoryCredentialsProviderArn" ) ), inference_specification_name="inferenceSpecificationName", mode="mode", model_data_url="modelDataUrl", model_package_name="modelPackageName", multi_model_config=sagemaker.CfnModel.MultiModelConfigProperty( model_cache_setting="modelCacheSetting" ) ), tags=[CfnTag( key="key", value="value" )], vpc_config=sagemaker.CfnModel.VpcConfigProperty( security_group_ids=["securityGroupIds"], subnets=["subnets"] ) )
Attributes
- containers
Specifies the containers in the inference pipeline.
- enable_network_isolation
Isolates the model container.
No inbound or outbound network calls can be made to or from the model container.
- execution_role_arn
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 . .. epigraph:
To be able to pass this role to SageMaker, the caller of this API must have the ``iam:PassRole`` permission.
- inference_execution_config
Specifies details of how containers in a multi-container endpoint are called.
- model_name
The name of the new model.
- primary_container
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.
- tags
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 .
- vpc_config
//docs.aws.amazon.com/sagemaker/latest/dg/host-vpc.html>`_ and Protect Data in Batch Transform Jobs by Using an Amazon Virtual Private Cloud .
- Link:
- Type:
A `VpcConfig <https
- Type:
//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