3 ms·
Ask HN: 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 4y agoLambda 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...
- willsmith72 4y agoAwesome thanks for the reply. Would you do something like an nginx container if going with ECS? Or any recommendations?
- yuppie_scum 4y agoJust use ALBs.
- willsmith72 4y agoEven 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
- vivegi 4y agoAWS 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.