1Z0-997-25 Question 16
Select 2You have developed a serverless function on Oracle Cloud Infrastructure (OCI) to process large JSON payloads from external clients. You want to make this function accessible via an API Gateway with proper authentication and insights into usage metrics, minimizing additional code changes in your function. Which two steps should you perform to achieve this goal?
- A
- Configure the API Gateway deployment to integrate with the function backend, enabling JWT token validation at the gateway level and enabling the built-in metrics feature.
- B
- Implement all authentication logic directly within the function� code, bypassing any gateway-level authorizations.
- C
- Add a resource path in the API Gateway for the function, select the function as the backend, and enable request/response transformation in the new deployment route.
- D
- Rely on the function� default code for usage metrics collection since OCI Functions automatically provides real-time usage statistics for external calls.
Show answer and explanation
Correct answers: A, C
Explanation
When exposing serverless functions through the OCI API Gateway, you should configure routes that invoke your function as the backend while offloading authentication to the gateway itself. This reduces code complexity and leverages OCI� built-in authentication mechanisms. Additionally, enabling metrics and logging in the API Gateway is a best practice for monitoring usage and performance. Refer to the Oracle documentation on 'API Gateway Integration with Functions' and 'Configuring Logging and Metrics for API Gateway' for detailed steps and best practices.
- A. Correct.
Option 1 is correct. Configuring an API Gateway deployment that integrates directly with your function backend and enabling JWT or other token validation at the gateway significantly reduces the need for custom code in the function. In addition, enabling built-in gateway metrics allows you to track usage, errors, and performance without extra instrumentation in your function.
- B. Incorrect.
Option 2 is incorrect. While you can implement authentication manually within the function, this approach increases code complexity and defeats the purpose of using API Gateway� built-in authentication mechanisms. Best practice is to configure authentication and authorization at the gateway level, offloading that burden from the function code.
- C. Correct.
Option 3 is correct. Creating a resource path in the API Gateway deployment and selecting the serverless function as the backend properly routes requests to the function. Enabling request/response transformation can help manage headers, payload formats, or custom error responses before the request reaches your code or after the response is generated.
- D. Incorrect.
Option 4 is incorrect. OCI Functions does not automatically provide detailed real-time usage metrics for external calls out of the box. You must leverage the API Gateway� built-in metrics and logging options (or other observability tools) to gain insights into the usage and performance of your function.