Wednesday, 5 April 2017

Node module deleted from npm during autoscaling trigger. How to handle this?

I am using AWS autoscaling via Elasticbeanstalk.

I have uploaded my node app on S3 & have mentioned all required modules to be installed during setup in package.json

When an autoscale trigger initiates new instance, it will download app from S3 & start installing modules mentioned in package.json

What if during this time some modules were already deleted from npm & my package.json were referring to them. In that case my instance won't start correctly & my autoscale purpose will be nullified.

How can I ensure that during each autoscale node modules are already available to the app?

I thought of making custom AMI in which all my modules are globally installed. So during autoscale my app can directly reference them. But during update if I had used additional modules then how will existing instances install them during deploying app on them.

Please suggest better way to handle this scenario



via Lajpat

No comments:

Post a Comment