@@ -2312,11 +2312,16 @@ def create_endpoint_config_from_existing(
2312
2312
existing_config_name (str): Name of the existing Amazon SageMaker endpoint
2313
2313
configuration.
2314
2314
new_tags(List[dict[str, str]]): Optional. The list of tags to add to the endpoint
2315
- config.
2315
+ config. If not specified, the tags of the existing endpoint configuration are used.
2316
+ If any of the existing tags are reserved AWS ones (i.e. begin with "aws"),
2317
+ they are not carried over to the new endpoint configuration.
2316
2318
new_kms_key (str): The KMS key that is used to encrypt the data on the storage volume
2317
- attached to the instance hosting the endpoint.
2319
+ attached to the instance hosting the endpoint (default: None). If not specified,
2320
+ the KMS key of the existing endpoint configuration is used.
2318
2321
new_data_capture_config_dict (dict): Specifies configuration related to Endpoint data
2319
- capture for use with Amazon SageMaker Model Monitoring. Default: None.
2322
+ capture for use with Amazon SageMaker Model Monitoring (default: None).
2323
+ If not specified, the data capture configuration of the existing
2324
+ endpoint configuration is used.
2320
2325
2321
2326
Returns:
2322
2327
str: Name of the endpoint point configuration created.
@@ -2328,17 +2333,14 @@ def create_endpoint_config_from_existing(
2328
2333
EndpointConfigName = existing_config_name
2329
2334
)
2330
2335
2331
- existing_tags = self .sagemaker_client .list_tags (
2332
- ResourceArn = existing_endpoint_config_desc ["EndpointConfigArn" ]
2333
- )
2334
-
2335
- request_tags = new_tags or existing_tags ["Tags" ]
2336
-
2337
2336
request = {
2338
2337
"EndpointConfigName" : new_config_name ,
2339
2338
"ProductionVariants" : existing_endpoint_config_desc ["ProductionVariants" ],
2340
2339
}
2341
2340
2341
+ request_tags = new_tags or self .list_tags (
2342
+ existing_endpoint_config_desc ["EndpointConfigArn" ]
2343
+ )
2342
2344
if request_tags :
2343
2345
request ["Tags" ] = request_tags
2344
2346
0 commit comments