Complexity<\/strong><\/p>\n\n\n\nPersonally, I expected the integration of some commonly used scripts for app development into the CodeBuild image. This would have made certain necessary operations, like configuring and installing provisioning profiles (required to release an app on the App Store), much easier. Instead, some must be created manually.<\/p>\n\n\n\n
Recently, AWS has provided another tool: direct integration between CodeBuild and GitLab Runners. This could be useful when a GitLab environment exists for Software Version Control, allowing seamless integration between the two providers. This can reduce costs and make it easier to manage the instance via GitLab.<\/p>\n\n\n\n
Our custom solution<\/h2>\n\n\n\n A few months ago, we needed something to autonomously manage the creation of an iOS application since no alternatives were available. So, we started exploring where and how we could integrate automation.<\/p>\n\n\n\n
This led us to the solution that is currently in place.<\/p>\n\n\n\n
One of the client’s prerequisites was to keep everything within the same AWS environment. This meant we couldn\u2019t use GitHub Actions, which would have simplified our integration with the iOS environment, as they are directly integrated with a machine equipped with the iOS environment. Additionally, GitHub Actions have the advantage of being more mature as a technology, with more community support, which results in more examples and pre-built integrations.<\/p>\n\n\n\n
That said, we had to start from the assumption that the only way to release an iOS application on AWS using managed services and without relying on third-party tools (like a Docker MacOS image) was to use an EC2 Mac instance.<\/p>\n\n\n\n
We then had to figure out how to integrate this machine into a pipeline, as AWS doesn’t provide ready-made integrations. The path we considered best was to use a StepFunction to orchestrate the various operations needed to build and release the application.<\/p>\n\n\n\n
The idea was to check whether another environment was already using the machine and, if so, wait for the build to finish to avoid doubling the release time for both.<\/p>\n\n\n\n
At that point, the next challenge was communicating directly with the machine through this step function. After assessing the requirements against our options, we concluded that we could query the machine via SSM using the “SendCommand” API.<\/p>\n\n\n\n
The commands were necessary to trigger the various.SH scripts required for the machine setup and the application release process.<\/p>\n\n\n\n
Let’s dive into Pros and Cons:<\/p>\n\n\n\n
PROs<\/h3>\n\n\n\n Custom<\/strong><\/p>\n\n\n\nLike all custom-built systems, a solution built from scratch allows us to tailor it to our needs and include what we consider truly useful. In this case, we were able to add additional tools like IXGuard and always maintain the latest version of Xcode, which not only simplifies the developers’ work but also aligns with the client\u2019s requirements.<\/p>\n\n\n\n
Economic advantages<\/strong><\/p>\n\n\n\nThe cost is lower when comparing a single instance with a single CodeBuild, thanks to the use of many serverless services like Lambda and Step Functions. Additionally, the cost of EC2 can be reduced through Savings Plans.<\/p>\n\n\n\n
CONs<\/h3>\n\n\n\n Management<\/strong><\/p>\n\n\n\nCertainly, managing the integration logic with the EC2 instance is much more complex than using an out-of-the-box solution like AWS CodeBuild, provided by AWS. However, having our own machine and custom integration allows for much greater control and flexibility, as mentioned above.<\/p>\n\n\n\n
Not high available<\/strong><\/p>\n\n\n\nThe EC2 instance, however, is a single physical instance located in a single Availability Zone (AZ), which goes against high availability principles. If an AZ goes down, our machine will no longer be usable, leading to downtime. <\/p>\n\n\n\n
Updates management<\/strong><\/p>\n\n\n\nAnother issue arises when there’s a need to update or upgrade the operating system or an application; this can cause service interruptions. After a “major version” update, some functionality might change, leading to unexpected errors that would take time to resolve, as they cannot be predicted before the upgrade.<\/p>\n\n\n\n
To address the issue of updates, we found it very useful to have a second instance in a shutdown state, with a pre-configured AMI aligned with the production machine. This instance can be used when necessary to test updates, allowing us to make informed decisions on how to proceed, given that updates can always be scheduled. It’s also possible to keep the instance running, but this comes with non-negligible costs, so it depends on what you consider more important.<\/p>\n\n\n\n
Conclusion<\/h2>\n\n\n\n Is one solution better than the other?<\/p>\n\n\n\n
Maybe\u2026 but we can’t say it yet. The answer, as always, is \u201cit depends\u201d: if you\u2019re looking for a fast and well-integrated solution, relying on AWS CodeBuild might be the right choice.<\/p>\n\n\n\n
Instead, if you need more control and flexibility, an EC2 instance with Step Functions and Lambda could be a better fit.<\/p>\n\n\n\n
Both solutions, ours and AWS\u2019s, still require creating and managing the necessary scripts to install prerequisites, build the .IPA file, and release it; this is by far the most complex, labor-intensive, and difficult part to manage.<\/p>\n\n\n\n
If you\u2019d like some advice or examples, let us know. It would be a perfect \u201cPart II\u201d of this article!<\/p>\n\n\n\n
That\u2019s all for now.<\/p>\n\n\n\n
See you in the next article on Proud2beCloud!<\/p>\n\n\n\n
\n\n\n\nAbout Proud2beCloud<\/h4>\n\n\n\n Proud2beCloud<\/strong> is a blog by beSharp<\/a>, an Italian APN Premier Consulting Partner expert in designing, implementing, and managing complex Cloud infrastructures and advanced services on AWS. Before being writers, we are Cloud Experts working daily with AWS services since 2007. We are hungry readers, innovative builders, and gem-seekers. On Proud2beCloud, we regularly share our best AWS pro tips, configuration insights, in-depth news, tips&tricks, how-tos, and many other resources. Take part in the discussion!<\/p>\n","protected":false},"excerpt":{"rendered":"Introduction Have you ever had to create an iOS application on AWS? If the answer is no, then this article […]<\/p>\n","protected":false},"author":30,"featured_media":7337,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[478],"tags":[292,710,365],"class_list":["post-7324","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud-native-development-en","tag-aws-codebuild-en","tag-aws-codebuild-macos-builds","tag-ci-cd-en"],"yoast_head":"\n
Building iOS Apps with AWS CodeBuild: Pros, Cons, and Our Alternative Solution - Proud2beCloud Blog<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n \n \n\t \n\t \n\t \n