Skip to content

InvokeEndpointAsync

Source: src/AWS/SageMakerRuntime/InvokeEndpointAsync.ts

Runtime binding for sagemaker:InvokeEndpointAsync — enqueue an asynchronous inference request against a deployed SageMaker async endpoint. The request payload is read from S3 (InputLocation) and the result is written back to S3; the call returns immediately with an OutputLocation.

The binding takes one or more endpoint names and grants the function sagemaker:InvokeEndpointAsync scoped to exactly those endpoint ARNs.

// init
const invokeAsync = yield* AWS.SageMakerRuntime.InvokeEndpointAsync(
"my-async-endpoint",
);
// runtime
const result = yield* invokeAsync({
ContentType: "application/json",
InputLocation: "s3://my-bucket/input/request.json",
});
// result.OutputLocation — poll S3 for the written inference result