AWS Certified Developer – Associate (DVA-C02) — Question 261

A developer is creating a simple proof-of-concept demo by using AWS CloudFormation and AWS Lambda functions. The demo will use a CloudFormation template to deploy an existing Lambda function. The Lambda function uses deployment packages and dependencies stored in Amazon S3. The developer defined an AWS::Lambda::Function resource in a CloudFormation template. The developer needs to add the S3 bucket to the CloudFormation template.

What should the developer do to meet these requirements with the LEAST development effort?

Answer options

Correct answer: D

Explanation

The correct answer is D because it directly references the S3 bucket and key properties required to link the Lambda function's code and dependencies stored in S3. Option A and B are incorrect as they require embedding the code directly in the template, which is not suited for existing code in S3. Option C is misleading since it suggests using the ZipFile property, which is not appropriate when referencing an S3 location.