ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 53 - DVA-C02 discussion

Report
Export

A developer is writing an AWS Lambda function. The developer wants to log key events that occur while the Lambda function runs. The developer wants to include a unique identifier to associate the events with a specific function invocation. The developer adds the following code to the Lambda function:

Which solution will meet this requirement?

A.
Obtain the request identifier from the AWS request ID field in the context object. Configure the application to write logs to standard output.
Answers
A.
Obtain the request identifier from the AWS request ID field in the context object. Configure the application to write logs to standard output.
B.
Obtain the request identifier from the AWS request ID field in the event object. Configure the application to write logs to a file.
Answers
B.
Obtain the request identifier from the AWS request ID field in the event object. Configure the application to write logs to a file.
C.
Obtain the request identifier from the AWS request ID field in the event object. Configure the application to write logs to standard output.
Answers
C.
Obtain the request identifier from the AWS request ID field in the event object. Configure the application to write logs to standard output.
D.
Obtain the request identifier from the AWS request ID field in the context object. Configure the application to write logs to a file.
Answers
D.
Obtain the request identifier from the AWS request ID field in the context object. Configure the application to write logs to a file.
Suggested answer: A

Explanation:

https://docs.aws.amazon.com/lambda/latest/dg/nodejs-context.html

https://docs.aws.amazon.com/lambda/latest/dg/nodejs-logging.html

There is no explicit information for the runtime, the code is written in Node.js. AWS Lambda is a service that lets developers run code without provisioning or managing servers.

The developer can use the AWS request ID field in the context object to obtain a unique identifier for each function invocation. The developer can configure the application to write logs to standard output, which will be captured by Amazon CloudWatch Logs. This solution will meet the requirement of logging key events with a unique identifier.

Reference:

[What Is AWS Lambda? - AWS Lambda]

[AWS Lambda Function Handler in Node.js - AWS Lambda]

[Using Amazon CloudWatch - AWS Lambda]

asked 16/09/2024
Joel Vasco Rodriguez
45 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first