September 27, 2018

LAB 11 - AWS CI CD - Setup a Build Project in AWS CodeBuild for Lambda

This Lab has the step by step instructions to create & configure a Build using AWS  CodeBuild, which will compile the latest commit of the Lambda function, generate the artifact and uploaded to the named S3 bucket.

Ensure to complete LAB 9 through LAB 10 including pre-requisite as stated in AWS CI CD - 3rd Workflow - Serverless Application Deployment Lab blog.
Please note that for the purpose of this example, the Serverless Application is using demo-4-codedeploy as the bucket name. Make sure to edit that with your S3 bucket name before you proceed further.

Login to AWS Console as `codedeploy_user` & go to AWS CodeBuild from AWS Console, click Create Project and proceed with the configuration as follows

Build Source


Build Environment


Storying Build Artifacts


Enabling Build Logs




Save the Build & Run. Verify that the artifact is uploaded to S3 Bucket.

buildspecl.yml

Here is the closer look of buildspec.yml used in this example. In addition to this, you can environment variables as stated below

<add buildspec.yml>


Debugging CodeBuild

  • AWS CodeBuild is a managed service, which uses pre-defined container images for handling builds. Hence you will not have access to the container images running your build.
  • Local Build Support is enabled for AWS CodeBuild since May 2018, which you can use for debugging issues locally.
  • Enabling Logging to CloudWatch or S3 is key to monitor the build progress from AWS Management Console and for debugging in case of failures

No comments:

Post a Comment