Amazon EC2 is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.
This is a workspace where you can find the following AWS SDK for JavaScript version 3 (v3) Amazon EC2 examples:
- Allocate addresses
- Create instances
- Create a key pair
- Create a security group
- Delete a key pair
- Delete a security group
- Describe addresses
- Describe instances
- Describe regions and zones
- Describe security groups
- Monitor instances
- Reboot instances
- Release addresses
- Stop/start instances
Note: All code examples are written in ECMAscript 6 (ES6). For guidelines on converting to CommonJS, see JavaScript ES6/CommonJS syntax.
-
Clone the AWS Code Samples repo to your local environment. See the Github documentation for instructions.
-
Install the dependencies listed in the package.json.
npm install node -g
cd javascriptv3/example_code/ec2
npm install
-
In your text editor, update user variables specified in the
Inputs
section of the sample file. -
Run sample code:
cd src
node [example name].js // For example, node ec2_allocateaddress.js