Correct Answer – A
For Lambda functions, Environment variables can be enabled to dynamically pass settings to function code and libraries without making changes to your code. Environment variables are key-value pairs that are created as a part of function configuration. Instead of hard coding the S3 bucket name in the Lambda function, it can pass as an environmental variable in the above requirement.
Option B is incorrect as Hard coding the S3 Bucket name in a Lambda function is not a best practice.
Option C is incorrect as Function Variables enable one or more Lambda functions to be published while environmental variables allow to pass settings to function codes dynamically. In the above case, the S3 bucket name needs to be passed to function codes.
Option D is incorrect as this is not a correct way of passing the S3 bucket name to a Lambda function.
For more information on AWS Lambda Environment Variables, refer to the following URL-
https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html