AWS Certified Developer – Associate — Question 358
A company is building a serverless application that uses AWS Lambda. The application includes Lambda functions that are exposed by Amazon API Gateway. The functions will use several large third-party libraries, and the build artifacts will exceed 50 MB in size.
Which combination of steps should a developer take to prepare and perform the deployment? (Choose two.)
Answer options
- A. Issue the aws lambda update-function-code CLI command with the --zip-file fileb://my-function.zip parameter.
- B. Upload the build artifact to Amazon S3.
- C. Issue the aws cloudformation package CLI command.
- D. Issue the aws lambda update-function-code CLI command with the --s3-bucket and --s3-key parameters.
- E. Issue the aws lambda update-function-code CLI command with a parameter that points to the source code in AWS CodeCommit.
Correct answer: B, D
Explanation
AWS Lambda imposes a limit of 50 MB for direct deployment package uploads via the CLI using the --zip-file parameter. To deploy larger packages up to 250 MB (unzipped), developers must first upload the artifact to Amazon S3 and then deploy it by referencing the S3 bucket and key using the aws lambda update-function-code CLI command. Using AWS CodeCommit directly for function updates is not supported by this CLI command, and aws cloudformation package alone does not perform the direct lambda update.