AWS Certified Developer – Associate — Question 443

A developer is creating a serverless application that uses an AWS Lambda function The developer will use AWS CloudFormation to deploy the application The application will write logs to Amazon CloudWatch Logs. The developer has created a log group in a CloudFormation template for the application to use. The developer needs to modify the CloudFormation template to make the name of the log group available to the application at runtime.
Which solution will meet this requirement?

Answer options

Correct answer: D

Explanation

Passing the log group's ARN as an environment variable is the standard way to make resource properties available to an AWS Lambda function at runtime. The Mappings section and AWS::Include transform are used for static configurations and template reuse, not for passing dynamic runtime values to Lambda. UserData is specific to EC2 instances and cannot be used to configure environment settings for a Lambda function.