

# Using Amazon EC2 in the Amazon CLI
<a name="cli-services-ec2"></a>


| An introduction to Amazon Elastic Compute Cloud | 
| --- | 
|  [![AWS Videos](http://img.youtube.com/vi/TsRBftzZsQo/0.jpg)](http://www.youtube.com/watch?v=TsRBftzZsQo)  | 

Amazon Elastic Compute Cloud (Amazon EC2) provides highly scalable and flexible virtual computing environments. Amazon EC2 allows you to provision and manage virtual servers, known as Amazon EC2 instances, to meet a wide range of computing needs.

Amazon EC2 instances are virtual machines that can be customized with various configurations of CPU, memory, storage, and networking capabilities. You can choose from a diverse selection of instance types, ranging from lightweight, cost-effective options to powerful, high-performance instances, depending on your application requirements. This flexibility enables you to match your computing needs to optimize performance and cost-efficiency. 

Additionally, Amazon EC2 offers a suite of features that empowers you to manage your compute resources effectively. These include the ability to quickly launch new instances, create custom machine images (AMIs) for rapid deployment, and scaling computing capacity up or down as needed. 

You can access the features of Amazon EC2 using the Amazon Command Line Interface (Amazon CLI). To list the Amazon CLI commands for Amazon EC2, use the following command.

```
aws ec2 help
```

Before you run any commands, set your default credentials. For more information, see [Configuring settings for the Amazon CLI](cli-chap-configure.md).

This topic shows short-form examples of Amazon CLI commands that perform common tasks for Amazon EC2.

For long-form examples of Amazon CLI commands, see [Amazon CLI code examples repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/aws-cli) on *GitHub*.

**Topics**
+ [Creating, displaying, and deleting Amazon EC2 key pairs in the Amazon CLI](cli-services-ec2-keypairs.md)
+ [Creating, configuring, and deleting Amazon EC2 security groups in the Amazon CLI](cli-services-ec2-sg.md)
+ [Launching, listing, and deleting Amazon EC2 instances in the Amazon CLI](cli-services-ec2-instances.md)
+ [Change an Amazon EC2 instance type with a bash script in the Amazon CLI](cli-services-ec2-instance-type-script.md)