However, when using an AWS serverless infrastructure powered by Vapor, you have three different options to consider when determining how to route traffic to your application: API Gateway v1, API Gateway v2, and Load Balancers.

By default, Vapor routes HTTP traffic to your serverless applications using API Gateway v1.

To ensure you are using API Gateway v1 in your Vapor environment, you may simply omit the gateway-version and balancer options, or specify gateway-version: 1 explicitly in your application's vapor.yml file: API Gateway v2 is a cheaper and faster alternative to API Gateway v1, providing up to 60% less connection overhead.

As a workaround to these limitations, we currently suggest using Cloudflare as an external DNS provider for your Vapor application's using API Gateway v2, as you may use Cloudflare's Firewall and HTTP to HTTPS redirection solutions.

If you would like to use API Gateway v2, you may specify the gateway-version: 2 configuration option for a given environment in your application's vapor.yml file: Just like API gateway v2, an application load balancer (ALB) is a regional option.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners