exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 69 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 69
Topic #: 1
[All AWS Certified Developer Associate Questions]

A developer is designing an AWS Lambda function to perform a maintenance activity. The developer will use Amazon EventBridge (Amazon CloudWatch Events) to invoke the function on an hourly schedule. The developer wants the function to log information at different levels of detail according to the value of a log level variable. The developer must design the function so that the log level can be set without requiring a change to the function code.
Which solution will meet these requirements?

  • A. Add a custom log level parameter for the Lambda function. Set the parameter by using the Lambda console
  • B. Set the log level in a Lambda environment variable
  • C. Set the log level in the Amazon CloudWatch Logs console.
  • D. Add a custom log level parameter for the Lambda function. Set the parameter by using the AWS CLI.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Spamuel
Highly Voted 2 years, 7 months ago
B is correct: https://docs.aws.amazon.com/solutions/latest/operations-conductor/appendix-d.html
upvoted 12 times
...
sumanshu
Most Recent 4 months, 1 week ago
Selected Answer: B
B) Correct - Lambda environment variables are a simple and efficient way to pass configuration values, such as a log level, to a function. These variables can be changed without modifying the Lambda function code. The function code can access the environment variables at runtime to determine the log level.
upvoted 1 times
...
Lucas_Luke
1 year, 6 months ago
Selected Answer: B
B is correct
upvoted 1 times
...
Punit007
1 year, 9 months ago
B, Is the correct option
upvoted 1 times
...
rcaliandro
1 year, 10 months ago
Selected Answer: B
B, we can set the enviroment variable to specific the log Level. In this way we need only to change the variable rather than the code
upvoted 1 times
...
MrTee
2 years ago
Selected Answer: B
By setting the log level as an environment variable, the Lambda function can read the value of this variable at runtime and adjust the level of logging accordingly, without the need for a code change. This makes it easier to change the log level without needing to redeploy the function.
upvoted 1 times
...
Rpod
2 years ago
Selected Answer: B
Voted B - because setting somehing as log levels as parameters to the function seems wrong .Parameters should be something to do with function execution
upvoted 1 times
...
ShriniW
2 years, 2 months ago
Each Lambda function has a LogLevel environment variable. To change the value, you can change only specific microservice Lambda function’s log level. Ans: B
upvoted 1 times
...
sichilam
2 years, 3 months ago
B is correct
upvoted 1 times
...
gpit
2 years, 4 months ago
Note: "You define environment variables on the unpublished version of your function. When you publish a version, the environment variables are locked for that version along with other version-specific configuration. " https://docs.amazonaws.cn/en_us/lambda/latest/dg/configuration-envvars.html
upvoted 2 times
...
dark_cherrymon
2 years, 5 months ago
it's B "Each Lambda function has a LogLevel environment variable" https://docs.aws.amazon.com/solutions/latest/operations-conductor/appendix-d.html
upvoted 1 times
...
cloud_collector
2 years, 5 months ago
Selected Answer: B
You can use environment variables to adjust your function's behavior without updating code. An environment variable is a pair of strings that is stored in a function's version-specific configuration. The Lambda runtime makes environment variables available to your code and sets additional environment variables that contain information about the function and invocation request.
upvoted 1 times
...
Norocas
2 years, 6 months ago
Selected Answer: B
I would say B because you don't need to change the Lambda code
upvoted 2 times
...
Arnaud92
2 years, 6 months ago
Selected Answer: B
I vote B
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago