Rakesh Jain Profile picture
Jul 13 β€’ 34 tweets β€’ 4 min read Twitter logo Read on Twitter
Mastering AWS CLI! πŸ’»

Understanding 25 useful AWS CLI commands with examples.

A Thread πŸ‘‡
1/25 πŸ’» #AWSCLI Command: aws configure

Example: aws configure

Explanation: Configures your AWS CLI with access key, secret access key, default region, and output format.
2/25 πŸ“‚ #AWSCLI Command: aws s3 ls

Example: aws s3 ls

Explanation: Lists all S3 buckets in your AWS account.
3/25 πŸ“₯ #AWSCLI Command: aws s3 cp

Example: aws s3 cp file.txt s3://my-bucket/file.txt

Explanation: Copies a local file to an S3 bucket.
4/25 βš™οΈ #AWSCLI Command: aws ec2 run-instances

Example: aws ec2 run-instances --image-id ami-12345678 --instance-type t2.micro --key-name my-keypair

Explanation: Launches a new EC2 instance with the specified AMI, instance type, and key pair.
5/25 πŸ” #AWSCLI Command: aws ec2 describe-instances

Example: aws ec2 describe-instances

Explanation: Retrieves information about EC2 instances in your account.
6/25 ▢️ #AWSCLI Command: aws ec2 start-instances

Example: aws ec2 start-instances --instance-ids i-12345678

Explanation: Starts a stopped EC2 instance.
7/25 ⏹️ #AWSCLI Command: aws ec2 stop-instances

Example: aws ec2 stop-instances --instance-ids i-12345678

Explanation: Stops a running EC2 instance.
8/25 πŸ—‘οΈ #AWSCLI Command: aws ec2 terminate-instances

Example: aws ec2 terminate-instances --instance-ids i-12345678

Explanation: Terminates an EC2 instance.
9/25 πŸ“· #AWSCLI Command: aws ec2 create-image

Example: aws ec2 create-image --instance-id i-12345678 --name "My server backup"

Explanation: Creates an AMI from an EC2 instance.
10/25 πŸ›’οΈ #AWSCLI Command: aws rds describe-db-instances

Example: aws rds describe-db-instances

Explanation: Retrieves info about RDS database instances.
11/25 βž• #AWSCLI Command: aws rds create-db-instance

Example: aws rds create-db-instance --db-instance-identifier mydb --engine mysql --master-username admin --master-user-password mypassword --allocated-storage 20

Explanation: Creates a new RDS database instance.
12/25 βž– #AWSCLI Command: aws rds delete-db-instance

Example: aws rds delete-db-instance --db-instance-identifier mydb --skip-final-snapshot

Explanation: Deletes an RDS database instance without a final snapshot.
13/25 ☁️ #AWSCLI cmd: aws lambda create-function

Eg: aws lambda create-function --function-name my-function --runtime python3.8 --handler my_function.handler --role arn:aws:iam::123456789012:role/my-role --zip-file fileb://function.zip

Explanation: Creates a new Lambda function
14/25 πŸ”„ #AWSCLI Command: aws lambda invoke

Example: aws lambda invoke --function-name my-function --payload '{"key1":"value1", "key2":"value2"}' response.txt

Explanation: Invokes a Lambda function synchronously and saves the response.
15/25 πŸ”„ #AWSCLI Command: aws lambda update-function-code

Example: aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip

Explanation: Updates the code of an existing Lambda function.
16/25 πŸ—‚οΈ #AWSCLI Command: aws cloudformation create-stack

Example: aws cloudformation create-stack --stack-name my-stack --template-body file://template.yml

Explanation: Creates a CloudFormation stack using a template file.
17/25 πŸ“‹ #AWSCLI Command: aws cloudformation describe-stacks

Example: aws cloudformation describe-stacks

Explanation: Retrieves information about CloudFormation stacks in your account.
18/25 πŸ”„ #AWSCLI Command: aws cloudformation update-stack

Example: aws cloudformation update-stack --stack-name my-stack --template-body file://updated-template.yml

Explanation: Updates a CloudFormation stack with a new template.
19/25 πŸ—‘οΈ #AWSCLI Command: aws cloudformation delete-stack

Example: aws cloudformation delete-stack --stack-name my-stack

Explanation: Deletes a CloudFormation stack.
20/25 🌐 #AWSCLI Command: aws apigateway create-rest-api

Example: aws apigateway create-rest-api --name my-api

Explanation: Creates a new API Gateway REST API.
21/25 πŸ’Ύ #AWSCLI Command: aws s3 sync

Example: aws s3 sync local-directory s3://my-bucket/

Explanation: Syncs the contents of a local directory with an S3 bucket, uploading new or modified files and deleting removed files.
22/25 πŸ—‘οΈ #AWSCLI Command: aws s3 rm

Example: aws s3 rm s3://my-bucket/file.txt

Explanation: Deletes a file from an S3 bucket.
23/25 πŸ”’ #AWSCLI Command: aws iam create-user

