'What exactly is happening when I upload zip file to the elasticbeanstalk?
According to the aws elasticbeanstalk doc,
"While Elastic Beanstalk deploys your file to your Amazon EC2 instances, you can view the deployment status on the environment's overview."
But I quite cannot understand what exactly is happening when I upload my source files to the elasticbeanstalk(eb).
As I know, if we upload zip file to the elasticbeanstalk(eb), it goes to the s3 first.
But as documentation says, "ec2 deploys those files" with the proper environment.
For example, if I uploaded .zip file which contains simple index.js (simple nodejs server) and package.json (dependencies listed file) to the elasticbeanstalk, it goes to the s3 storage service. And ec2 deploys it with the proper command like npm install, npm start, etc.
The question is that, what is exactly happening between s3 upload and ec2 deploy?
Does elasticbeanstalk makes ec2 instance to access s3 storage and get all the source files from there automatically? otherwise we have to manually connect those two aws resources together?
I've been searched for this all day, but couldn't find anything including official documentation.
Any advice, or any url reference might also really be helpful. Thank you.
Solution 1:[1]
I'm sure there are much better informed folks out there, as I am just starting out with AWS and EB in particular, but--since there are no answers to this now 8-month old question--I'll share what I learned so far:
EB CLI tells EC2 to fetch the app artifact and manifest
2022/03/28 23:26:45.063522 [INFO] Downloading EB Application...
2022/03/28 23:26:45.063548 [INFO] Download app version manifest
Then performs some internal magic to ensure the instance is ready to host the app
Then extracts the app artifact and--depending on the platform stack--downloads dependencies and starts the app.
2022/03/28 23:26:47.074138 [INFO] Executing instruction: StageApplication
2022/03/28 23:26:47.223041 [INFO] extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/
2022/03/28 23:26:52.001284 [INFO] Executing instruction: RunAppDeployPreBuildHooks
2022/03/28 23:26:52.001312 [INFO] Executing platform hooks in .platform/hooks/prebuild/
2022/03/28 23:26:52.049546 [INFO] installing node version 16.14.0
2022/03/28 23:26:52.049555 [INFO] Running command /bin/sh -c uname -m
2022/03/28 23:26:54.962177 [INFO] Executing instruction: Use NPM to install dependencies
2022/03/28 23:26:54.962214 [INFO] checking package.json file
2022/03/28 23:26:54.962224 [INFO] found package.json file, using npm to start application
Then more platform magic follows
....
2022/03/28 23:26:58.109415 [INFO] Executing instruction: RunAppDeployPostDeployHooks
2022/03/28 23:26:58.109428 [INFO] Executing platform hooks in .platform/hooks/postdeploy/
2022/03/28 23:26:58.109448 [INFO] Executing cleanup logic
2022/03/28 23:26:58.109570 [INFO] CommandService Response: {"status":"SUCCESS","api_version":"1.0","results":[{"status":"SUCCESS","msg":"Engine execution has succeeded.","returncode":0,"events":[{"msg":"Instance deployment completed successfully.","timestamp":1648510018,"severity":"INFO"}]}]}
And the app deployment is complete:
2022/03/28 23:26:58.109728 [INFO] Platform Engine finished execution on command: app-deploy
You can see the details of what takes place in eb-engine log.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Yevgeniy |
