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?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