What should the developer do to meet these requirements with the LEAST development effort?
Add the function code in the CloudFormation template inline as the code property.
Add the function code in the CloudFormation template as the ZipFile property.
Find the S3 key for the Lambda function. Add the S3 key as the ZipFile property in the CloudFormation template.
Add the relevant key and bucket to the S3Bucket and S3Key properties in the CloudFormation template.
Explanations:
The code property allows for inline code but is impractical for larger deployment packages or when using external dependencies, which is not suitable for this scenario where code is stored in S3.
The ZipFile property is meant for inline code and has a size limitation. It cannot be used to reference code stored in S3, making it inappropriate for this case.
The ZipFile property cannot be used to specify an S3 bucket and key; it only accepts inline code. Therefore, referencing an S3 key here is incorrect.
This option correctly specifies the S3 bucket and key for the Lambda function’s code using the S3Bucket and S3Key properties, which is the standard way to link a Lambda function to its deployment package stored in S3.