AWS CodeBuild Challenge

Lab Steps

lock
AWS CodeBuild Challenge
Need help? Contact our support team

Here you can find the instructions for this specific Lab Step.

If you are ready for a real environment experience please start the Lab. Keep in mind that you'll need to start from the first step.

 

Your Mission

Your company has a number of legacy applications that are under active development and are written in several different languages. Your manager is considering migrating the company's continuous integration (CI) platform to AWS.

Some of the applications your current CI platform builds are written in compiled languages such as C and C++. Your boss has asked you to demonstrate using AWS CodeBuild to build a simple C program. The current CI system easily allows for applications to be reconfigured at build time, and it's important that a replacement system has the same ability.

A hello world C program that builds from a Makefile and produces an executable file (called hello-world), has been provided for you to demonstrate with.

In this hands-on lab challenge, you will be tasked with configuring an example AWS CodeBuild project resulting in it building a simple C program.

The following instructions prepare you to work on this challenge.

Instructions

  1. To start the lab challenge, open the AWS Management Console by clicking the Open Environment button:

    alt

  2. Enter the following credentials created just for this lab, and click Sign In:

    • Account ID or alias: Keep the pre-populated value
    • IAM user name:
    • Password:
  3. To start the challenge, click Go to Validation Steps

Hints:

  • All tasks should be completed using the AWS Management Console
Validation checks
6Checks
Edit the Project's Source

Edit the CodeBuild project's Source and specify the S3 object key to be the following:

code/hello-world.zip

Note: You do not need to allow AWS CodeBuild to modify the Service role to make this change.

AWS CodeBuildAmazon Simple Storage Service (S3)
Update the Project's Buildspec

Edit the CodeBuild project's Buildspec and make the following changes:

  • Add make to the list of build commands
  • Add hello-world to the list of artifacts

Note: For this check to pass, only one build command and one artifact must be specified.

AWS CodeBuild
Enable CloudWatch Logs for the Project

Enable CloudWatch Logs for the CodeBuild project.

Note: The log group name and log stream name can be anything.

Note: You do not need to allow AWS CodeBuild to modify the Service role to make this change.

AWS CodeBuild
Configure Artifact Bucket

Configure the CodeBuild project to store artifacts.

The configuration must satisfy the following:

  • Use Amazon S3 to store artifacts
  • Use the S3 bucket beginning with cloudacademylabs-artifact
  • Does not package the artifact into a Zip file

Note: You do not need to allow AWS CodeBuild to modify the Service role to make this change.

AWS CodeBuildAmazon Simple Storage Service (S3)
Configure an Environment Variable

Edit the CodeBuild project's environment and add an environment variable that satisfies the following:

  • Variable name is NAME
  • Variable value is test
  • Variable type is Plaintext

Note: You do not need to allow AWS CodeBuild to modify the Service role to make this change.

AWS CodeBuild
Start a Build for the Project

Start a build of the CodeBuild project

Note: For this check to pass, the last build that ran must be successful.

AWS CodeBuild