We will use the AWS CodeCommit repository named Pipeline-EC2 that you prepared earlier for this demo.
CodeBuild and click on CodeBuild in the search results.

AWS-FCAJ-PIPELINE.
This demo code is simplified to help you understand the essentials of the build and deploy process.
Pipeline-EC2mainEnsure your CodeBuild project is created in the same AWS Region as your AWS CodeCommit repository; otherwise, the repository will not appear in the drop-down list.

While Always use the latest image is convenient for lab environments, it is a best practice to use a specific image version in production to ensure build reproducibility.

CodeBuild requires an IAM service role to interact with other AWS services. This role automatically includes permissions for writing to CloudWatch Logs and S3 (if you configure S3 for artifacts).

The buildspec.yml file must be located in the root directory of your source repository. It contains the exact commands AWS CodeBuild will execute during the build phases (install, pre_build, build, post_build).

Storing artifacts in an S3 bucket is required if you plan to use AWS CodePipeline and CodeDeploy in the next steps. Make sure the S3 bucket is in the same AWS Region as your CodeBuild project.

codebuild/AWS-FCAJ-PIPELINE
If the build fails, click on the Phase details or Build logs tab in the CodeBuild console to read the execution logs and find the cause of the error.
