in src/stepfunctions/steps/sagemaker.py [0:0]
def __init__(self, state_id, endpoint_name, endpoint_config_name, tags=None, update=False, **kwargs):
"""
Args:
state_id (str): State name whose length **must be** less than or equal to 128 unicode characters. State names **must be** unique within the scope of the whole state machine.
endpoint_name (str or Placeholder): The name of the endpoint to create. We recommend to use :py:class:`~stepfunctions.inputs.ExecutionInput` placeholder collection to pass the value dynamically in each execution.
endpoint_config_name (str or Placeholder): The name of the endpoint configuration to use for the endpoint. We recommend to use :py:class:`~stepfunctions.inputs.ExecutionInput` placeholder collection to pass the value dynamically in each execution.
update (bool, optional): Boolean flag set to `True` if endpoint must to be updated. Set to `False` if new endpoint must be created. (default: False)
tags (list[dict], optional): `List of tags <https://docs.aws.amazon.com/sagemaker/latest/dg/API_Tag.html>`_ to associate with the resource.
"""
parameters = {
"EndpointConfigName": endpoint_config_name,
"EndpointName": endpoint_name,
}
if tags:
parameters['Tags'] = tags_dict_to_kv_list(tags)
if update:
"""
Example resource arn: arn:aws:states:::sagemaker:updateEndpoint
"""
kwargs[Field.Resource.value] = get_service_integration_arn(SAGEMAKER_SERVICE_NAME,
SageMakerApi.UpdateEndpoint)
else:
"""
Example resource arn: arn:aws:states:::sagemaker:createEndpoint
"""
kwargs[Field.Resource.value] = get_service_integration_arn(SAGEMAKER_SERVICE_NAME,
SageMakerApi.CreateEndpoint)
kwargs[Field.Parameters.value] = parameters
super(EndpointStep, self).__init__(state_id, **kwargs)