Case study
Modernizing AWS Lambda and Cutting Cloud Costs at Primex
Problem
Legacy AWS Lambda functions were running on unsupported Python 2, and the Flutter app deployment pipeline relied on costly cloud-based Mac instances.
Solution
Migrated Lambda functions to Python 3 using Docker, Ansible, and AWS CloudFormation, and replaced cloud Mac instances with a remote Bamboo build agent on a physical Mac Mini.
Result
Ensured long-term Lambda support, reduced infrastructure costs, and maintained smooth Flutter app deployments without sacrificing build speed or reliability.
In 2021, Primex faced two pressing operational challenges within its DevOps environment. First, a suite of AWS Lambda functions—critical to multiple services—was still running on Python 2, which was long past end-of-life. This created a security risk and posed a future operational threat, as AWS planned to deprecate Python 2 runtimes entirely.
Second, the company’s Flutter mobile application CI/CD pipeline was incurring unnecessary expenses. Flutter builds for iOS required a macOS environment, and the existing setup relied on expensive cloud-hosted Mac instances that were underutilized yet billed at premium rates.
Strategic Actions
I approached these challenges with a two-part modernization plan:
-
AWS Lambda Migration to Python 3
-
Built Docker containers to replicate the Lambda runtime locally for safe testing before production deployment.
-
Used Ansible automation to standardize upgrades and configuration changes across all functions.
-
Managed deployment and updates via AWS CloudFormation templates, ensuring version-controlled, reproducible infrastructure.
-
-
Cost-Effective CI/CD for Flutter
-
Deployed a remote Bamboo build agent on an in-house Mac Mini, fully integrated with the CI/CD pipeline.
-
Configured the agent to handle all TestFlight and App Store deployments, removing the dependency on cloud-based macOS build services.
-
Established monitoring and alerting to ensure the physical build agent maintained uptime and reliability equivalent to cloud services.
-
Impact
The combined initiatives delivered clear technical and financial benefits:
-
Future-proofed AWS Lambda functions, eliminating the security and support risks of Python 2.
-
Reduced infrastructure costs by removing the reliance on expensive cloud-hosted Mac build instances.
-
Maintained seamless app deployment pipelines for both iOS and Android without compromising delivery speed.
-
Increased operational control and reduced third-party dependencies, enabling quicker response to build and deployment issues.
By tackling both modernization and cost efficiency at once, the solution not only solved urgent technical problems but also delivered lasting operational savings for Primex.
