
Answer-first summary for fast verification
Answer: Assign the log group's ARN as an environment variable for the Lambda function.
The correct answer is D. By passing the log group's Amazon Resource Name (ARN) as an environment variable to the Lambda function, the developer ensures that the Lambda function can access the log group name at runtime. This approach is straightforward and maintains flexibility, allowing the application to dynamically reference resources without hardcoding values. Options A, B, and C do not provide a direct or secure way to pass the log group name to the Lambda function at runtime.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
In a serverless application using AWS Lambda and AWS CloudFormation, how can a developer ensure the application has runtime access to the name of a pre-created log group in Amazon CloudWatch Logs?
A
Utilize the AWS::Include transform to import the log group name.
B
Incorporate the log group name within the user data section.
C
Specify the log group name using the Mappings section of the template.
D
Assign the log group's ARN as an environment variable for the Lambda function.