Example: aws iam create-user --user-name myuser

Explanation: Creates a new IAM user.
24/25 πŸ”„ #AWSCLI Command: aws iam update-user

Example: aws iam update-user --user-name myuser --new-user-name newuser

Explanation: Renames an IAM user.
25/25 πŸ”’ #AWSCLI Command: aws iam create-access-key

Example: aws iam create-access-key --user-name myuser

Explanation: Creates an access key for an IAM user.
Time for Bonus 😍
1) πŸ”„ #AWSCLI Command: aws iam update-access-key

Example: aws iam update-access-key --access-key-id ABCDEFG --status Inactive

Explanation: Updates the status of an access key to either Active or Inactive.
2) πŸ”’ #AWSCLI Command: aws iam list-users

Example: aws iam list-users

Explanation: Lists all IAM users in your AWS account.
3) πŸ”‘ #AWSCLI Command: aws iam create-group

Example: aws iam create-group --group-name my-group

Explanation: Creates a new IAM group.
4) πŸ”’ #AWSCLI Command: aws iam attach-group-policy

Example: aws iam attach-group-policy --group-name my-group --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess

Explanation: Attaches an IAM policy to an IAM group.
5) πŸ”‘ #AWSCLI Command: aws iam create-role

Example: aws iam create-role --role-name my-role --assume-role-policy-document file://trust-policy.json

Explanation: Creates a new IAM role with an associated trust policy.
6) πŸ”„ #AWSCLI Command: aws iam update-assume-role-policy

Example: aws iam update-assume-role-policy --role-name my-role --policy-document file://updated-trust-policy.json

Explanation: Updates the trust policy associated with an IAM role.
Retweet this mega thread about AWS CLI if you like it. Thanks!

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Rakesh Jain

Rakesh Jain Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @devops_tech

Jul 14
Mastering Firewalld!

A Thread explaining 20 most useful commands with examples πŸ‘‡πŸ”₯ Image
What is Firewalld ?

πŸ”₯ Firewalld: A dynamic firewall management tool for Linux distros like Fedora, CentOS, and Red Hat Enterprise Linux. It replaces iptables and offers an easier way to manage firewalls. #Firewalld #Linux
πŸ”’ Firewalld introduces the concept of zones, which determine the trust level of network connections. Zones like public, internal, and DMZ allow fine-grained control over access. #NetworkSecurity #Zones
Read 27 tweets
Jul 12
Mastering Linux Process Management πŸ§πŸ“‹

A #Twitter Thread with 20 most useful commands with examples πŸ‘‡
What is Linux Process Management ?

Linux process management refers to the ability to control and monitor processes running on a Linux system.
πŸ“‹ 1/20: ps - List running processes.

Example: ps aux

- Show all processes running on the system.
Read 30 tweets
Jul 11
Mastering Docker CLI! 🐳

Most useful Docker CLI commands with examples πŸ‘‡

A Thread πŸ‘‡
1/20 🐳 #Docker CLI command: docker run

Example: docker run nginx

Explanation: Run an instance of the nginx image
2/20 🐳 #Docker CLI command: docker ps

Example: docker ps

Explanation: List all running containers
Read 33 tweets
Jul 10
Mastering HTTPS!

What is HTTPS and how does it work?

A detailed thread πŸ‘‡
1/10: 🧡 Let's talk about HTTPS, which stands for Hypertext Transfer Protocol Secure. It's the protocol that ensures secure communication over the internet. 🌐
2/10: πŸ”’ HTTPS is built on top of HTTP, the standard protocol for transmitting data on the web. It adds an extra layer of security using encryption, which protects the data exchanged between a user's browser and a website's server.
Read 28 tweets
Jul 9
Mastering Linux Series!

Kernel Panic - Causes and Resolutions

A detailed #Twitter Thread πŸ‘‡
1/7: 🧡What is Kernel Panic?🧐

Kernel Panic is a critical error dat occurs in an os kernel, d core part responsible for managing system resources. It happens when d kernel encounters an unrecoverable error & cannot safely continue operating. Let's dive into d causes & solutions!
2/7: πŸ’₯ Causes of Kernel Panic πŸ’₯

Hardware failures: Faulty RAM, overheating CPUs, or malfunctioning hardware components can trigger a kernel panic.
Read 25 tweets
Jul 8
Mastering Networking in Linux 🐧πŸ–₯️🌐

A #Twitter Thread with 20 useful examples πŸ‘‡
1/ Hey, #Linux enthusiasts! Let's dive into mastering networking in Linux. πŸ–₯️🌐

In this thread, I'll cover key concepts and commands with examples to help you become a networking pro. Let's get started! #Networking #LinuxNetworking
2/ First up, let's talk about IP addressing. Use 'ifconfig' or 'ip addr' to view network interfaces and their IP addresses.

For example: "ifconfig eth0" or "ip addr show eth0"

will display IP details for the eth0 interface. #Linux #IPaddress
Read 23 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(