Ask HN: What would you use to deploy an SPA to production on AWS today?

2 points by willsmith72 ↗ HN
For organizational reasons, has to be AWS. How would you deploy an SPA in a production-ready way today?

Nice-to-haves would be: - scale-to-0 or serverless because of irregular traffic to save costs - easy to configure CI (add unit tests, e2e tests sometime, run lint and unit test on PRs) - multiple environments (dev, qa, prod) - multiple pages (react router but could change that) - still can be seo-crawled

So far looked at amplify, ecs with github actions, moving to one of the ssr frameworks

5 comments

[ 2.4 ms ] story [ 22.7 ms ] thread
Lambda or ECS with GitHub Actions for sure; I'd avoid Amplify for a variety of reasons (including their markup of the already usurious data egress fee).

I might very well consider Vercel or similar; it's become pretty clear that AWS doesn't really get the frontend developer experience...

Awesome thanks for the reply. Would you do something like an nginx container if going with ECS? Or any recommendations?
Just use ALBs.
Even with ALBs, I still have to decide what to put in my containers right? Before for playground projects I've just used `serve` but it's not really suited for a production app
AWS Lambda + API gateway + S3 + cloudfront

Since you have chosen AWS, you can use CDK for Infra-as-code.

I had an SPA that was just static HTML + CSS + js that used AWS Lambda + API gateway for the server side functions with the static site deployed on a public S3 bucket and distributed through cloudfront.

I had longrunning background tasks for which I used Fargate. You may use Fargate or ECS depending on how you want to optimize your budget.