Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.62 KB

File metadata and controls

53 lines (35 loc) · 1.62 KB

CodeBuild: Create a project and run a build

Create an S3-sourced CodeBuild project, run a build, and verify artifacts using the AWS CLI.

Source

https://docs.aws.amazon.com/codebuild/latest/userguide/getting-started-cli.html

Use case

  • ID: codebuild/getting-started
  • Phase: create
  • Complexity: intermediate
  • Core actions: codebuild:CreateProject, codebuild:StartBuild

What it does

  1. Creates an S3 bucket for source and artifacts
  2. Creates source files (buildspec.yml + index.html) and uploads as zip
  3. Creates an IAM service role for CodeBuild
  4. Creates a build project with S3 source
  5. Starts a build
  6. Waits for completion and checks artifacts

Running

bash aws-codebuild-gs.sh

Resources created

  • S3 bucket (source and artifacts)
  • CodeBuild project
  • IAM role (with S3 and CloudWatch Logs policies)
  • CloudWatch log group (created automatically by CodeBuild)

No persistent resources remain after cleanup. The script prompts you to delete all resources when it finishes.

Estimated time

  • Run: ~37 seconds (includes build execution)

Cost

CodeBuild free tier includes 100 build minutes per month on general1.small. No charges expected for this tutorial under the free tier.

Related docs