Avatar of maytanthegeek
Recommends
on
Amazon S3Amazon S3

As you have only mentioned an Angular app so I'm assuming that you're hosting your backend APIs separately. You can do a production build of the Angular app and put it in S3 (without public access). Next, you can create a CloudFront distribution for this bucket and point a record in your Route53 hosted domain to this distribution. This way your website will be highly available and fast as caching will be available. Note: With this method, you should make sure when you push new build in the bucket, you do not delete the service-worker script or else service worker will stop caching.

I will not recommend using EC2 as it seems overkill for this task. You will have to manage an AMI with Nginx or Apache or some other static web server on your own. You will also have to attach an elastic IP with the instance or an ALB for connecting it to a Cloudfront distribution. Too much work.

You can go with Elastic Beanstalk. It will reduce the setup work but still big resources for an Angular SPA.

As a bonus, you can have multiple Cloudfront distribution+S3 bucket for multiple environments (production, staging, etc.) and use weighted routing in Route 53 record for AB test or blue/green deployments.

READ MORE
3 upvotes·16.8K views