What is our primary use case?
I have been working with AWS CodeBuild for about two years now. I am working with AWS CodeCommit. AWS CodeBuild integrates with AWS CodeDeploy and AWS CodeCommit in a sequential pipeline. When we trigger something with AWS CodeCommit, the consecutive steps are triggered afterward.
AWS CodeBuild operates between AWS CodeCommit and AWS CodeDeploy. After code is committed to AWS CodeCommit, if the build is automatic, it triggers the pipeline. The pipeline consists of AWS CodePipeline, AWS CodeBuild, and AWS CodeDeploy. AWS CodeBuild manages our code execution for various languages including Java, NodeJS, Android, Kotlin, or others. It helps us build the code and can also assist in deploying that code through AWS CodeDeploy.
AWS CodeBuild offers environment variables, also known as project secrets. These can store GitHub tokens for Git repositories or certificates for iOS/Android builds. The environment variables feature includes functionality to encrypt and decrypt secrets within AWS CodeBuild itself. The permission structure operates through IAM policies, ensuring least privilege access and preventing unauthorized usage.
What is most valuable?
AWS CodeBuild's support for a wide range of programming languages and build environments benefits development teams significantly in terms of productivity and ease of use. There are extensive libraries of code structures available, making it a universal pipeline. All programming languages I have worked with are supported in AWS CodeBuild, eliminating the need for alternative deployment services.
The service supports iOS builds, Kotlin, Java, NodeJS, and ReactJS. AWS has made it accessible to all languages, allowing developers to simply open the console and trigger builds. AWS manages all the background server operations for building or deploying code. For standard builds such as ReactJS or Java, a Linux or Ubuntu server suffices. AWS provides its own operating system for these purposes.
For builds requiring physical servers, such as Apple macOS server, AWS rents Mac minis specifically for iOS and SwiftUI builds. While this incurs higher charges, it demonstrates AWS's commitment to providing comprehensive solutions for all use cases.
What needs improvement?
The servers used for macOS and iOS builds are limited in availability, operating only in US East 1 and East 2, and US West 1 and West 2. This geographical limitation causes latency issues and extended build times for regions such as India, impacting production efficiency. However, other server types are available across all regions without such limitations.
Which solution did I use previously and why did I switch?
When starting my work, I considered alternative technologies to AWS CodeBuild. CircleCI was one option, offering 30,000 credits for error handling and troubleshooting with its own YAML structure similar to AWS. Additionally, my team leader identified GitHub Actions as another solution that supports macOS builds and triggers. Both CircleCI and GitHub Actions serve as viable alternatives to AWS CodeBuild.
How was the initial setup?
AWS resources are organized according to different environments including dev, stage, QA, prod, and pre-prod. For developers working in the dev environment, we configure the setup and provide appropriate permissions to the development team.
The system operates through automatic triggers following PR merges and code reviews. When code is pushed to the main branch from a developer's branch, it triggers AWS CodePipeline. AWS CodePipeline then builds the code using AWS CodeBuild based on specified parameters.
Deployment occurs through buildspec.yml files, which determine the destination path for deployment, whether to a server, S3, or Amplify. This streamlined structure ensures smooth operation in production environments.
What was our ROI?
The return on investments is favorable for normal builds, excluding macOS. These builds follow a pay-as-you-go structure, charging only for actual usage. The entire AWS CodePipeline system works effectively, though the reserved structure poses challenges for mid-size and startup companies who must bear costs regardless of usage. There appears to be a gap between AWS and Apple that needs resolution to make it as accessible as other languages or servers.
What's my experience with pricing, setup cost, and licensing?
The cost structure is affordable for most builds except macOS servers. Standard builds can utilize AWS EC2 servers for background operations. However, macOS or iOS builds require physical servers maintained by Amazon. Triggering these builds essentially reserves the server for 24 hours, resulting in higher costs compared to readily available servers. Reserving a physical macOS server such as a Mac mini incurs substantially higher costs than standard server options.
Which other solutions did I evaluate?
AWS CodeBuild integrates with CloudWatch. This integration can be established during the creation of AWS CodeBuild and AWS CodeDeploy. When building a pipeline, the buildspec.yml file must follow specific AWS structure changes. While it is fundamentally a YAML file, it requires AWS-specific modifications.
What other advice do I have?
For mobile application development with macOS builds, several options exist. Prior experience with AWS CodeBuild involved different builds and languages, including Java, React, and NodeJS web applications using Jenkins. For those less familiar with macOS structure in AWS CodeBuild, using a macOS server might be preferable. To optimize costs, servers can be turned off after use to avoid reservation charges.
The AWS CodePipeline components can function independently. With GitHub repositories, connections can be established to pull code, build it, and specify deployment locations through YAML code. Base64 encoding is required for secret values in environment variables, which can be cumbersome without Secrets Manager. Using multiple secret storage methods can complicate debugging processes. GitHub's transition to mandatory token authentication has also presented connection challenges.
On a scale of 1-10, this solution receives a rating of 9.
Which deployment model are you using for this solution?
Public Cloud
If public cloud, private cloud, or hybrid cloud, which cloud provider do you use?
Amazon Web Services (AWS)
Disclosure: My company does not have a business relationship with this vendor other than being a customer.