MLS-C01 Question 363
Select 3You have trained a machine learning model in Amazon SageMaker and deployed it as an endpoint. You want to test the endpoint by sending HTTP requests to it from your application. Which of the following steps are required to properly interact with the endpoint?
- A
Use the SageMaker runtime client to invoke the endpoint with the appropriate content type.
- B
Ensure the IAM role associated with the endpoint has access to the SageMaker runtime API.
- C
Send the request using the AWS Management Console's test interface for SageMaker endpoints.
- D
Include the endpoint name and the payload in the HTTP request body.
- E
Configure the endpoint to accept only requests from specific IP addresses.
Show answer and explanation
Correct answers: A, B, D
Explanation
To interact with a SageMaker endpoint programmatically, you must use the SageMaker runtime client and provide the endpoint name and payload in the request. Additionally, the IAM role associated with the requester must have the necessary permissions to invoke the endpoint. While other options like IP restrictions or using the AWS Management Console may be useful in specific cases, they are not required steps for programmatic interaction.
- A. Correct.
Correct. The SageMaker runtime client is used to invoke the endpoint and communicate with it. The content type (e.g., JSON or CSV) must match the model's expected input format.
- B. Correct.
Correct. The IAM role must have sufficient permissions to allow the application to invoke the endpoint via the SageMaker runtime API.
- C. Incorrect.
Incorrect. While the AWS Management Console provides a test interface for SageMaker endpoints, this is not how you would interact programmatically with the endpoint from your application.
- D. Correct.
Correct. The endpoint name identifies the deployed model, and the payload contains the data for inference. These must be included in the request body.
- E. Incorrect.
Incorrect. Configuring endpoint-specific IP restrictions is not a required step for interacting with the endpoint, though it can enhance security in certain scenarios.