AWS Certified Developer Associate DVA-C01 – Question018

Given the source code for an AWS Lambda function in the local store.py containing a handler function called get_storeand the following AWS CloudFormation template:

What should be done to prepare the template so that it can be deployed using the AWS CLI command aws cloudformation deploy?

A.
Use aws cloudformation compileto base64 encode and embed the source file into a modified CloudFormation template.
B. Use aws cloudformation packageto upload the source code to an Amazon S3 bucket and produce a modified CloudFormation template.
C. Use aws lambda zipto package the source file together with the CloudFormation template and deploy the resulting zip archive.
D. Use aws serverless create-packageto embed the source file directly into the existing CloudFormation template.

Correct Answer: D