AWS CodeBuild Flashcards
AWS CodeBuild Principles ?
AWS CodeBuild is a fully managed continuous integration (CI) service that compiles source code, runs tests, and produces software packages that are ready to deploy.
With CodeBuild, you don’t need to provision, manage, and scale your own build servers.
CodeBuild scales continuously and processes multiple builds concurrently, so your builds are not left waiting in a queue.
CodeBuild Pricing
You pay based on the time it takes to complete the builds.
CodeBuild Encryption
CodeBuild is integrated with KMS for encryption of build artifacts, IAM for build permissions, VPC for network security, and CloudTrail for logging API calls.
(buildspec.yml), what is it ?
Build instructions can be defined in the code (buildspec.yml).
How can CodeBuild Detect Failures
You can use CloudWatch alarms to detect failed builds and trigger SNS notifications.
Benefits of CodeBuild
- Fully managed by AWS.
- On-demand and scales seamlessly.
- Pre-configured environments for many programming languages.
CodeBuild Concepts - Build Project ?
Build project – defines how CodeBuild will run a build defines settings including:
- Location of the source code.
- The build environment to use.
- The build commands to run.
- Where to store the output of the build.
CodeBuild Concepts - Build environment
Build environment – the operating system, language runtime, and tools that CodeBuild uses for the build.
CodeBuild Concepts - Build Specification
Build Specification – a YAML file that describes the collection of commands and settings for CodeBuild to run a build.
Preconfigured Build Environments ?
AWS CodeBuild provides build environments for Java, Python, Node.js, Ruby, Go, Android, .NET Core for Linux, and Docker.
Customized Build Environments ? How would that work ?
You can bring your own build environments to use with AWS CodeBuild, such as for the Microsoft .NET Framework.
You can package the runtime and tools for your build into a Docker image and upload it to a public Docker Hub repository or Amazon EC2 Container Registry (Amazon ECR).
When you create a new build project, you can specify the location of your Docker image, and CodeBuild will pull the image and use it as the build project configuration.
Specifying Build Commands, why ?
You can define the specific commands that you want AWS CodeBuild to perform, such as installing build tool packages, running unit tests, and packaging your code.
The build specification is a YAML file that lets you choose the commands to run at each phase of the build and other settings.
You can override the default buildspec file name and location.
Should you have the buildspec.yml at the root of your project ?
Exam tip: You must have a buildspec.yml file at the root of your source code.
How can you defined variables ?
- Plaintext variables.
- Secure secrets using the SSM Parameter store.
What are the phases of the build process ?
- Install: install dependencies you may need for the build.
- Pre-build: final commands to execute before build.
- Build: actual build commands.
- Post build: finishing touches (e.g. zip file output).
Artifacts: these get uploaded to S3 (encrypted with KMS).
Cache: files to cache (usually dependencies) to S3 for future builds.