Skip to content

Would it be possible to replace Application Load Balancer(ALB) with AWS api gateway for Atlantis on Fargate? #414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
xiaoronglv opened this issue Apr 30, 2025 · 1 comment

Comments

@xiaoronglv
Copy link

xiaoronglv commented Apr 30, 2025

Thanks for kindly providing the AWS fargate deployment approach to save developers cost. While this approach reduces compute costs compared to EC2 or EKS, it still requires an application load balancer (ALB), which adds a recurring monthly expense.

https://www.runatlantis.io/docs/deployment.html#aws-fargate

graph TD
    A[Github PR is created] --> B[Webhook event sent to application load balancer]
    B --> C[Trigger Atlantis run in AWS Fargate]
Loading

Proposal

I am wondering would it be possible to replace the load balancer with AWS API Gateway?

Since AWS Gateway provides 1 million free tier, making it an attractive alternative for low-traffic use cases.

graph TD
    A[Github PR is created] --> B[Webhook event sent to AWS API Gateway]
    B --> C[Trigger Atlantis run in AWS Fargate]
Loading

This approach could significantly reduce the cost of hosting Atlantis, which might encourage engineers from small team to adopt it without needing to persuade their employers. It may also attract more engineers to Atlantis over GitHub Actions.

AWS Organization Context

Many companies structure their AWS organizations with multiple accounts, typically including:

  • A corporate AWS account
  • A production AWS account
  • A staging AWS account
  • A development AWS account
  • Additional accounts as needed

Atlantis is often used as a shared resource for managing infrastructure. In most cases, teams deploy the Atlantis instance in the corporate AWS account. Provisioning a dedicated application load balancer for this may not be the most efficient use of resources.

Cost of Atlantis

  • Run Atlantis
    • A Kubernetes cluster, costing at least $72 per month
    • or an EC2 which takes 30-40 dollars
    • or fargate which takes $10-20.
  • A load balancer, costing around $20 per month

For small team, traffic to Atlantis tends to be low since infrastructure changes are infrequent. Replacing the load balancer with API Gateway could eliminate one of the key fixed costs in this setup.

Reference

  1. Q&A: Using Atlantis with serverless deployment platforms, how?
  2. terraform-aws-modules/terraform-aws-atlantis
@xiaoronglv xiaoronglv changed the title Would it be possible to use AWS API Gateway to replace Load Balancer for Atlantis on Fargate? Would it be possible to use AWS API Gateway to replace Application Load Balancer(ALB) for Atlantis on Fargate? Apr 30, 2025
@xiaoronglv xiaoronglv changed the title Would it be possible to use AWS API Gateway to replace Application Load Balancer(ALB) for Atlantis on Fargate? Would it be possible to replace Application Load Balancer(ALB) with AWS api gateway for Atlantis on Fargate? Apr 30, 2025
@bryantbiggs
Copy link
Member

its possible, but it would probably be a separate implementation (one that utilizes a load balancer, and one that utilizes an API Gateway)

I started exploring this a few years back https://github.com/clowdhaus/api-gateway-ecs-razzle-dazzle/tree/main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants