简体   繁体   中英

Deploy Angular 8/WebApi to AWS

I need help on which service in AWS to deploy an Angular 8 that uses a separate WebApi for data. Should I deploy them separately or should I copy the dist files to the wwwroot folder of the WebApi and deploy that way? If I deploy them separately which services do I use? What is the pros and cons of deploying them separately or merging the angular with the webapi project? I keep reading about Elastic BeanStalk, S3, and Lambda with Api Management. I'm not sure where to start.

I would say that this is a strongly opinion based question, but I can give my 2 cents, and you decide whether to use them or not.

For the Angular 8 application - my recommendation is to go with S3 hosted static website - https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html . Biggest advantage - cutting costs (compared to and ECS service, lets say).

Now for the WebApi - there are 2 things here. If you already have it developed, and you just need to deploy/host it somewhere - I guess ECS service with ALB and Route53/DNS is your way to go (and all the other things you will need like VPC, SecurityGroups and etc) - https://aws.amazon.com/blogs/compute/hosting-asp-net-core-applications-in-amazon-ecs-using-aws-fargate/ .

Now, if you don't have it developed yet, and you are about to start, my suggestion is to go Serverless - with API Gateway and Lambdas on the endpoints.

Api Gateway info - https://aws.amazon.com/api-gateway/

AWS Lambda with Web Applications scenario - https://aws.amazon.com/lambda/#Web_applications

And a sample for your entire case: https://github.com/aws-samples/lambda-refarch-webapp

As I said - this is strongly opinion based question and other people may have different observations, but I would say that this is a good solution for your needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM