How To Create An AWS CodeBuild Build Project Using AWS CLI

How To Create An AWS CodeBuild Build Project Using AWS CLI

How To Create An AWS CodeBuild Build Project Using AWS CLI

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have discussed different components and features of AWS CodeBuild.

https://cloudaffaire.com/what-are-the-components-of-aws-codebuild/

In this blog post, we will discuss how to create an AWS CodeBuild build project using AWS CLI.

What Is CodeBuild Build Project:

A build project includes information about how to run a build, including where to get the source code, which build environment to use, which build commands to run, and where to store the build output. A build environment represents a combination of operating system, programming language runtime, and tools that CodeBuild uses to run a build.

How To Create An AWS CodeBuild Build Project Using AWS CLI:

Requirements:

AWS CLI installed and configured. You can follow the below blog post to install and configure AWS CLI.

https://cloudaffaire.com/how-to-install-aws-cli/

https://cloudaffaire.com/how-to-configure-aws-cli/

Git installed and configured.

https://cloudaffaire.com/category/devops/git/

Step 1: Setup AWS CodeCommit repository to host your CodeBuild source code.

Note: CodeBuild supports S3 bucket, CodeCommit, GitHub, and Bitbucket as your build source code location. In this demo, we are using CodeCommit to show the integration of CodeCommit with CodeBuild.

Step 2: Create an IAM role for AWS CodeBuild.

Step 3: Create an S3 bucket to store your build outcome (artifacts).

Note: We can deploy this artifact using CodeDeploy and CodePipeline, which will be covered under CodeDeploy.

Step 4: Create a CodeBuild build project.

Step 5: Start your CodeBuild build project.

Note: Additional charges apply to build your source code. CodeBuild builds is charged on per minutes basis and you get 120 free every month for small compute which is used in this demo.

Step 6: Get your build artifacts and logs.

Step 7: Cleanup.

Hope you have enjoyed this blog post. To get more details on AWS CodeBuild, please refer below AWS documentation

https://docs.aws.amazon.com/codebuild/index.html

 

Leave a Reply

Close Menu