HACKER Q&A
📣 willsmith72

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


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


  👤 QuinnyPig Accepted Answer ✓
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...


👤 vivegi
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.