create_endpoint_config
async
¶
create_endpoint_config(
*,
config_overrides: Optional[AsyncSageMakerClientConfig] = None,
endpoint_config_name: Optional[EndpointConfigName] = None,
production_variants: Optional[ProductionVariantList] = None,
data_capture_config: Optional[DataCaptureConfig] = None,
tags: Optional[TagList] = None,
kms_key_id: Optional[KmsKeyId] = None,
async_inference_config: Optional[AsyncInferenceConfig] = None,
explainer_config: Optional[ExplainerConfig] = None,
shadow_production_variants: Optional[ProductionVariantList] = None,
execution_role_arn: Optional[RoleArn] = None,
vpc_config: Optional[VpcConfig] = None,
enable_network_isolation: Optional[Boolean] = None,
metrics_config: Optional[MetricsConfig] = None,
tracing_config: Optional[TracingConfig] = None,
cross_region_traffic_config: Optional[CrossRegionTrafficConfig] = None,
) -> CreateEndpointConfigOutput
Creates an endpoint configuration that SageMaker hosting services uses to deploy models. In the configuration, you identify one or more models, created using the CreateModel API, to deploy and the resources that you want SageMaker to provision. Then you call the CreateEndpoint API.
Use this API if you want to use SageMaker hosting services to deploy models into production.
In the request, you define a ProductionVariant, for each model that you want to deploy. Each ProductionVariant parameter also describes the resources that you want SageMaker to provision. This includes the number and type of ML compute instances to deploy.
If you are hosting multiple models, you also assign a VariantWeight to specify how much traffic you want to allocate to each model. For example, suppose that you want to host two models, A and B, and you assign traffic weight 2 for model A and 1 for model B. SageMaker distributes two-thirds of the traffic to Model A, and one-third to model B.
When you call CreateEndpoint, a load call is made to DynamoDB to verify that your endpoint configuration exists. When you read data from a DynamoDB table supporting Eventually Consistent Reads , the response might not reflect the results of a recently completed write operation. The response might include some stale data. If the dependent entities are not yet in DynamoDB, this causes a validation error. If you repeat your read request after a short time, the response should return the latest data. So retry logic is recommended to handle these possible issues. We also recommend that customers call DescribeEndpointConfig before calling CreateEndpoint to minimize the potential impact of a DynamoDB eventually consistent read.
Parameters:
-
endpoint_config_name(Optional[EndpointConfigName], default:None) –The name of the endpoint configuration. You specify this name in a CreateEndpoint request.
-
production_variants(Optional[ProductionVariantList], default:None) –An array of
ProductionVariantobjects, one for each model that you want to host at this endpoint. -
tags(Optional[TagList], default:None) –An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.
-
kms_key_id(Optional[KmsKeyId], default:None) –The Amazon Resource Name (ARN) of a Amazon Web Services Key Management Service key that SageMaker uses to encrypt data on the storage volume attached to the ML compute instance that hosts the endpoint.
The KmsKeyId can be any of the following formats:
-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab -
Key ARN:
arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab -
Alias name:
alias/ExampleAlias -
Alias name ARN:
arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias
The KMS key policy must grant permission to the IAM role that you specify in your
CreateEndpoint,UpdateEndpointrequests. For more information, refer to the Amazon Web Services Key Management Service section Using Key Policies in Amazon Web Services KMSCertain Nitro-based instances include local storage, dependent on the instance type. Local storage volumes are encrypted using a hardware module on the instance. If any of the models that you specify in the
ProductionVariantsparameter use nitro-based instances with local storage, theKmsKeyIdparameter does not encrypt instance local storage.For a list of instance types that support local instance storage, see Instance Store Volumes.
For more information about local instance storage encryption, see SSD Instance Store Volumes.
-
-
async_inference_config(Optional[AsyncInferenceConfig], default:None) –Specifies configuration for how an endpoint performs asynchronous inference. This is a required field in order for your Endpoint to be invoked using InvokeEndpointAsync.
-
explainer_config(Optional[ExplainerConfig], default:None) –A member of
CreateEndpointConfigthat enables explainers. -
shadow_production_variants(Optional[ProductionVariantList], default:None) –An array of
ProductionVariantobjects, one for each model that you want to host at this endpoint in shadow mode with production traffic replicated from the model specified onProductionVariants. If you use this field, you can only specify one variant forProductionVariantsand one variant forShadowProductionVariants. -
execution_role_arn(Optional[RoleArn], default:None) –The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker AI can assume to perform actions on your behalf. For more information, see SageMaker AI Roles.
To be able to pass this role to Amazon SageMaker AI, the caller of this action must have the
iam:PassRolepermission. -
enable_network_isolation(Optional[Boolean], default:None) –Sets whether all model containers deployed to the endpoint are isolated. If they are, no inbound or outbound network calls can be made to or from the model containers.
-
metrics_config(Optional[MetricsConfig], default:None) –The configuration parameters for utilization metrics.
-
tracing_config(Optional[TracingConfig], default:None) –The configuration for tracing the inference requests that the endpoint receives.
-
cross_region_traffic_config(Optional[CrossRegionTrafficConfig], default:None) –The cross-Region traffic cap for the endpoint. The cap limits the requests per second that the endpoint accepts from inference routers in other Amazon Web Services Regions. If you don't specify it, these requests aren't limited. You can't specify it with serverless variants or with
AsyncInferenceConfig. For information about the cross-Region traffic cap, see Limit requests from other Regions.
Raises:
-
ResourceLimitExceeded–You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 | |