Introduction to AWS App Runner
AWS App Runner is a fully managed compute service that simplifies the process of deploying web applications and APIs at scale, without requiring prior infrastructure experience. Designed for developers, App Runner handles everything from building and deploying containerized applications to load balancing, scaling, and ensuring secure communication with other AWS services.
Key Features and Benefits
1. Easy to Use
- No Infrastructure Management: Developers can deploy applications with just a few clicks, without needing knowledge of containers, server configuration, networking, or deployment pipelines.
- Automatic Containerization: If your application isn’t containerized, App Runner can automatically create a container for you.
2. Automatic Scaling
- Scales with Traffic: App Runner automatically adjusts the number of container instances based on traffic, ensuring that your application can handle load variations efficiently.
- Minimized Cold Starts: Configure a minimum number of container instances to ensure low latency.
3. Time-Saving
- Fully Managed Resources: AWS handles the allocation, configuration, and management of resources, allowing developers to focus solely on their application.
4. Compliance and Security
- VPC Integration: App Runner services can communicate securely with other AWS services in a private Amazon VPC, without exposing resources to the public internet.
- TLS Management: App Runner provides Transport Layer Security (TLS) automatically, with certificates that are renewed automatically.
5. Cost Management
- Pay for What You Use: Costs are based on the compute and memory resources consumed by active container instances. Charges pause when the application is not running.
- Cost-Efficient Provisioning: App Runner ensures low latency by keeping memory provisioned, even when traffic is low.
6. Simplified Deployment
- Automatic Deployments: App Runner can automatically build and deploy your application whenever updates are made to your source code or container image.
- Build and Deployment Logs: Detailed logs and metrics are available through integration with Amazon CloudWatch, enabling easy monitoring and optimization.
7. Limitations
- Regional Availability: App Runner is available only in select AWS regions.
- Service Quotas: Each region has quotas, such as a limit on the number of services or VPC connectors you can create.
- Single Container per Service: App Runner associates one container per service, unlike ECS or EKS, where multiple containers can be composed.
Use Cases
1. Front-End and Back-End Web Applications
- Host websites, web services, and APIs on App Runner, leveraging its ease of use and scalability.
2. Microservices and APIs
- Run multiple microservices independently, with each one scaling according to its specific traffic needs.
3. Rapid Deployment
- Accelerate time-to-market by using AWS App Runner’s seamless deployment capabilities, which are built on AWS best practices.
Developer Workflow
- Add a Source
In this step, you connect to a container image or your source code and select deployment settings. When you create an App Runner service, you connect it to a source. The source can be a container image or a source code repository (shown below). For a source code repository, such as a GitHub repo, you’ll need to provide connection details.
Even if your application is not containerized, App Runner supports automatically building a container image. When you associate your existing source code repository and optionally provide App Runner with your runtime build and start commands, App Runner automatically containerizes your web application and provides a running web application. Automatic containerization is available for curated App Runner platforms that contain supported runtimes and frameworks.
In deployment settings, you can choose to trigger update deployments of your application manually or automatically. If you enable automatic deployment, App Runner will automatically build and deploy your application whenever you update your source code or container image.
2. Configure build and service settings
In this step, you configure your container’s vCPU and memory, and select auto scaling and health check options. If you chose to deploy from a source code repository rather than a container registry, you will also configure build settings. Although App Runner will default these settings for you, you’ll want to understand them and know your options for customizing your configuration.
You can choose to configure the settings in the console, or provide a YAML configuration file in your source code repository.
In service settings, you’ll give your service a name and set your container’s CPU and memory size. These settings affect your costs. You can also set any environment variables needed by your application here.
You can configure auto-scaling behavior. The default is just one instance of your container. App Runner can scale your service to more instances when it receives more than 80 concurrent requests. You can configure the maximum number of instances, which gives you cost control.
Health check settings allow you to identify a web path where App Runner can send health check requests. By default, if there are 5 consecutive health check failures, the instance is considered unhealthy and App Runner will replace it. You can configure the number of health checks that must fail before App Runner decides that the service is unhealthy, from 1 to 20.
Security settings allow you to choose an IAM role the instance will use. If your application needs to communicate with other AWS service, you authorize that in the IAM role. These settings also let you optionally provide a customer-managed key (CMK) for encrypting source code.
3. Review and Create
In this step, you review and verify all of your settings. Once you click Create and Deploy, App Runner creates your service and deploys your application.
4. Receive a Secure URL
Lastly, you receive a secure URL of your running production-ready service from AWS App Runner. HTTPS is configured automatically for you.
Finally, you may associate your application with a custom domain if you have one. You’ll be guided through proving you own the domain.
Pricing Model
1. Provisioned Container Instances
- Memory Charges: You’re billed for the memory provisioned in each container instance, ensuring readiness for incoming requests. For instance, a 2GB memory instance costs $0.007/GB-hour.
2. Active Container Instances
- Compute and Memory Costs: Charges apply when your application is processing requests, based on vCPU and memory usage.
3. Additional Costs
- Automatic Deployments: $1 per application per month for automatic deployments.
- Build Fee: $0.005 per build-minute when App Runner builds your application from source code.
Pricing Examples
- App Testing: Running an app for 2 hours daily with 2GB of memory can cost around $4.80/month.
- Lightweight API: A lightweight API that runs sporadically with 2GB of memory might cost around $25.50/month.
- High-Volume Production: A busy web application requiring 10 container instances during peak hours could cost around $102/month.
Conclusion
AWS App Runner is an excellent service for developers looking to quickly deploy and scale web applications and APIs without the overhead of managing infrastructure. Its features, such as automatic scaling, easy integration with AWS services, and simplified deployment processes, make it an ideal choice for a variety of web-based use cases, including microservices, APIs, and rapid application deployment.