“The Cloud” is at the core of most internet applications, from distributed data, to servers, to games and web/data hosting services How does it work? How can we leverage it?
Use “Elastic Beanstalk” to Deploy a NodeJS server to an EC2 instance at AWS
This requires 2 parts:
We highly recommend that you shut off all services at AWS following the completion of this module
Elastic Beanstalk (EB) will automatically wire up essential AWS services to create and deploy a running application.
For Node.js applications, this is generally just going to be an EC2 server instance along with an S3 bucket that stores our files
There are 2 ways to create a new application with EB, detailed below. Either way, all of your environments and applications will be available in the AWS Developer Console (GUI) for you to manage
node_modules
or package-lock.json
This will create your application and environment in one step, giving you a full GUI from where you can manage the app
First, ensure that you’ve installed the AWS CLI and the aws eb command line utilities.
eb init
- Initializes your folder as an Elastic Beanstalk application
us-west-2
)[Create new Application]
eb create my-environment-name
- Create an “environment” for your app to reside ineb deploy
to deploy your new application to your new environment
You can then use some other eb
commands to manage your apps
eb open
to open your app in the browsereb list
to get a list of appseb ssh
to ssh (login) to one of your appseb health
to get a health check on your environmentsYou can also use GitHub Actions to auto-deploy your source code to your EB Environment whenever you check in your code.
Browse the GitHub Marketplace for actions you can import into your repo. There are many