Create an S3-sourced CodeBuild project, run a build, and verify artifacts using the AWS CLI.
https://docs.aws.amazon.com/codebuild/latest/userguide/getting-started-cli.html
- ID: codebuild/getting-started
- Phase: create
- Complexity: intermediate
- Core actions: codebuild:CreateProject, codebuild:StartBuild
- Creates an S3 bucket for source and artifacts
- Creates source files (buildspec.yml + index.html) and uploads as zip
- Creates an IAM service role for CodeBuild
- Creates a build project with S3 source
- Starts a build
- Waits for completion and checks artifacts
bash aws-codebuild-gs.sh- 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.
- Run: ~37 seconds (includes build execution)
CodeBuild free tier includes 100 build minutes per month on general1.small. No charges expected for this tutorial under the free tier.