EC2 Image Builder Recipe for NodeJS app deployment

0

Hi AWS, is there a way where you spin a plain vanilla server and then you need to install Linux or Windows OS and then you need to clone the application code and store it in some location and further that download the npm package, initialize it, do the build and run the application. It will be exposed to a port as well like 4000. And further you need to run the application as service using pm2.

Is there a way where we can embed this workflow in the recipe and further attach to the EC2 instance with all the packages installed and I want to do this using a CI/CD.

profile picture
Arjun
已提问 10 个月前445 查看次数
1 回答
0

One way to do it is by using AWS CodePipeline that will deploy CloudFormation template with EC2 Image Builder Recipe.

https://aws.amazon.com/codepipeline/

https://aws.amazon.com/cloudformation/

NodeJS example: https://dev.to/aws-builders/deploying-nodejs-application-on-amazon-ec2-using-aws-codepipeline-20i1

profile picture
已回答 10 个月前
  • Do you have any example handy for this @myronix88 as I am doing this for the first time.

  • This would all tie into CodeDeploy which will deploy applications to an EC2 automaticlly https://docs.aws.amazon.com/codedeploy/latest/userguide/welcome.html

  • I think I need to rephrase my question:

    Suppose you have an instance which has 10 binaries installed. It is serving some application and your website only has 100 users. With time your application starts gaining popularity and the users are 500 now. In an ideal case we should spin up for more instances but that is not the right approach as we are not going to increase the number of instances. Having said that there is some autoscaling that should be happening and in front of it a load balancer is running which is responsible for managing the traffic. How to make sure when we update the server with more binaries then how the ASG is going to pick that updated image using CI/CD pipeline?

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则