AWS Certified Developer - Associate

AWS Certified Developer - Associate

Get started today

Ultimate access to all questions.


You've set up a continuous delivery service using AWS CodePipeline, which automates the steps for deploying your application. The pipeline is configured to use your source code stored in a CodeCommit repository, builds it using AWS CodeBuild, and deploys it with AWS Elastic Beanstalk. Every time you commit changes, this setup triggers an automatic deployment. However, you are experiencing prolonged deployment times specifically because resolving dependencies on your 100 target EC2 instances is taking a significant amount of time.

What could you do to improve the performance of this deployment process with minimal modifications to your existing code?




Explanation:

Bundle the dependencies in the source code during the build stage of CodeBuild

AWS CodeBuild is a fully managed build service. There are no servers to provision and scale, or software to install, configure, and operate.

A typical application build process includes phases like preparing the environment, updating the configuration, downloading dependencies, running unit tests, and finally, packaging the built artifact.

Downloading dependencies is a critical phase in the build process. These dependent files can range in size from a few KBs to multiple MBs. Because most of the dependent files do not change frequently between builds, you can noticeably reduce your build time by caching dependencies.

This will allow the code bundle to be deployed to Elastic Beanstalk to have both the dependencies and the code, hence speeding up the deployment time to Elastic Beanstalk

Incorrect options:

Bundle the dependencies in the source code in CodeCommit - This is not the best practice and could make the CodeCommit repository huge.

Store the dependencies in S3, to be used while deploying to Beanstalk - This option acts as a distractor. S3 can be used as a storage location for your source code, logs, and other artifacts that are created when you use Elastic Beanstalk. Dependencies are used during the process of building code, not while deploying to Beanstalk.

Create a custom platform for Elastic Beanstalk - This is a more advanced feature that requires code changes, so does not fit the use-case.