AWS CLI Commands

The following are some of the AWS CLI Commands:

1. Configure AWS CLI

  • The following command is used for configuring AWS CLI with credentials such as access key, secret key, and output format.
aws configure

2. List Amazon S3 Buckets

The following is used for listing Amazon S3 Buckets that are available in your AWS Account:

aws s3 ls

3. Copy Files to Amazon S3

  • The following command is used for copying the file on your local system to an Amazon S3 bucket.
aws s3 cp localfile.txt s3://bucketname/

4. Creating an Amazon S3 Bucket

The following command is used to create an Amazon S3 Bucket:

aws s3 mb s3://mybucket

5. Delete an Amazon S3 Bucket

The following command is used to delete an Amazon S3 Bucket:

aws s3 rb s3://mybucket --force

6. List Amazon EC2 Instances

  • The following command is used for listing the Amazon EC2 instances by describing them:
aws ec2 describe-instances

7. Start an Amazon EC2 Instance

  • The following command is used to start an Amazon EC2 Instance by specifying its instance ID:
aws ec2 start-instances --instance-ids i-1234567890abcdef0

8. Stop an Amazon EC2 Instance

  • The following command is used to stop an Amazon EC2 Instance by specifying the respective instance ID:
aws ec2 stop-instances --instance-ids i-1234567890abcdef0

9. List Lambda Functions

  • The following command is used to list the lambda functions:
aws lambda list-functions

10. Invoke a Lambda Function

The following command is used to invoke a AWS lambda function and it outputs the response to a file.

aws lambda invoke --function-name myfunction out.txt

11. Create A DynamoDB Table

The following command is used to create a DynamoDB table with specifying the attributes and provisioning the throughput.

aws dynamodb create-table --table-name mytable --attribute-definitions AttributeName=Id,AttributeType=S --key-schema AttributeName=Id,KeyType=HASH --provisioned-throughput 
ReadCapacityUnits=1,WriteCapacityUnits=1

12. List CloudFormation Stacks

  • The following command is used to list the CloudFormation stacks:
aws cloudformation list-stacks

13. Deploy CloudFormation Stack

  • The following command is used for deploying a CloudFormation stack with the template.yaml file that is defined with configurations.
aws cloudformation deploy --template-file template.yaml --stack-name my-stack --capabilities CAPABILITY_IAM

14. List All RDS Instances

  • The following command is used for all the Amazon RDS instances:
aws rds describe-db-instances

What Is AWS CLI (Command Line Interface) ? Complete Guide

AWS CLI is a command line tool that is used for managing the AWS Services from the command line. On downloading the AWS CLI software and configuring it with your AWS credentials you can control the AWS services from the command line and can automate the work through scripts. Whether you are launching EC2 instances, attaching the EBS Volumes, or managing the S3 buckets you can easily simplify these tasks and help in performing the tasks effectively.

Table of Content

  • What is AWS CLI?
  • How Does AWS CLI Work?
  • How to Install AWS CLI? A Step-By-Step Guide
  • What are the differences between AWS Console and AWS CLI?
  • Difference between AWS shell and AWS CLI
  • Difference Between AWS CLI and AWS SDK
  • AWS Command Line Interface (CLI) Usage
  • How to use AWS EC2, EBS, and S3 Services in AWS CLI? A Step-By-Step Guide
  • AWS CLI Commands
  • Features of AWS CLI
  • Benefits of AWS CLI
  • AWS CLI – FAQs

Similar Reads

What is AWS CLI?

AWS Command Line (CLI) is a tool designed for managing AWS Services directly from the command line. It provides a lot of options and flexibility compared to the Web Console. It facilitates simplifying the process of interactions with various AWS services such as EC2, Amazon S3, and Amazon EBS providing a consistent command structure. It supports scripting and integration into various development and operational environments making it a versatile tool for AWS Users....

How Does AWS CLI Work?

The AWS Command Line Interface (CLI) is a powerful tool that allows users to interact with AWS services directly from their terminal or command prompt. By providing a unified set of commands, the AWS CLI facilitates efficient management of AWS resources and automation of tasks....

How to Install AWS CLI? A Step-By-Step Guide

The following are the steps for installing AWS CLI:...

What are the differences between AWS Console and AWS CLI?

The following are the differences between AWS Console and AWS CLI:...

Difference between AWS shell and AWS CLI

The following are the differences between AWS Shell and AWS CLI:...

Difference Between AWS CLI and AWS SDK

The following are the differences between AWS Console, AWS CLI, and AWS SDK:...

AWS Command Line Interface (CLI) Usage

AWS CLI is a software tool that provides control of multiple AWS services directly from the command line. It facilitates simplifying resource management and allows the user to automate the tasks and integrate AWS Services into your workflows efficiently. The following are some of the key points regarding its usage:...

How to use AWS EC2, EBS, and S3 Services in AWS CLI? A Step-By-Step Guide

Step 1: Download the AWS Command Line Interface (CLI) software from AWS Console. With the AWS CLI, you can easily manage your AWS services from the command line, making it a powerful and convenient tool for managing your cloud infrastructure....

AWS CLI Commands

The following are some of the AWS CLI Commands:...

Features of AWS CLI

The following are the features of AWS CLI:...

Benefits of AWS CLI

The following are the benefits of AWS CLI:...

AWS CLI – FAQs

What is Amazon Connect CLI?...