AWS CLI: Command Line Interface - A Complete List of Commands
The AWS Command Line Interface (CLI) is a powerful tool that allows users to manage and automate tasks in AWS directly from the command line. It enables you to interact with AWS services, provision resources, and automate repetitive tasks all from a terminal, making it a key tool for developers, system administrators, and DevOps engineers.
In this article, we’ll provide a comprehensive list of AWS CLI commands categorized by AWS service. These commands will help you manage resources like EC2 instances, S3 buckets, IAM roles, Lambda functions, CloudFormation stacks, and more.
1. General AWS CLI Commands
Before diving into specific services, here are some general commands that can help you configure and manage your AWS CLI setup.
- Configure AWS CLI (Set up AWS credentials and configuration):
aws configure
- List Available Services (Shows all available AWS CLI services):
aws help
- Get Help for a Specific Command (Shows detailed help for a particular service command):
aws <service> help
- Check the AWS CLI Version:
aws --version
2. EC2 (Elastic Compute Cloud) Commands
AWS EC2 allows you to create and manage virtual servers in the cloud. Below are some commonly used AWS CLI commands for managing EC2 instances.
- Describe EC2 Instances:
aws ec2 describe-instances
- Start EC2 Instance:
aws ec2 start-instances --instance-ids <instance-id>
- Stop EC2 Instance:
aws ec2 stop-instances --instance-ids <instance-id>
- Reboot EC2 Instance:
aws ec2 reboot-instances --instance-ids <instance-id>
- Terminate EC2 Instance:
aws ec2 terminate-instances --instance-ids <instance-id>
- Create EC2 Key Pair:
aws ec2 create-key-pair --key-name <key-name>
- Create EC2 Security Group:
aws ec2 create-security-group --group-name <group-name> --description "Security group for EC2"
- Describe EC2 Security Groups:
aws ec2 describe-security-groups
3. S3 (Simple Storage Service) Commands
Amazon S3 is used for scalable object storage. Here are the AWS CLI commands to interact with S3 buckets and objects.
- List S3 Buckets:
aws s3 ls
- Create an S3 Bucket:
aws s3 mb s3://<bucket-name>
- Copy File to S3:
aws s3 cp <file-path> s3://<bucket-name>/
- Sync S3 Buckets:
aws s3 sync <local-directory> s3://<bucket-name>/
- List Objects in S3 Bucket:
aws s3 ls s3://<bucket-name>/
- Remove Object from S3 Bucket:
aws s3 rm s3://<bucket-name>/<file-path>
- Delete an S3 Bucket:
aws s3 rb s3://<bucket-name> --force
4. IAM (Identity and Access Management) Commands
IAM is used to manage access to AWS services. Here are some useful IAM commands.
- Create IAM User:
aws iam create-user --user-name <username>
- List IAM Users:
aws iam list-users
- Attach IAM Policy to User:
aws iam attach-user-policy --user-name <username> --policy-arn arn:aws:iam::aws:policy/<policy-name>
- Create IAM Role:
aws iam create-role --role-name <role-name> --assume-role-policy-document file://trust-policy.json
- List IAM Roles:
aws iam list-roles
- Delete IAM User:
aws iam delete-user --user-name <username>
- Create IAM Policy:
aws iam create-policy --policy-name <policy-name> --policy-document file://policy.json
5. Lambda Commands
AWS Lambda allows you to run code in response to events without managing servers. Here are some Lambda-specific AWS CLI commands.
- Create Lambda Function:
aws lambda create-function --function-name <function-name> --runtime <runtime> --role arn:aws:iam::<account-id>:role/<role-name> --handler <handler-name> --zip-file fileb://<deployment-package.zip>
- Invoke Lambda Function:
aws lambda invoke --function-name <function-name> outputfile.txt
- List Lambda Functions:
aws lambda list-functions
- Delete Lambda Function:
aws lambda delete-function --function-name <function-name>
6. CloudFormation Commands
AWS CloudFormation automates the provisioning of AWS resources by using templates. Here are some common CloudFormation commands.
- Create CloudFormation Stack:
aws cloudformation create-stack --stack-name <stack-name> --template-body file://template.json
- Describe CloudFormation Stacks:
aws cloudformation describe-stacks --stack-name <stack-name>
- Update CloudFormation Stack:
aws cloudformation update-stack --stack-name <stack-name> --template-body file://template.json
- Delete CloudFormation Stack:
aws cloudformation delete-stack --stack-name <stack-name>
7. EC2 EBS (Elastic Block Store) Commands
EBS provides scalable block storage for EC2 instances. Here are some EBS-related commands.
- Create EBS Volume:
aws ec2 create-volume --size <size> --availability-zone <az> --volume-type <volume-type>
- Describe EBS Volumes:
aws ec2 describe-volumes
- Attach EBS Volume to EC2 Instance:
aws ec2 attach-volume --volume-id <volume-id> --instance-id <instance-id> --device /dev/sdh
- Detach EBS Volume from EC2 Instance:
aws ec2 detach-volume --volume-id <volume-id>
- Delete EBS Volume:
aws ec2 delete-volume --volume-id <volume-id>
8. RDS (Relational Database Service) Commands
AWS RDS is a managed relational database service. Below are common commands for managing RDS instances.
- Create RDS Instance:
aws rds create-db-instance --db-instance-identifier <db-instance-id> --allocated-storage <storage> --db-instance-class <db-class> --engine <engine> --master-username <username> --master-user-password <password>
- Describe RDS Instances:
aws rds describe-db-instances
- Start RDS Instance:
aws rds start-db-instance --db-instance-identifier <db-instance-id>
- Stop RDS Instance:
aws rds stop-db-instance --db-instance-identifier <db-instance-id>
- Delete RDS Instance:
aws rds delete-db-instance --db-instance-identifier <db-instance-id> --skip-final-snapshot
9. CloudWatch Commands
AWS CloudWatch is used for monitoring and logging. Below are some common CloudWatch commands.
- Create CloudWatch Alarm:
aws cloudwatch put-metric-alarm --alarm-name <alarm-name> --metric-name <metric-name> --namespace <namespace> --statistic <statistic> --period <period> --threshold <threshold> --comparison-operator <operator> --evaluation-periods <periods> --alarm-actions <action>
- Describe CloudWatch Alarms:
aws cloudwatch describe-alarms
- List CloudWatch Logs:
aws logs describe-log-groups
Certainly! Here is a continuation with additional AWS CLI commands that cover more services and operations within AWS.
10. Amazon Route 53 Commands
Amazon Route 53 is a scalable DNS web service designed to route traffic to resources. Below are some key Route 53 CLI commands.
- Create Hosted Zone:
aws route53 create-hosted-zone --name <domain-name> --caller-reference <unique-string>
- List Hosted Zones:
aws route53 list-hosted-zones
- Create Record Set:
aws route53 change-resource-record-sets --hosted-zone-id <hosted-zone-id> --change-batch file://change-batch.json
- List Resource Record Sets:
aws route53 list-resource-record-sets --hosted-zone-id <hosted-zone-id>
- Delete Record Set:
aws route53 change-resource-record-sets --hosted-zone-id <hosted-zone-id> --change-batch file://change-batch-delete.json
11. Amazon VPC (Virtual Private Cloud) Commands
AWS VPC allows you to create isolated networks within the AWS cloud. Below are the VPC-related AWS CLI commands.
- Create a VPC:
aws ec2 create-vpc --cidr-block <cidr-block>
- Describe VPCs:
aws ec2 describe-vpcs
- Create Subnet:
aws ec2 create-subnet --vpc-id <vpc-id> --cidr-block <cidr-block> --availability-zone <az>
- Create Internet Gateway:
aws ec2 create-internet-gateway
- Attach Internet Gateway to VPC:
aws ec2 attach-internet-gateway --vpc-id <vpc-id> --internet-gateway-id <gateway-id>
- Create Security Group in VPC:
aws ec2 create-security-group --group-name <group-name> --description "Security group for VPC" --vpc-id <vpc-id>
- Create Route Table:
aws ec2 create-route-table --vpc-id <vpc-id>
- Associate Route Table with Subnet:
aws ec2 associate-route-table --subnet-id <subnet-id> --route-table-id <route-table-id>
12. Amazon CloudFront Commands
Amazon CloudFront is a content delivery network (CDN) for delivering data, videos, applications, and APIs. Here are the CloudFront commands.
- Create CloudFront Distribution:
aws cloudfront create-distribution --origin-domain-name <domain-name> --default-root-object <file>
- List CloudFront Distributions:
aws cloudfront list-distributions
- Get CloudFront Distribution Details:
aws cloudfront get-distribution --id <distribution-id>
- Create CloudFront Invalidation:
aws cloudfront create-invalidation --distribution-id <distribution-id> --paths "/*"
- Delete CloudFront Distribution:
aws cloudfront delete-distribution --id <distribution-id>
13. Amazon SNS (Simple Notification Service) Commands
SNS is a fully managed messaging service for application-to-person communication. Below are common SNS commands.
- Create SNS Topic:
aws sns create-topic --name <topic-name>
- Publish a Message to SNS Topic:
aws sns publish --topic-arn arn:aws:sns:<region>:<account-id>:<topic-name> --message "Hello, world!"
- Subscribe to SNS Topic:
aws sns subscribe --topic-arn arn:aws:sns:<region>:<account-id>:<topic-name> --protocol email --notification-endpoint <email-address>
- List SNS Topics:
aws sns list-topics
- Unsubscribe from SNS Topic:
aws sns unsubscribe --subscription-arn <subscription-arn>
- Delete SNS Topic:
aws sns delete-topic --topic-arn arn:aws:sns:<region>:<account-id>:<topic-name>
14. Amazon SQS (Simple Queue Service) Commands
SQS is a fully managed message queuing service for decoupling distributed systems. Below are some SQS-related AWS CLI commands.
- Create SQS Queue:
aws sqs create-queue --queue-name <queue-name>
- Send Message to SQS Queue:
aws sqs send-message --queue-url <queue-url> --message-body "Hello, World!"
- Receive Messages from SQS Queue:
aws sqs receive-message --queue-url <queue-url>
- Delete SQS Queue:
aws sqs delete-queue --queue-url <queue-url>
- List SQS Queues:
aws sqs list-queues
15. Amazon ECR (Elastic Container Registry) Commands
ECR is a fully managed Docker container registry. Here are some common ECR CLI commands.
- Create ECR Repository:
aws ecr create-repository --repository-name <repository-name>
- Push Docker Image to ECR:
aws ecr get-login-password --region <region> | docker login --username AWS --password-stdin <aws-account-id>.dkr.ecr.<region>.amazonaws.com
docker tag <image-name>:<tag> <aws-account-id>.dkr.ecr.<region>.amazonaws.com/<repository-name>:<tag>
docker push <aws-account-id>.dkr.ecr.<region>.amazonaws.com/<repository-name>:<tag>
- List ECR Repositories:
aws ecr describe-repositories
- Delete ECR Repository:
aws ecr delete-repository --repository-name <repository-name> --force
16. Amazon Redshift Commands
Amazon Redshift is a fully managed data warehouse solution. Below are some commonly used Redshift CLI commands.
- Create Redshift Cluster:
aws redshift create-cluster --cluster-identifier <cluster-id> --node-type <node-type> --master-username <username> --master-user-password <password> --db-name <db-name>
- Describe Redshift Clusters:
aws redshift describe-clusters
- Delete Redshift Cluster:
aws redshift delete-cluster --cluster-identifier <cluster-id> --skip-final-snapshot
17. Amazon ElastiCache Commands
ElastiCache is a fully managed in-memory data store. Here are a few ElastiCache commands.
- Create ElastiCache Cluster:
aws elasticache create-cache-cluster --cache-cluster-id <cluster-id> --cache-node-type <node-type> --engine redis --num-cache-nodes <number-of-nodes>
- Describe ElastiCache Clusters:
aws elasticache describe-cache-clusters
- Delete ElastiCache Cluster:
aws elasticache delete-cache-cluster --cache-cluster-id <cluster-id>
18. AWS Elastic Beanstalk Commands
Elastic Beanstalk is a platform as a service (PaaS) for deploying applications. Below are some commands for managing Elastic Beanstalk applications.
- Create Elastic Beanstalk Application:
aws elasticbeanstalk create-application --application-name <app-name>
- Deploy Application Version to Elastic Beanstalk:
aws elasticbeanstalk create-application-version --application-name <app-name> --version-label <version-label> --source-bundle S3Bucket=<bucket-name>,S3Key=<file-path>
- Describe Elastic Beanstalk Environments:
aws elasticbeanstalk describe-environments
- Terminate Elastic Beanstalk Environment:
aws elasticbeanstalk terminate-environment --environment-name <environment-name>
19. AWS CloudTrail Commands
CloudTrail helps you monitor and log API calls across AWS services. Here are a few useful CloudTrail commands.
- Create CloudTrail:
aws cloudtrail create-trail --name <trail-name> --s3-bucket-name <bucket-name> --is-multi-region-trail
- Describe CloudTrail Trails:
aws cloudtrail describe-trails
- Start CloudTrail Logging:
aws cloudtrail start-logging --name <trail-name>
- Stop CloudTrail Logging:
aws cloudtrail stop-logging --name <trail-name>
- Delete CloudTrail:
aws cloudtrail delete-trail --name <trail-name>
20. AWS CloudFormation Commands
CloudFormation allows you to model your entire AWS infrastructure in a text file. Here are some key CloudFormation commands.
- Create Stack:
aws cloudformation create-stack --stack-name <stack-name> --template-body file
://template.json
- Update Stack:
aws cloudformation update-stack --stack-name <stack-name> --template-body file://template.json
- Delete Stack:
aws cloudformation delete-stack --stack-name <stack-name>
- Describe Stack:
aws cloudformation describe-stacks --stack-name <stack-name>
Certainly! Below is an extended list of AWS CLI commands for even more AWS services, covering additional use cases and management tasks.
21. AWS Elastic Load Balancing (ELB) Commands
Elastic Load Balancing automatically distributes incoming application traffic across multiple targets. Below are key ELB commands.
- Create Application Load Balancer:
aws elb create-load-balancer --load-balancer-name <lb-name> --listeners Protocol=HTTP,LoadBalancerPort=80,InstanceProtocol=HTTP,InstancePort=80 --subnets <subnet-id> --security-groups <security-group-id>
- Describe Load Balancers:
aws elb describe-load-balancers
- Delete Load Balancer:
aws elb delete-load-balancer --load-balancer-name <lb-name>
- Create Target Group:
aws elbv2 create-target-group --name <target-group-name> --protocol HTTP --port 80 --vpc-id <vpc-id>
- Register Targets with Target Group:
aws elbv2 register-targets --target-group-arn <target-group-arn> --targets Id=<instance-id>
- Deregister Targets from Target Group:
aws elbv2 deregister-targets --target-group-arn <target-group-arn> --targets Id=<instance-id>
22. AWS Kinesis Commands
Amazon Kinesis is a platform to collect, process, and analyze real-time data streams. Below are the Kinesis CLI commands.
- Create Kinesis Stream:
aws kinesis create-stream --stream-name <stream-name> --shard-count <number-of-shards>
- Put Record to Kinesis Stream:
aws kinesis put-record --stream-name <stream-name> --partition-key <key> --data <data>
- Describe Kinesis Stream:
aws kinesis describe-stream --stream-name <stream-name>
- Delete Kinesis Stream:
aws kinesis delete-stream --stream-name <stream-name>
- List Kinesis Streams:
aws kinesis list-streams
23. Amazon DynamoDB Commands
DynamoDB is a NoSQL database service. Here are some useful DynamoDB CLI commands.
- Create DynamoDB Table:
aws dynamodb create-table --table-name <table-name> --attribute-definitions AttributeName=<attribute-name>,AttributeType=S --key-schema AttributeName=<attribute-name>,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
- Describe DynamoDB Table:
aws dynamodb describe-table --table-name <table-name>
- Put Item in DynamoDB Table:
aws dynamodb put-item --table-name <table-name> --item '{"ID": {"S": "12345"}, "Name": {"S": "John Doe"}}'
- Get Item from DynamoDB Table:
aws dynamodb get-item --table-name <table-name> --key '{"ID": {"S": "12345"}}'
- Delete Item from DynamoDB Table:
aws dynamodb delete-item --table-name <table-name> --key '{"ID": {"S": "12345"}}'
- Delete DynamoDB Table:
aws dynamodb delete-table --table-name <table-name>
24. AWS Step Functions Commands
AWS Step Functions is a service for building complex workflows. Below are key commands for managing Step Functions.
- Create State Machine:
aws stepfunctions create-state-machine --name <state-machine-name> --definition file://state-machine-definition.json --role-arn arn:aws:iam::<account-id>:role/<role-name>
- Start Execution:
aws stepfunctions start-execution --state-machine-arn arn:aws:states:<region>:<account-id>:stateMachine:<state-machine-name> --input file://input.json
- Describe Execution:
aws stepfunctions describe-execution --execution-arn arn:aws:states:<region>:<account-id>:execution:<state-machine-name>:<execution-id>
- List Executions:
aws stepfunctions list-executions --state-machine-arn arn:aws:states:<region>:<account-id>:stateMachine:<state-machine-name>
- Delete State Machine:
aws stepfunctions delete-state-machine --state-machine-arn arn:aws:states:<region>:<account-id>:stateMachine:<state-machine-name>
25. AWS Sagemaker Commands
Amazon SageMaker is used for building, training, and deploying machine learning models. Below are some SageMaker commands.
- Create SageMaker Notebook Instance:
aws sagemaker create-notebook-instance --notebook-instance-name <notebook-name> --instance-type <instance-type> --role-arn arn:aws:iam::<account-id>:role/<role-name>
- Describe SageMaker Notebook Instance:
aws sagemaker describe-notebook-instance --notebook-instance-name <notebook-name>
- Start SageMaker Training Job:
aws sagemaker create-training-job --training-job-name <job-name> --algorithm-specification TrainingImage=<image>,TrainingInputMode=File --input-data-config <data-config> --output-data-config <output-config> --resource-config <resource-config>
- Create SageMaker Model:
aws sagemaker create-model --model-name <model-name> --primary-container <container-config> --execution-role-arn arn:aws:iam::<account-id>:role/<role-name>
- Deploy SageMaker Model:
aws sagemaker create-endpoint --endpoint-name <endpoint-name> --endpoint-config-name <endpoint-config-name>
26. Amazon Aurora Commands
Amazon Aurora is a relational database service. Below are some key Aurora commands.
- Create Aurora DB Cluster:
aws rds create-db-cluster --db-cluster-identifier <cluster-id> --engine aurora --master-username <username> --master-user-password <password> --db-subnet-group-name <subnet-group-name>
- Create Aurora DB Instance:
aws rds create-db-instance --db-instance-identifier <instance-id> --db-cluster-identifier <cluster-id> --engine aurora --db-instance-class <db-class>
- Describe Aurora DB Cluster:
aws rds describe-db-clusters --db-cluster-identifier <cluster-id>
- Delete Aurora DB Cluster:
aws rds delete-db-cluster --db-cluster-identifier <cluster-id> --skip-final-snapshot
27. AWS Backup Commands
AWS Backup provides centralized backup services for AWS resources. Here are some common AWS Backup commands.
- Create Backup Plan:
aws backup create-backup-plan --backup-plan file://backup-plan.json
- Start Backup Job:
aws backup start-backup-job --backup-vault-name <vault-name> --resource-arn <resource-arn> --iam-role-arn arn:aws:iam::<account-id>:role/<role-name>
- Describe Backup Job:
aws backup describe-backup-job --backup-job-id <job-id>
- List Backup Plans:
aws backup list-backup-plans
- Delete Backup Plan:
aws backup delete-backup-plan --backup-plan-id <plan-id>
28. Amazon Transcribe Commands
Amazon Transcribe is a speech-to-text service. Below are common commands for using Transcribe.
- Start Transcription Job:
aws transcribe start-transcription-job --transcription-job-name <job-name> --language-code en-US --media MediaFileUri=<s3-uri>
- List Transcription Jobs:
aws transcribe list-transcription-jobs
- Get Transcription Job Details:
aws transcribe get-transcription-job --transcription-job-name <job-name>
- Delete Transcription Job:
aws transcribe delete-transcription-job --transcription-job-name <job-name>
29. AWS Direct Connect Commands
AWS Direct Connect establishes a dedicated network connection between your data center and AWS. Here are the commands related to Direct Connect.
- Create Direct Connect Connection:
aws directconnect create-connection --connection-name <connection-name> --location <location> --bandwidth <bandwidth> --connection-initiator <initiator>
- Describe Direct Connect Connections:
aws directconnect describe-connections
- Delete Direct Connect Connection:
aws directconnect delete-connection --connection-id <connection-id>
30. AWS AppSync Commands
AWS AppSync is a managed GraphQL service for building APIs. Below are the common commands for managing AppSync resources.
- Create GraphQL API:
aws appsync create-graphql-api --name <api-name> --authentication-type API_KEY
- List GraphQL APIs:
aws appsync list-graphql-apis
- Create API Key:
aws appsync create-api-key --api
-id <api-id> --description <description>
- Delete GraphQL API:
aws appsync delete-graphql-api --api-id <api-id>
31. AWS Lambda Commands
AWS Lambda lets you run code without provisioning or managing servers. Below are key Lambda commands.
- Create Lambda Function:
aws lambda create-function --function-name <function-name> --runtime nodejs14.x --role arn:aws:iam::<account-id>:role/<role-name> --handler index.handler --zip-file fileb://function.zip
- Invoke Lambda Function:
aws lambda invoke --function-name <function-name> output.txt
- List Lambda Functions:
aws lambda list-functions
- Update Lambda Function:
aws lambda update-function-code --function-name <function-name> --zip-file fileb://new-function.zip
- Delete Lambda Function:
aws lambda delete-function --function-name <function-name>
32. AWS Secrets Manager Commands
AWS Secrets Manager helps you protect access to your applications, services, and IT resources. Here are some important commands for managing secrets.
- Create Secret:
aws secretsmanager create-secret --name <secret-name> --secret-string <secret-value>
- Get Secret Value:
aws secretsmanager get-secret-value --secret-id <secret-id>
- Update Secret:
aws secretsmanager update-secret --secret-id <secret-id> --secret-string <new-secret-value>
- Delete Secret:
aws secretsmanager delete-secret --secret-id <secret-id>
- List Secrets:
aws secretsmanager list-secrets
33. AWS S3 (Simple Storage Service) Commands
Amazon S3 provides object storage through a web interface. Below are key S3 commands.
- Create S3 Bucket:
aws s3 mb s3://<bucket-name>
- List S3 Buckets:
aws s3 ls
- Upload File to S3 Bucket:
aws s3 cp <file-path> s3://<bucket-name>/<object-key>
- Download File from S3 Bucket:
aws s3 cp s3://<bucket-name>/<object-key> <file-path>
- Delete File from S3 Bucket:
aws s3 rm s3://<bucket-name>/<object-key>
- Sync Local Directory with S3 Bucket:
aws s3 sync <local-directory> s3://<bucket-name>
- Delete S3 Bucket:
aws s3 rb s3://<bucket-name> --force
34. AWS CloudWatch Commands
Amazon CloudWatch allows you to monitor AWS resources and applications in real-time. Here are some useful CloudWatch commands.
- Create CloudWatch Alarm:
aws cloudwatch put-metric-alarm --alarm-name <alarm-name> --metric-name <metric-name> --namespace <namespace> --statistic Average --period 300 --threshold <threshold> --comparison-operator GreaterThanThreshold --evaluation-periods 1 --alarm-actions <SNS-topic-arn> --dimensions Name=InstanceId,Value=<instance-id>
- List CloudWatch Alarms:
aws cloudwatch describe-alarms
- Delete CloudWatch Alarm:
aws cloudwatch delete-alarms --alarm-names <alarm-name>
- Put Custom CloudWatch Metric:
aws cloudwatch put-metric-data --namespace <namespace> --metric-name <metric-name> --value <value>
- Get CloudWatch Log Events:
aws logs filter-log-events --log-group-name <log-group-name> --log-stream-name <log-stream-name>
35. AWS EC2 Commands
Amazon EC2 (Elastic Compute Cloud) provides scalable compute capacity. Below are key EC2 commands.
- Launch EC2 Instance:
aws ec2 run-instances --image-id <ami-id> --count 1 --instance-type <instance-type> --key-name <key-pair-name> --security-group-ids <security-group-id> --subnet-id <subnet-id>
- Describe EC2 Instances:
aws ec2 describe-instances --instance-ids <instance-id>
- Stop EC2 Instance:
aws ec2 stop-instances --instance-ids <instance-id>
- Start EC2 Instance:
aws ec2 start-instances --instance-ids <instance-id>
- Terminate EC2 Instance:
aws ec2 terminate-instances --instance-ids <instance-id>
- Create Key Pair:
aws ec2 create-key-pair --key-name <key-name> --query 'KeyMaterial' --output text > <key-name>.pem
- Associate Elastic IP with EC2 Instance:
aws ec2 associate-address --instance-id <instance-id> --public-ip <elastic-ip>
36. AWS SNS (Simple Notification Service) Commands
AWS SNS provides simple notification and messaging service. Here are important SNS commands.
- Create SNS Topic:
aws sns create-topic --name <topic-name>
- Publish Message to SNS Topic:
aws sns publish --topic-arn arn:aws:sns:<region>:<account-id>:<topic-name> --message "Hello, world!"
- Subscribe to SNS Topic:
aws sns subscribe --topic-arn arn:aws:sns:<region>:<account-id>:<topic-name> --protocol email --notification-endpoint <email-address>
- List SNS Topics:
aws sns list-topics
- Delete SNS Topic:
aws sns delete-topic --topic-arn arn:aws:sns:<region>:<account-id>:<topic-name>
37. AWS CloudTrail Commands
AWS CloudTrail helps you log and monitor account activity. Below are essential CloudTrail commands.
- Create CloudTrail Trail:
aws cloudtrail create-trail --name <trail-name> --s3-bucket-name <bucket-name> --is-multi-region-trail
- Start CloudTrail Logging:
aws cloudtrail start-logging --name <trail-name>
- Stop CloudTrail Logging:
aws cloudtrail stop-logging --name <trail-name>
- Describe CloudTrail Trails:
aws cloudtrail describe-trails
- Delete CloudTrail Trail:
aws cloudtrail delete-trail --name <trail-name>
38. Amazon RDS Commands
Amazon Relational Database Service (RDS) is a managed SQL database service. Here are some key RDS commands.
- Create RDS Instance:
aws rds create-db-instance --db-instance-identifier <instance-id> --db-instance-class db.t2.micro --engine mysql --master-username <username> --master-user-password <password> --allocated-storage 20
- Describe RDS Instances:
aws rds describe-db-instances --db-instance-identifier <instance-id>
- Modify RDS Instance:
aws rds modify-db-instance --db-instance-identifier <instance-id> --allocated-storage 30
- Delete RDS Instance:
aws rds delete-db-instance --db-instance-identifier <instance-id> --skip-final-snapshot
39. Amazon VPC Commands
Amazon Virtual Private Cloud (VPC) lets you create a private network within AWS. Below are some essential VPC commands.
- Create VPC:
aws ec2 create-vpc --cidr-block <cidr-block>
- Describe VPCs:
aws ec2 describe-vpcs
- Create Subnet:
aws ec2 create-subnet --vpc-id <vpc-id> --cidr-block <cidr-block>
- Create Internet Gateway:
aws ec2 create-internet-gateway
- Attach Internet Gateway to VPC:
aws ec2 attach-internet-gateway --vpc-id <vpc-id> --internet-gateway-id <igw-id>
- Delete VPC:
aws ec2 delete-vpc --vpc-id <vpc-id>
40. AWS CloudFront Commands
Amazon CloudFront is a content delivery network (CDN). Below are important CloudFront commands.
- Create CloudFront Distribution:
aws cloudfront create-distribution --origin-domain-name <domain-name> --default-root-object <object-name>
- Describe CloudFront Distributions:
aws cloudfront list-distributions
- Delete CloudFront Distribution:
aws cloudfront delete-distribution --id <distribution-id>
41. AWS CodeCommit Commands
AWS CodeCommit is a fully managed source control service that you can use to host secure Git repositories. Below are key CodeCommit commands.
- Create CodeCommit Repository:
aws codecommit create-repository --repository-name <repo-name> --repository-description "My repository description"
- Clone CodeCommit Repository:
git clone https://git-codecommit.<region>.amazonaws.com/v1/repos/<repo-name>
- List CodeCommit Repositories:
aws codecommit list-repositories
- Get Repository Information:
aws codecommit get-repository --repository-name <repo-name>
- Delete CodeCommit Repository:
aws codecommit delete-repository --repository-name <repo-name>
42. AWS CodePipeline Commands
AWS CodePipeline is a continuous integration and continuous delivery (CI/CD) service. Here are some important CodePipeline commands.
- Create CodePipeline:
aws codepipeline create-pipeline --pipeline <pipeline-definition-file>
- Start CodePipeline Execution:
aws codepipeline start-pipeline-execution --name <pipeline-name>
- List CodePipelines:
aws codepipeline list-pipelines
- Get Pipeline Details:
aws codepipeline get-pipeline --name <pipeline-name>
- Delete CodePipeline:
aws codepipeline delete-pipeline --name <pipeline-name>
43. AWS Elastic Beanstalk Commands
AWS Elastic Beanstalk is a Platform as a Service (PaaS) solution for deploying web applications. Below are some useful commands.
- Create Elastic Beanstalk Environment:
aws elasticbeanstalk create-environment --application-name <app-name> --environment-name <env-name> --solution-stack-name <solution-stack-name>
- Describe Elastic Beanstalk Environments:
aws elasticbeanstalk describe-environments
- Update Elastic Beanstalk Environment:
aws elasticbeanstalk update-environment --environment-name <env-name> --version-label <version-label>
- Terminate Elastic Beanstalk Environment:
aws elasticbeanstalk terminate-environment --environment-name <env-name>
- Create Application Version in Elastic Beanstalk:
aws elasticbeanstalk create-application-version --application-name <app-name> --version-label <version-label> --source-bundle S3Bucket=<bucket-name>,S3Key=<object-key>
44. AWS ECS (Elastic Container Service) Commands
Amazon ECS is a fully managed container orchestration service. Here are some key ECS commands.
- Create ECS Cluster:
aws ecs create-cluster --cluster-name <cluster-name>
- Register Task Definition:
aws ecs register-task-definition --family <task-family> --container-definitions file://container-definitions.json
- Run ECS Task:
aws ecs run-task --cluster <cluster-name> --task-definition <task-definition> --count 1
- List ECS Clusters:
aws ecs list-clusters
- Describe ECS Services:
aws ecs describe-services --cluster <cluster-name> --services <service-name>
- Update ECS Service:
aws ecs update-service --cluster <cluster-name> --service <service-name> --desired-count <desired-count>
- Delete ECS Cluster:
aws ecs delete-cluster --cluster <cluster-name>
45. AWS EKS (Elastic Kubernetes Service) Commands
Amazon EKS is a managed Kubernetes service for running containerized applications. Here are some essential EKS commands.
- Create EKS Cluster:
aws eks create-cluster --name <cluster-name> --role-arn arn:aws:iam::<account-id>:role/<role-name> --resources-vpc-config subnetIds=<subnet-ids>,securityGroupIds=<security-group-ids>
- Describe EKS Cluster:
aws eks describe-cluster --name <cluster-name>
- Update EKS Cluster Config:
aws eks update-kubeconfig --name <cluster-name>
- Delete EKS Cluster:
aws eks delete-cluster --name <cluster-name>
46. AWS Redshift Commands
Amazon Redshift is a managed data warehouse service. Here are essential Redshift commands.
- Create Redshift Cluster:
aws redshift create-cluster --cluster-identifier <cluster-id> --node-type <node-type> --master-username <username> --master-user-password <password> --number-of-nodes 3
- Describe Redshift Clusters:
aws redshift describe-clusters
- Modify Redshift Cluster:
aws redshift modify-cluster --cluster-identifier <cluster-id> --master-user-password <new-password>
- Delete Redshift Cluster:
aws redshift delete-cluster --cluster-identifier <cluster-id> --skip-final-snapshot
47. AWS Elastic File System (EFS) Commands
Amazon EFS is a scalable file storage system for use with AWS Cloud services and on-premises resources. Below are some important EFS commands.
- Create EFS File System:
aws efs create-file-system --creation-token <token> --performance-mode generalPurpose
- List EFS File Systems:
aws efs describe-file-systems
- Delete EFS File System:
aws efs delete-file-system --file-system-id <file-system-id>
- Mount EFS File System:
sudo mount -t efs <file-system-id>:/ /mnt/efs
48. AWS SQS (Simple Queue Service) Commands
Amazon SQS is a fully managed message queuing service. Below are some useful SQS commands.
- Create SQS Queue:
aws sqs create-queue --queue-name <queue-name>
- Send Message to SQS Queue:
aws sqs send-message --queue-url <queue-url> --message-body "Hello, world!"
- Receive Message from SQS Queue:
aws sqs receive-message --queue-url <queue-url>
- Delete Message from SQS Queue:
aws sqs delete-message --queue-url <queue-url> --receipt-handle <receipt-handle>
- List SQS Queues:
aws sqs list-queues
49. AWS Kinesis Commands
Amazon Kinesis provides real-time data streaming. Below are key Kinesis commands.
- Create Kinesis Stream:
aws kinesis create-stream --stream-name <stream-name> --shard-count 1
- Put Record into Kinesis Stream:
aws kinesis put-record --stream-name <stream-name> --partition-key <partition-key> --data <data>
- Describe Kinesis Stream:
aws kinesis describe-stream --stream-name <stream-name>
- List Kinesis Streams:
aws kinesis list-streams
- Delete Kinesis Stream:
aws kinesis delete-stream --stream-name <stream-name>
50. AWS CloudFormation Stack Commands
- Create CloudFormation Stack:
aws cloudformation create-stack --stack-name <stack-name> --template-body file://template.json
- Describe CloudFormation Stack:
aws cloudformation describe-stacks --stack-name <stack-name>
- Update CloudFormation Stack:
aws cloudformation update-stack --stack-name <stack-name> --template-body file://template.json
- Delete CloudFormation Stack:
aws cloudformation delete-stack --stack-name <stack-name>
51. AWS Elastic Load Balancing (ELB) Commands
Amazon Elastic Load Balancing automatically distributes incoming application traffic across multiple targets, such as EC2 instances. Below are some important ELB commands.
- Create Application Load Balancer:
aws elb create-load-balancer --load-balancer-name <lb-name> --listeners Protocol=HTTP,LoadBalancerPort=80,InstanceProtocol=HTTP,InstancePort=80 --subnets <subnet-id> --security-groups <security-group-id>
- Describe Load Balancers:
aws elb describe-load-balancers
- Register EC2 Instances with Load Balancer:
aws elb register-instances-with-load-balancer --load-balancer-name <lb-name> --instances <instance-id>
- Deregister EC2 Instances from Load Balancer:
aws elb deregister-instances-from-load-balancer --load-balancer-name <lb-name> --instances <instance-id>
- Delete Load Balancer:
aws elb delete-load-balancer --load-balancer-name <lb-name>
52. AWS Auto Scaling Commands
Auto Scaling helps ensure that the correct number of Amazon EC2 instances are running to handle the load for your application. Below are key Auto Scaling commands.
- Create Auto Scaling Group:
aws autoscaling create-auto-scaling-group --auto-scaling-group-name <asg-name> --launch-configuration-name <launch-config-name> --min-size 1 --max-size 3 --desired-capacity 2 --vpc-zone-identifier <subnet-id>
- Describe Auto Scaling Groups:
aws autoscaling describe-auto-scaling-groups
- Update Auto Scaling Group:
aws autoscaling update-auto-scaling-group --auto-scaling-group-name <asg-name> --min-size 2 --max-size 4 --desired-capacity 3
- Delete Auto Scaling Group:
aws autoscaling delete-auto-scaling-group --auto-scaling-group-name <asg-name> --force-delete
53. AWS Elastic IP Commands
Elastic IP is a static, public IPv4 address designed for dynamic cloud computing. Below are key Elastic IP commands.
- Allocate Elastic IP:
aws ec2 allocate-address
- Associate Elastic IP with EC2 Instance:
aws ec2 associate-address --instance-id <instance-id> --public-ip <elastic-ip>
- Disassociate Elastic IP from EC2 Instance:
aws ec2 disassociate-address --association-id <association-id>
- Release Elastic IP:
aws ec2 release-address --public-ip <elastic-ip>
54. AWS Aurora (Managed Database) Commands
Amazon Aurora is a relational database service that provides compatibility with MySQL and PostgreSQL. Below are some key Aurora commands.
- Create Aurora Cluster:
aws rds create-db-cluster --db-cluster-identifier <cluster-id> --engine aurora-mysql --master-username <username> --master-user-password <password>
- Create Aurora DB Instance:
aws rds create-db-instance --db-instance-identifier <instance-id> --db-cluster-identifier <cluster-id> --engine aurora-mysql --db-instance-class db.r5.large --allocated-storage 20
- Describe Aurora Clusters:
aws rds describe-db-clusters --db-cluster-identifier <cluster-id>
- Delete Aurora Cluster:
aws rds delete-db-cluster --db-cluster-identifier <cluster-id> --skip-final-snapshot
- Delete Aurora DB Instance:
aws rds delete-db-instance --db-instance-identifier <instance-id> --skip-final-snapshot
55. AWS WAF (Web Application Firewall) Commands
AWS WAF helps protect your web applications from common web exploits. Below are some key AWS WAF commands.
- Create Web ACL:
aws wafv2 create-web-acl --name <acl-name> --scope REGIONAL --default-action Allow={} --rules <rules> --visibility-config SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true,MetricName=<metric-name> --region <region>
- Associate Web ACL with Application Load Balancer:
aws wafv2 associate-web-acl --web-acl-arn <web-acl-arn> --resource-arn <lb-arn>
- List Web ACLs:
aws wafv2 list-web-acls --scope REGIONAL
- Delete Web ACL:
aws wafv2 delete-web-acl --scope REGIONAL --id <web-acl-id>
56. AWS CloudFormation StackSet Commands
AWS CloudFormation StackSets allow you to manage stacks across multiple accounts and regions. Below are some key commands.
- Create StackSet:
aws cloudformation create-stack-set --stack-set-name <stack-set-name> --template-body file://template.json --capabilities CAPABILITY_NAMED_IAM
- List StackSets:
aws cloudformation list-stack-sets
- Create Stack Instances in StackSet:
aws cloudformation create-stack-instances --stack-set-name <stack-set-name> --regions <region> --account-id <account-id>
- Delete StackSet:
aws cloudformation delete-stack-set --stack-set-name <stack-set-name>
57. AWS DynamoDB Commands
Amazon DynamoDB is a fully managed NoSQL database service. Below are key DynamoDB commands.
- Create DynamoDB Table:
aws dynamodb create-table --table-name <table-name> --attribute-definitions AttributeName=<attribute-name>,AttributeType=<attribute-type> --key-schema AttributeName=<primary-key>,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
- Describe DynamoDB Table:
aws dynamodb describe-table --table-name <table-name>
- Put Item into DynamoDB Table:
aws dynamodb put-item --table-name <table-name> --item '{"id": {"S": "1"}, "name": {"S": "John"}}'
- Get Item from DynamoDB Table:
aws dynamodb get-item --table-name <table-name> --key '{"id": {"S": "1"}}'
- Delete DynamoDB Table:
aws dynamodb delete-table --table-name <table-name>
58. AWS SSM (Systems Manager) Commands
AWS Systems Manager provides operational insights and automation. Below are key SSM commands.
- Run Command on EC2 Instance:
aws ssm send-command --instance-ids <instance-id> --document-name "AWS-RunShellScript" --parameters 'commands=["<command-to-execute>"]'
- Describe SSM Managed Instances:
aws ssm describe-instance-information
- List SSM Documents:
aws ssm list-documents
- Create SSM Automation Document:
aws ssm create-document --name <document-name> --document-type "Automation" --content file://document.json
- Delete SSM Document:
aws ssm delete-document --name <document-name>
59. AWS Systems Manager Parameter Store Commands
AWS Systems Manager Parameter Store is used to store configuration data. Below are some key commands.
- Create Parameter:
aws ssm put-parameter --name <parameter-name> --value <parameter-value> --type SecureString
- Describe Parameter:
aws ssm describe-parameters --filters Key=Name,Values=<parameter-name>
- Get Parameter:
aws ssm get-parameter --name <parameter-name> --with-decryption
- Delete Parameter:
aws ssm delete-parameter --name <parameter-name>
60. AWS Route 53 Commands
AWS Route 53 is a scalable Domain Name System (DNS) web service. Below are essential Route 53 commands.
- Create Hosted Zone:
aws route53 create-hosted-zone --name <domain-name> --caller-reference <unique-id>
- List Hosted Zones:
aws route53 list-hosted-zones
- Change DNS Record Set:
aws route53 change-resource-record-sets --hosted-zone-id <zone-id> --change-batch file://change-batch.json
- Delete Hosted Zone:
aws route53 delete-hosted-zone --id <zone-id>
61. AWS Step Functions Commands
AWS Step Functions enables you to coordinate multiple AWS services into serverless workflows. Below are key commands.
- Create Step Functions State Machine:
aws stepfunctions create-state-machine --name <state-machine-name> --definition file://state-machine-definition.json --role-arn arn:aws:iam::<account-id>:role/<role-name>
- List State Machines:
aws stepfunctions list-state-machines
- Start Step Functions Execution:
aws stepfunctions start-execution --state-machine-arn <state-machine-arn> --name <execution-name> --input file://input-data.json
- Describe Step Functions Execution:
aws stepfunctions describe-execution --execution-arn <execution-arn>
- Delete Step Functions State Machine:
aws stepfunctions delete-state-machine --state-machine-arn <state-machine-arn>
62. AWS Macie Commands
AWS Macie is a security service that helps discover, classify, and protect sensitive data. Below are some essential Macie commands.
- Enable Macie:
aws macie2 enable-macie
- Create Classification Job:
aws macie2 create-classification-job --job-type ONE_TIME --name <job-name> --s3-job-definition bucketDefinitions=[{accountId=<account-id>,bucketName=<bucket-name>}]
- List Macie Jobs:
aws macie2 list-classification-jobs
- Describe Macie Job:
aws macie2 describe-classification-job --job-id <job-id>
- Disable Macie:
aws macie2 disable-macie
63. AWS GuardDuty Commands
Amazon GuardDuty is a threat detection service that continuously monitors for malicious activity. Below are key GuardDuty commands.
- Enable GuardDuty:
aws guardduty enable-guard-duty
- List GuardDuty Findings:
aws guardduty list-findings --detector-id <detector-id>
- Get GuardDuty Finding:
aws guardduty get-findings --detector-id <detector-id> --finding-ids <finding-id>
- Create GuardDuty Detector:
aws guardduty create-detector --enable
- Disable GuardDuty Detector:
aws guardduty disable-detector --detector-id <detector-id>
64. AWS Secrets Manager Commands
AWS Secrets Manager helps you protect access to your applications, services, and IT resources by storing and retrieving credentials securely. Below are key Secrets Manager commands.
- Create Secret:
aws secretsmanager create-secret --name <secret-name> --description "My secret" --secret-string <secret-value>
- Get Secret Value:
aws secretsmanager get-secret-value --secret-id <secret-name>
- List Secrets:
aws secretsmanager list-secrets
- Update Secret:
aws secretsmanager update-secret --secret-id <secret-name> --secret-string <new-secret-value>
- Delete Secret:
aws secretsmanager delete-secret --secret-id <secret-name> --force-delete-without-recovery
65. AWS CloudTrail Commands
AWS CloudTrail records API calls made on your account. Below are key CloudTrail commands.
- Create CloudTrail Trail:
aws cloudtrail create-trail --name <trail-name> --s3-bucket-name <bucket-name> --is-multi-region-trail
- Start CloudTrail Logging:
aws cloudtrail start-logging --name <trail-name>
- Stop CloudTrail Logging:
aws cloudtrail stop-logging --name <trail-name>
- Describe CloudTrail Trails:
aws cloudtrail describe-trails
- Delete CloudTrail Trail:
aws cloudtrail delete-trail --name <trail-name>
66. AWS CodeBuild Commands
AWS CodeBuild is a fully managed build service that compiles source code and runs tests. Below are key CodeBuild commands.
- Create CodeBuild Project:
aws codebuild create-project --name <project-name> --source type=CODECOMMIT,location=<repository-url> --artifacts type=NO_ARTIFACTS --environment type=LINUX_CONTAINER,image=aws/codebuild/standard:4.0
- Start CodeBuild Build:
aws codebuild start-build --project-name <project-name>
- List CodeBuild Projects:
aws codebuild list-projects
- Describe CodeBuild Project:
aws codebuild batch-get-projects --names <project-name>
- Delete CodeBuild Project:
aws codebuild delete-project --name <project-name>
67. AWS Elasticache Commands
Amazon ElastiCache provides an in-memory data store. Below are essential ElastiCache commands.
- Create ElastiCache Cluster:
aws elasticache create-cache-cluster --cache-cluster-id <cluster-id> --engine redis --cache-node-type cache.t2.micro --num-cache-nodes 1
- Describe ElastiCache Clusters:
aws elasticache describe-cache-clusters --cache-cluster-id <cluster-id>
- Modify ElastiCache Cluster:
aws elasticache modify-cache-cluster --cache-cluster-id <cluster-id> --num-cache-nodes 2
- Delete ElastiCache Cluster:
aws elasticache delete-cache-cluster --cache-cluster-id <cluster-id>
68. AWS Fargate Commands
AWS Fargate is a serverless compute engine for containers. Here are some important Fargate commands.
- Create Fargate Task Definition:
aws ecs register-task-definition --family <task-family> --execution-role-arn arn:aws:iam::<account-id>:role/<role-name> --network-mode awsvpc --container-definitions file://container-definition.json
- Run Fargate Task:
aws ecs run-task --cluster <cluster-name> --task-definition <task-definition> --launch-type FARGATE --network-configuration "awsvpcConfiguration={subnets=[<subnet-id>],securityGroups=[<security-group-id>],assignPublicIp=ENABLED}"
- Describe Fargate Task:
aws ecs describe-tasks --cluster <cluster-name> --tasks <task-id>
- Stop Fargate Task:
aws ecs update-service --cluster <cluster-name> --service <service-name> --desired-count 0
69. AWS Direct Connect Commands
AWS Direct Connect enables a dedicated network connection from your premises to AWS. Below are key Direct Connect commands.
- Create Direct Connect Connection:
aws directconnect create-connection --location <location> --connection-name <connection-name> --bandwidth 1Gbps --lag-id <lag-id>
- List Direct Connect Connections:
aws directconnect describe-connections
- Delete Direct Connect Connection:
aws directconnect delete-connection --connection-id <connection-id>
70. AWS Elastic Transcoder Commands
AWS Elastic Transcoder is a service for converting media files. Below are key commands.
- Create Elastic Transcoder Pipeline:
aws elastictranscoder create-pipeline --name <pipeline-name> --input-bucket <input-bucket-name> --output-bucket <output-bucket-name> --role arn:aws:iam::<account-id>:role/<role-name>
- List Elastic Transcoder Pipelines:
aws elastictranscoder list-pipelines
- Create Elastic Transcoder Job:
aws elastictranscoder create-job --pipeline-id <pipeline-id> --input Key=<input-key> --output Key=<output-key> --preset-id <preset-id>
- Delete Elastic Transcoder Pipeline:
aws elastictranscoder delete-pipeline --id <pipeline-id>
71. AWS CodePipeline Commands
AWS CodePipeline automates continuous integration and continuous delivery (CI/CD). Here are the essential commands.
- Create CodePipeline:
aws codepipeline create-pipeline --pipeline file://pipeline-definition.json
- List CodePipelines:
aws codepipeline list-pipelines
- Start CodePipeline Execution:
aws codepipeline start-pipeline-execution --name <pipeline-name>
- Describe CodePipeline:
aws codepipeline get-pipeline --name <pipeline-name>
- Delete CodePipeline:
aws codepipeline delete-pipeline --name <pipeline-name>
72. AWS CloudWatch Logs Commands
Amazon CloudWatch Logs helps monitor, store, and access log files from Amazon EC2 instances, AWS CloudTrail, and other AWS services.
- Create Log Group:
aws logs create-log-group --log-group-name <log-group-name>
- Create Log Stream:
aws logs create-log-stream --log-group-name <log-group-name> --log-stream-name <log-stream-name>
- Put Log Events:
aws logs put-log-events --log-group-name <log-group-name> --log-stream-name <log-stream-name> --log-events timestamp=<timestamp>,message=<log-message>
- Describe Log Groups:
aws logs describe-log-groups
- Delete Log Group:
aws logs delete-log-group --log-group-name <log-group-name>
73. AWS Lambda Commands
AWS Lambda allows you to run code without provisioning or managing servers.
- Create Lambda Function:
aws lambda create-function --function-name <function-name> --runtime nodejs14.x --role arn:aws:iam::<account-id>:role/<role-name> --handler index.handler --zip-file fileb://function.zip
- Invoke Lambda Function:
aws lambda invoke --function-name <function-name> --payload file://input.json output.json
- List Lambda Functions:
aws lambda list-functions
- Delete Lambda Function:
aws lambda delete-function --function-name <function-name>
74. AWS ECS (Elastic Container Service) Commands
AWS ECS is a container management service that supports Docker containers.
- Create ECS Cluster:
aws ecs create-cluster --cluster-name <cluster-name>
- Create ECS Task Definition:
aws ecs register-task-definition --family <task-family> --container-definitions file://container-definition.json
- Run ECS Task:
aws ecs run-task --cluster <cluster-name> --task-definition <task-definition> --launch-type EC2 --count 1
- List ECS Services:
aws ecs list-services --cluster <cluster-name>
- Delete ECS Cluster:
aws ecs delete-cluster --cluster <cluster-name>
75. AWS Route 53 Health Checks Commands
Route 53 health checks monitor the health of your web servers and applications.
- Create Health Check:
aws route53 create-health-check --caller-reference <unique-id> --health-check-config "IPAddress=<ip-address>,Port=80,Type=HTTP,ResourcePath=/health"
- List Health Checks:
aws route53 list-health-checks
- Delete Health Check:
aws route53 delete-health-check --health-check-id <health-check-id>
76. AWS S3 Storage Lens Commands
S3 Storage Lens provides visibility into object storage usage and activity trends.
- Create S3 Storage Lens Metrics:
aws s3control create-metrics-configuration --account-id <account-id> --metrics-configuration file://metrics-config.json
- List S3 Storage Lens Metrics:
aws s3control list-metrics-configurations --account-id <account-id>
- Delete S3 Storage Lens Metrics:
aws s3control delete-metrics-configuration --account-id <account-id> --metrics-configuration-id <metrics-id>
77. AWS CodeDeploy Commands
AWS CodeDeploy automates the deployment of applications to Amazon EC2 instances.
- Create CodeDeploy Application:
aws deploy create-application --application-name <application-name> --compute-platform Server
- Create Deployment Group:
aws deploy create-deployment-group --application-name <application-name> --deployment-group-name <deployment-group-name> --service-role arn:aws:iam::<account-id>:role/<role-name>
- Create Deployment:
aws deploy create-deployment --application-name <application-name> --deployment-group-name <deployment-group-name> --revision file://app-revision.zip
- List Deployments:
aws deploy list-deployments --application-name <application-name> --deployment-group-name <deployment-group-name>
- Delete CodeDeploy Application:
aws deploy delete-application --application-name <application-name>
78. AWS Elastic File System (EFS) Commands
Amazon EFS provides scalable file storage for use with Amazon EC2 instances.
- Create EFS File System:
aws efs create-file-system --creation-token <token> --performance-mode generalPurpose
- List EFS File Systems:
aws efs describe-file-systems
- Delete EFS File System:
aws efs delete-file-system --file-system-id <file-system-id>
79. AWS Glacier Commands
Amazon Glacier is a low-cost cloud storage service for data archiving and backup.
- Initiate Glacier Archive:
aws glacier upload-archive --vault-name <vault-name> --archive-description <description> --body <file-path>
- List Glacier Vaults:
aws glacier list-vaults --account-id <account-id>
- Delete Glacier Archive:
aws glacier delete-archive --vault-name <vault-name> --archive-id <archive-id>
80. AWS VPC Commands
Amazon Virtual Private Cloud (VPC) enables you to create a logically isolated network within AWS.
- Create VPC:
aws ec2 create-vpc --cidr-block <cidr-block>
- Create Subnet:
aws ec2 create-subnet --vpc-id <vpc-id> --cidr-block <subnet-cidr-block>
- Create Security Group:
aws ec2 create-security-group --group-name <group-name> --description "Security group for my VPC" --vpc-id <vpc-id>
- Associate Security Group:
aws ec2 modify-instance-attribute --instance-id <instance-id> --groups <security-group-id>
- Delete VPC:
aws ec2 delete-vpc --vpc-id <vpc-id>
81. AWS Elastic Beanstalk Commands
AWS Elastic Beanstalk provides a platform for deploying and managing applications.
- Create Elastic Beanstalk Application:
aws elasticbeanstalk create-application --application-name <application-name> --description "My Elastic Beanstalk App"
- Create Elastic Beanstalk Environment:
aws elasticbeanstalk create-environment --application-name <application-name> --environment-name <environment-name> --solution-stack-name "64bit Amazon Linux 2 v3.1.5 running Node.js 14"
- List Elastic Beanstalk Environments:
aws elasticbeanstalk describe-environments
- Terminate Elastic Beanstalk Environment:
aws elasticbeanstalk terminate-environment --environment-name <environment-name>
82. AWS KMS (Key Management Service) Commands
AWS KMS helps create and control encryption keys for your AWS resources.
- Create KMS Key:
aws kms create-key --description "My encryption key" --key-usage ENCRYPT_DECRYPT --origin AWS_KMS
- List KMS Keys:
aws kms list-keys
- Encrypt Data with KMS Key:
aws kms encrypt --key-id <key-id> --plaintext fileb://<data-file> --output text --query CiphertextBlob
- Decrypt Data with KMS Key:
aws kms decrypt --ciphertext-blob fileb://<ciphertext-file> --output text --query Plaintext
83. AWS SQS (Simple Queue Service) Commands
AWS SQS is a fully managed message queue service that helps in decoupling and scaling microservices, distributed systems, and serverless applications.
- Create SQS Queue:
aws sqs create-queue --queue-name <queue-name>
- List SQS Queues:
aws sqs list-queues
- Send Message to SQS Queue:
aws sqs send-message --queue-url <queue-url> --message-body "Hello, World!"
- Receive Message from SQS Queue:
aws sqs receive-message --queue-url <queue-url>
- Delete SQS Queue:
aws sqs delete-queue --queue-url <queue-url>
84. AWS SNS (Simple Notification Service) Commands
AWS SNS is a fully managed service for sending notifications, messages, or alerts.
- Create SNS Topic:
aws sns create-topic --name <topic-name>
- List SNS Topics:
aws sns list-topics
- Publish Message to SNS Topic:
aws sns publish --topic-arn <topic-arn> --message "Hello from AWS SNS!"
- Subscribe to SNS Topic:
aws sns subscribe --topic-arn <topic-arn> --protocol email --notification-endpoint <email-address>
- Delete SNS Topic:
aws sns delete-topic --topic-arn <topic-arn>
85. AWS IAM (Identity and Access Management) Commands
IAM allows you to securely manage access to AWS services and resources.
- Create IAM User:
aws iam create-user --user-name <username>
- Attach IAM Policy to User:
aws iam attach-user-policy --user-name <username> --policy-arn arn:aws:iam::aws:policy/<policy-name>
- Create IAM Role:
aws iam create-role --role-name <role-name> --assume-role-policy-document file://role-trust-policy.json
- List IAM Users:
aws iam list-users
- Delete IAM User:
aws iam delete-user --user-name <username>
86. AWS Cognito Commands
Amazon Cognito provides user sign-up, sign-in, and access control to applications.
- Create Cognito User Pool:
aws cognito-idp create-user-pool --pool-name <user-pool-name>
- List Cognito User Pools:
aws cognito-idp list-user-pools --max-results 10
- Create Cognito User:
aws cognito-idp admin-create-user --user-pool-id <user-pool-id> --username <username>
- List Cognito Users:
aws cognito-idp list-users --user-pool-id <user-pool-id>
- Delete Cognito User Pool:
aws cognito-idp delete-user-pool --user-pool-id <user-pool-id>
87. AWS S3 Commands
Amazon S3 is a scalable object storage service for any type of data. Here are more S3 commands.
- Copy Object in S3:
aws s3 cp <source-path> s3://<bucket-name>/<destination-path>
- Sync S3 Bucket:
aws s3 sync s3://<source-bucket> s3://<destination-bucket>
- Delete Object in S3:
aws s3 rm s3://<bucket-name>/<object-key>
- List Objects in S3 Bucket:
aws s3 ls s3://<bucket-name> --recursive
- Make S3 Bucket Public:
aws s3api put-bucket-acl --bucket <bucket-name> --acl public-read
88. AWS EC2 Spot Instances Commands
EC2 Spot Instances allow you to request unused EC2 capacity at a discounted price.
- Request Spot Instance:
aws ec2 request-spot-instances --spot-price <price> --instance-count <count> --type "one-time" --launch-specification file://launch-spec.json
- Describe Spot Instance Requests:
aws ec2 describe-spot-instance-requests
- Cancel Spot Instance Request:
aws ec2 cancel-spot-instance-requests --spot-instance-request-ids <request-id>
89. AWS RDS (Relational Database Service) Commands
AWS RDS simplifies the setup, operation, and scaling of databases.
- Create RDS Instance:
aws rds create-db-instance --db-instance-identifier <db-instance-id> --db-instance-class db.t2.micro --engine mysql --allocated-storage 20 --master-username <username> --master-user-password <password> --vpc-security-group-ids <security-group-id>
- Describe RDS Instances:
aws rds describe-db-instances
- Delete RDS Instance:
aws rds delete-db-instance --db-instance-identifier <db-instance-id> --skip-final-snapshot
90. AWS Redshift Commands
Amazon Redshift is a fast, fully managed data warehouse.
- Create Redshift Cluster:
aws redshift create-cluster --cluster-identifier <cluster-id> --node-type dc2.large --master-username <username> --master-user-password <password> --cluster-type single-node
- Describe Redshift Clusters:
aws redshift describe-clusters
- Delete Redshift Cluster:
aws redshift delete-cluster --cluster-identifier <cluster-id> --skip-final-cluster-snapshot
91. AWS DMS (Database Migration Service) Commands
AWS DMS helps you migrate databases to AWS quickly and securely.
- Create DMS Replication Instance:
aws dms create-replication-instance --replication-instance-identifier <instance-id> --replication-instance-class dms.r5.large --allocated-storage 100
- Create DMS Replication Task:
aws dms create-replication-task --replication-task-identifier <task-id> --source-endpoint-arn <source-endpoint-arn> --target-endpoint-arn <target-endpoint-arn> --migration-type full-load --table-mappings file://table-mappings.json
- Start DMS Replication Task:
aws dms start-replication-task --replication-task-arn <task-arn> --start-replication-task-type start-replication
- Stop DMS Replication Task:
aws dms stop-replication-task --replication-task-arn <task-arn>
92. AWS EKS (Elastic Kubernetes Service) Commands
AWS EKS is a managed Kubernetes service to run Kubernetes applications.
- Create EKS Cluster:
aws eks create-cluster --name <cluster-name> --role-arn arn:aws:iam::<account-id>:role/<role-name> --resources-vpc-config subnetIds=<subnet-id>,securityGroupIds=<security-group-id>
- List EKS Clusters:
aws eks list-clusters
- Describe EKS Cluster:
aws eks describe-cluster --name <cluster-name>
- Delete EKS Cluster:
aws eks delete-cluster --name <cluster-name>
93. AWS CloudFront Commands
AWS CloudFront is a content delivery network (CDN) service.
- Create CloudFront Distribution:
aws cloudfront create-distribution --distribution-config file://distribution-config.json
- List CloudFront Distributions:
aws cloudfront list-distributions
- Invalidate CloudFront Cache:
aws cloudfront create-invalidation --distribution-id <distribution-id> --paths "/*"
- Delete CloudFront Distribution:
aws cloudfront delete-distribution --id <distribution-id> --if-match <etag>
94. AWS Lambda Layer Commands
Lambda layers are a distribution mechanism for libraries, function code, and other function dependencies.
- Publish Lambda Layer:
aws lambda publish-layer-version --layer-name <layer-name> --zip-file fileb://layer.zip --compatible-runtimes nodejs14.x
- List Lambda Layers:
aws lambda list-layers
- Delete Lambda Layer:
aws lambda delete-layer-version --layer-name <layer-name> --version-number <version-number>
95. AWS Athena Commands
AWS Athena allows you to query data directly in Amazon S3 using SQL.
- Start Athena Query:
aws athena start-query-execution --query-string "SELECT * FROM <table-name>" --query-execution-context Database=<database-name> --result-configuration OutputLocation=s3://<bucket-name>/output/
- List Athena Query Executions:
aws athena list-query-executions
- Get Athena Query Results:
aws athena get-query-results --query-execution-id <query-id>
96. AWS ElasticSearch Service Commands
Amazon Elasticsearch is a search engine service based on open-source Elasticsearch.
- Create Elasticsearch Domain:
aws es create-domain --domain-name <domain-name> --elasticsearch-version 7.10
- List Elasticsearch Domains:
aws es list-domain-names
- Delete Elasticsearch Domain:
aws es delete-domain --domain-name <domain-name>
97. AWS Systems Manager Commands
AWS Systems Manager provides operational insights into your infrastructure and applications.
- Create Systems Manager Parameter:
aws ssm put-parameter --name <parameter-name> --value <parameter-value> --type String
- List Systems Manager Parameters:
aws ssm describe-parameters
- Get Systems Manager Parameter:
aws ssm get-parameter --name <parameter-name>
- Delete Systems Manager Parameter:
aws ssm delete-parameter --name <parameter-name>
- Run Command on EC2 Instances:
aws ssm send-command --instance-ids <instance-id> --document-name "AWS-RunShellScript" --parameters 'commands=["<command-to-run>"]'
98. AWS Lambda Commands
AWS Lambda lets you run code in response to triggers such as changes in data or system events.
- Create Lambda Function:
aws lambda create-function --function-name <function-name> --runtime nodejs14.x --role arn:aws:iam::<account-id>:role/<role-name> --handler index.handler --zip-file fileb://function.zip
- Invoke Lambda Function:
aws lambda invoke --function-name <function-name> output.txt
- List Lambda Functions:
aws lambda list-functions
- Update Lambda Function Code:
aws lambda update-function-code --function-name <function-name> --zip-file fileb://new-function.zip
- Delete Lambda Function:
aws lambda delete-function --function-name <function-name>
99. AWS CloudWatch Logs Commands
AWS CloudWatch allows you to monitor, store, and access log files from various AWS services.
- Create Log Group:
aws logs create-log-group --log-group-name <log-group-name>
- Create Log Stream:
aws logs create-log-stream --log-group-name <log-group-name> --log-stream-name <log-stream-name>
- Put Log Events:
aws logs put-log-events --log-group-name <log-group-name> --log-stream-name <log-stream-name> --log-events timestamp=<timestamp>,message="Log entry message"
- Describe Log Groups:
aws logs describe-log-groups
- Describe Log Streams:
aws logs describe-log-streams --log-group-name <log-group-name>
100. AWS CloudTrail Commands
AWS CloudTrail provides governance, compliance, and operational and risk auditing of your AWS account activity.
- Create CloudTrail:
aws cloudtrail create-trail --name <trail-name> --s3-bucket-name <s3-bucket-name> --is-multi-region-trail
- Start CloudTrail Logging:
aws cloudtrail start-logging --name <trail-name>
- Stop CloudTrail Logging:
aws cloudtrail stop-logging --name <trail-name>
- Describe CloudTrail:
aws cloudtrail describe-trails
- Get CloudTrail Event History:
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=<event-name>
101. AWS Elastic Load Balancer (ELB) Commands
Elastic Load Balancing (ELB) automatically distributes incoming traffic across multiple targets, such as EC2 instances.
- Create Application Load Balancer:
aws elbv2 create-load-balancer --name <load-balancer-name> --subnets <subnet-id> --security-groups <security-group-id> --scheme internet-facing --load-balancer-type application
- List Load Balancers:
aws elbv2 describe-load-balancers
- Create Target Group:
aws elbv2 create-target-group --name <target-group-name> --protocol HTTP --port 80 --vpc-id <vpc-id>
- Register Targets with Target Group:
aws elbv2 register-targets --target-group-arn <target-group-arn> --targets Id=<instance-id>
- Delete Load Balancer:
aws elbv2 delete-load-balancer --load-balancer-arn <load-balancer-arn>
102. AWS CloudFormation Stack Commands
CloudFormation is a service that helps you model and set up your AWS resources so that you can spend less time managing those resources and more time focusing on your applications.
- Create CloudFormation Stack:
aws cloudformation create-stack --stack-name <stack-name> --template-body file://template.json
- Describe CloudFormation Stacks:
aws cloudformation describe-stacks
- Update CloudFormation Stack:
aws cloudformation update-stack --stack-name <stack-name> --template-body file://updated-template.json
- Delete CloudFormation Stack:
aws cloudformation delete-stack --stack-name <stack-name>
- List CloudFormation Stack Resources:
aws cloudformation list-stack-resources --stack-name <stack-name>
103. AWS Auto Scaling Commands
Auto Scaling helps you ensure that you have the right number of EC2 instances available to handle the load for your application.
- Create Auto Scaling Group:
aws autoscaling create-auto-scaling-group --auto-scaling-group-name <group-name> --min-size 1 --max-size 3 --desired-capacity 2 --launch-configuration-name <launch-config-name> --vpc-zone-identifier <subnet-id>
- Describe Auto Scaling Groups:
aws autoscaling describe-auto-scaling-groups
- Update Auto Scaling Group:
aws autoscaling update-auto-scaling-group --auto-scaling-group-name <group-name> --desired-capacity 3
- Delete Auto Scaling Group:
aws autoscaling delete-auto-scaling-group --auto-scaling-group-name <group-name> --force-delete
104. AWS Elastic Beanstalk Commands
AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services.
- Create Elastic Beanstalk Application:
aws elasticbeanstalk create-application --application-name <application-name>
- Create Elastic Beanstalk Environment:
aws elasticbeanstalk create-environment --application-name <application-name> --environment-name <environment-name> --solution-stack-name "64bit Amazon Linux 2 v3.3.6 running Node.js 14"
- List Elastic Beanstalk Applications:
aws elasticbeanstalk describe-applications
- Terminate Elastic Beanstalk Environment:
aws elasticbeanstalk terminate-environment --environment-name <environment-name>
105. AWS ECR (Elastic Container Registry) Commands
Amazon ECR is a fully managed Docker container registry that makes it easy for developers to store, manage, and deploy Docker container images.
- Create ECR Repository:
aws ecr create-repository --repository-name <repository-name>
- List ECR Repositories:
aws ecr describe-repositories
- Push Docker Image to ECR:
aws ecr get-login-password --region <region> | docker login --username AWS --password-stdin <aws-account-id>.dkr.ecr.<region>.amazonaws.com
docker tag <image-id> <aws-account-id>.dkr.ecr.<region>.amazonaws.com/<repository-name>:<tag>
docker push <aws-account-id>.dkr.ecr.<region>.amazonaws.com/<repository-name>:<tag>
- Delete ECR Repository:
aws ecr delete-repository --repository-name <repository-name> --force
106. AWS Glue Commands
AWS Glue is a fully managed ETL service that makes it easy for you to prepare and load your data for analytics.
- Create Glue Crawler:
aws glue create-crawler --name <crawler-name> --role <iam-role-arn> --database-name <database-name> --targets s3Targets=[{path="s3://<bucket-name>/"}]
- Start Glue Crawler:
aws glue start-crawler --name <crawler-name>
- Describe Glue Crawler:
aws glue get-crawler --name <crawler-name>
- Delete Glue Crawler:
aws glue delete-crawler --name <crawler-name>
107. AWS RDS (Relational Database Service) Commands
AWS RDS makes it easy to set up, operate, and scale relational databases in the cloud.
- Create RDS Instance:
aws rds create-db-instance --db-instance-identifier <instance-id> --db-instance-class db.t3.micro --engine mysql --master-username <username> --master-user-password <password> --allocated-storage 20
- Describe RDS Instances:
aws rds describe-db-instances
- Modify RDS Instance:
aws rds modify-db-instance --db-instance-identifier <instance-id> --allocated-storage 30 --apply-immediately
- Delete RDS Instance:
aws rds delete-db-instance --db-instance-identifier <instance-id> --skip-final-snapshot
- Reboot RDS Instance:
aws rds reboot-db-instance --db-instance-identifier <instance-id>
108. AWS DynamoDB Commands
AWS DynamoDB is a fully managed NoSQL database that provides fast and predictable performance.
- Create DynamoDB Table:
aws dynamodb create-table --table-name <table-name> --attribute-definitions AttributeName=<primary-key>,AttributeType=S --key-schema AttributeName=<primary-key>,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
- Describe DynamoDB Table:
aws dynamodb describe-table --table-name <table-name>
- Put Item in DynamoDB Table:
aws dynamodb put-item --table-name <table-name> --item '{"<primary-key>": {"S": "<value>"}, "<attribute>": {"S": "<value>"}}'
- Update Item in DynamoDB Table:
aws dynamodb update-item --table-name <table-name> --key '{"<primary-key>": {"S": "<value>"}}' --update-expression "SET <attribute> = :val" --expression-attribute-values '{":val": {"S": "<new-value>"}}'
- Delete Item from DynamoDB Table:
aws dynamodb delete-item --table-name <table-name> --key '{"<primary-key>": {"S": "<value>"}}'
109. AWS SQS (Simple Queue Service) Commands
AWS SQS is a fully managed message queuing service that enables decoupling of microservices.
- Create SQS Queue:
aws sqs create-queue --queue-name <queue-name>
- List SQS Queues:
aws sqs list-queues
- Send Message to SQS Queue:
aws sqs send-message --queue-url <queue-url> --message-body "Message content"
- Receive Message from SQS Queue:
aws sqs receive-message --queue-url <queue-url> --max-number-of-messages 1
- Delete Message from SQS Queue:
aws sqs delete-message --queue-url <queue-url> --receipt-handle <receipt-handle>
110. AWS SNS (Simple Notification Service) Commands
AWS SNS is a fully managed messaging service that allows you to send messages to a large number of subscribers.
- Create SNS Topic:
aws sns create-topic --name <topic-name>
- List SNS Topics:
aws sns list-topics
- Publish Message to SNS Topic:
aws sns publish --topic-arn <topic-arn> --message "Message content"
- Subscribe to SNS Topic:
aws sns subscribe --topic-arn <topic-arn> --protocol email --notification-endpoint <email-address>
- Unsubscribe from SNS Topic:
aws sns unsubscribe --subscription-arn <subscription-arn>
111. AWS CloudFront Commands
Amazon CloudFront is a fast content delivery network (CDN) service.
- Create CloudFront Distribution:
aws cloudfront create-distribution --origin-domain-name <origin-domain-name> --default-root-object index.html
- List CloudFront Distributions:
aws cloudfront list-distributions
- Get CloudFront Distribution Details:
aws cloudfront get-distribution --id <distribution-id>
- Update CloudFront Distribution:
aws cloudfront update-distribution --id <distribution-id> --if-match <etag> --distribution-config file://config.json
- Delete CloudFront Distribution:
aws cloudfront delete-distribution --id <distribution-id>
112. AWS Kinesis Commands
AWS Kinesis is a platform for real-time data streaming.
- Create Kinesis Stream:
aws kinesis create-stream --stream-name <stream-name> --shard-count 1
- Describe Kinesis Stream:
aws kinesis describe-stream --stream-name <stream-name>
- Put Record in Kinesis Stream:
aws kinesis put-record --stream-name <stream-name> --partition-key <partition-key> --data "Record data"
- Get Records from Kinesis Stream:
aws kinesis get-records --shard-iterator <shard-iterator>
- Delete Kinesis Stream:
aws kinesis delete-stream --stream-name <stream-name>
113. AWS Elasticache Commands
AWS Elasticache provides an in-memory data store service.
- Create Elasticache Cluster:
aws elasticache create-cache-cluster --cache-cluster-id <cluster-id> --engine redis --cache-node-type cache.t3.micro --num-cache-nodes 1
- Describe Elasticache Cluster:
aws elasticache describe-cache-clusters --cache-cluster-id <cluster-id>
- Delete Elasticache Cluster:
aws elasticache delete-cache-cluster --cache-cluster-id <cluster-id>
- Modify Elasticache Cluster:
aws elasticache modify-cache-cluster --cache-cluster-id <cluster-id> --num-cache-nodes 2 --apply-immediately
114. AWS Route 53 Commands
AWS Route 53 is a scalable DNS and domain registration service.
- Create Route 53 Hosted Zone:
aws route53 create-hosted-zone --name <domain-name> --caller-reference <unique-id>
- List Route 53 Hosted Zones:
aws route53 list-hosted-zones
- Create Route 53 Record Set:
aws route53 change-resource-record-sets --hosted-zone-id <zone-id> --change-batch file://changes.json
- Delete Route 53 Record Set:
aws route53 change-resource-record-sets --hosted-zone-id <zone-id> --change-batch file://delete-change.json
115. AWS Direct Connect Commands
AWS Direct Connect enables you to establish a dedicated network connection from your premises to AWS.
- Create Direct Connect Connection:
aws directconnect create-connection --location <location> --bandwidth 1Gbps --connection-name <connection-name>
- Describe Direct Connect Connections:
aws directconnect describe-connections
- Delete Direct Connect Connection:
aws directconnect delete-connection --connection-id <connection-id>
116. AWS VPC Commands
AWS VPC allows you to provision a logically isolated section of the AWS cloud.
- Create VPC:
aws ec2 create-vpc --cidr-block 10.0.0.0/16
- Describe VPCs:
aws ec2 describe-vpcs
- Create Subnet:
aws ec2 create-subnet --vpc-id <vpc-id> --cidr-block 10.0.1.0/24
- Create Internet Gateway:
aws ec2 create-internet-gateway
- Attach Internet Gateway to VPC:
aws ec2 attach-internet-gateway --vpc-id <vpc-id> --internet-gateway-id <internet-gateway-id>
--image-id --elastic-inference-accelerators Type=ei.medium
- **Describe Elastic Inference Accelerators**:
aws ec2 describe-elastic-inference-accelerators
### **129. AWS Backup Commands**
AWS Backup simplifies data protection by automating backup processes.
- **Create Backup Plan**:
aws backup create-backup-plan --backup-plan file://backup-plan.json
- **List Backup Plans**:
aws backup list-backup-plans
- **Start Backup Job**:
aws backup start-backup-job --backup-vault-name --resource-arn
- **List Backup Jobs**:
aws backup list-backup-jobs
- **Delete Backup Plan**:
aws backup delete-backup-plan --backup-plan-id
---
### **130. AWS Systems Manager Session Manager Commands**
Session Manager provides secure and auditable access to EC2 instances.
- **Start a Session**:
aws ssm start-session --target
- **List Active Sessions**:
aws ssm describe-sessions --state Active
- **Terminate Session**:
aws ssm terminate-session --session-id
---
### **131. AWS EMR (Elastic MapReduce) Commands**
AWS EMR simplifies running big data frameworks.
- **Create EMR Cluster**:
aws emr create-cluster --name --release-label --applications Name=Hadoop Name=Spark --ec2-attributes SubnetId= --instance-type m5.xlarge --instance-count 3
- **List EMR Clusters**:
aws emr list-clusters
- **Terminate EMR Cluster**:
aws emr terminate-clusters --cluster-ids
---
### **132. AWS Step Functions Commands**
Step Functions manage application workflows.
- **Create State Machine**:
aws stepfunctions create-state-machine --name --role-arn --definition file://state-machine-definition.json
- **Start Execution**:
aws stepfunctions start-execution --state-machine-arn
- **List Executions**:
aws stepfunctions list-executions --state-machine-arn
- **Stop Execution**:
aws stepfunctions stop-execution --execution-arn
---
### **133. AWS Global Accelerator Commands**
Global Accelerator provides low-latency routing for global applications.
- **Create Global Accelerator**:
aws globalaccelerator create-accelerator --name --ip-address-type IPV4 --enabled
- **List Accelerators**:
aws globalaccelerator list-accelerators
- **Delete Global Accelerator**:
aws globalaccelerator delete-accelerator --accelerator-arn
---
### **134. AWS S3 Glacier Commands**
Amazon S3 Glacier is used for data archiving.
- **Create Glacier Vault**:
aws glacier create-vault --vault-name
- **List Glacier Vaults**:
aws glacier list-vaults
- **Delete Glacier Vault**:
aws glacier delete-vault --vault-name
- **Initiate Glacier Archive Retrieval**:
aws glacier initiate-job --vault-name --job-parameters '{"Type": "archive-retrieval", "ArchiveId": ""}'
---
### **135. AWS Macie Commands**
Amazon Macie helps identify sensitive data in your environment.
- **Enable Macie**:
aws macie2 enable-macie
- **Create Macie Classification Job**:
aws macie2 create-classification-job --job-type SCHEDULED --name --s3-job-definition '{"bucketDefinitions": [{"accountId": "", "buckets": [""]}]}'
- **List Macie Jobs**:
aws macie2 list-classification-jobs
- **Disable Macie**:
aws macie2 disable-macie
---
### **136. AWS AppSync Commands**
AppSync manages GraphQL APIs.
- **Create AppSync API**:
aws appsync create-graphql-api --name --authentication-type API_KEY
- **List AppSync APIs**:
aws appsync list-graphql-apis
- **Delete AppSync API**:
aws appsync delete-graphql-api --api-id
---
### **137. AWS Ground Station Commands**
AWS Ground Station enables satellite communications.
- **Reserve Contact**:
aws groundstation reserve-contact --mission-profile-arn --satellite-arn --start-time --end-time --ground-station
- **List Contacts**:
aws groundstation list-contacts --status AVAILABLE
- **Cancel Contact**:
aws groundstation cancel-contact --contact-id
---
### **138. AWS Connect Commands**
Amazon Connect is a cloud-based call center service.
- **Create Amazon Connect Instance**:
aws connect create-instance --identity-management-type SAML --instance-storage-configurations file://config.json
- **List Connect Instances**:
aws connect list-instances
- **Delete Amazon Connect Instance**:
aws connect delete-instance --instance-id
---
### **139. AWS Elemental MediaStore Commands**
MediaStore provides storage for media workflows.
- **Create MediaStore Container**:
aws mediastore create-container --container-name
- **Describe MediaStore Containers**:
aws mediastore list-containers
- **Delete MediaStore Container**:
aws mediastore delete-container --container-name
---
### **140. AWS IoT Greengrass Commands**
IoT Greengrass manages edge devices.
- **Create Greengrass Group**:
aws greengrass create-group --name
- **List Greengrass Groups**:
aws greengrass list-groups
- **Delete Greengrass Group**:
aws greengrass delete-group --group-id
### **141. AWS DataSync Commands**
AWS DataSync simplifies the transfer of data between on-premises storage and AWS.
- **Create DataSync Task**:
aws datasync create-task --source-location-arn --destination-location-arn
- **Start DataSync Task**:
aws datasync start-task-execution --task-arn
- **List DataSync Tasks**:
aws datasync list-tasks
- **Delete DataSync Task**:
aws datasync delete-task --task-arn
---
### **142. AWS Outposts Commands**
AWS Outposts brings AWS services on-premises.
- **List Outposts**:
aws outposts list-outposts
- **Describe Outpost**:
aws outposts get-outpost --outpost-id
- **Create Order for Outpost**:
aws outposts create-order --outpost-id --line-items
- **List Outpost Sites**:
aws outposts list-sites
---
### **143. AWS WorkSpaces Commands**
Amazon WorkSpaces provides virtual desktops.
- **Create WorkSpace**:
aws workspaces create-workspaces --workspaces '{"DirectoryId": "", "UserName": "", "BundleId": "", "VolumeEncryptionKey": ""}'
- **List WorkSpaces**:
aws workspaces describe-workspaces
- **Reboot WorkSpace**:
aws workspaces reboot-workspaces --reboot-workspace-requests '{"WorkspaceId": ""}'
- **Delete WorkSpace**:
aws workspaces terminate-workspaces --terminate-workspace-requests '{"WorkspaceId": ""}'
---
### **144. AWS Rekognition Commands**
Amazon Rekognition provides image and video analysis.
- **Detect Labels in Image**:
aws rekognition detect-labels --image '{"S3Object":{"Bucket":"","Name":""}}' --max-labels 10 --min-confidence 75
- **Compare Faces**:
aws rekognition compare-faces --source-image '{"S3Object":{"Bucket":"","Name":""}}' --target-image '{"S3Object":{"Bucket":"","Name":""}}'
- **List Rekognition Collections**:
aws rekognition list-collections
- **Delete Rekognition Collection**:
aws rekognition delete-collection --collection-id
---
### **145. AWS Elastic Transcoder Commands**
AWS Elastic Transcoder processes media files.
- **Create Elastic Transcoder Pipeline**:
aws elastictranscoder create-pipeline --name --input-bucket --output-bucket --role
- **List Transcoder Pipelines**:
aws elastictranscoder list-pipelines
- **Create Transcoder Job**:
aws elastictranscoder create-job --pipeline-id --input '{"Key":""}' --output '{"Key":"", "PresetId":""}'
- **Delete Transcoder Pipeline**:
aws elastictranscoder delete-pipeline --id
---
### **146. AWS FSx Commands**
Amazon FSx provides file systems optimized for specific workloads.
- **Create FSx File System**:
aws fsx create-file-system --file-system-type WINDOWS --storage-capacity 300 --subnet-ids
- **Describe FSx File Systems**:
aws fsx describe-file-systems
- **Delete FSx File System**:
aws fsx delete-file-system --file-system-id
---
### **147. AWS Lake Formation Commands**
AWS Lake Formation simplifies building and managing data lakes.
- **Create Data Lake Settings**:
aws lakeformation put-data-lake-settings --data-lake-settings
- **List Data Lake Permissions**:
aws lakeformation list-permissions
- **Grant Lake Formation Permissions**:
aws lakeformation grant-permissions --principal --permissions
- **Revoke Lake Formation Permissions**:
aws lakeformation revoke-permissions --principal --permissions
---
### **148. AWS IoT SiteWise Commands**
IoT SiteWise manages industrial IoT data.
- **Create Asset Model**:
aws iotsitewise create-asset-model --asset-model-name --asset-model-description "" --asset-model-properties
- **List Asset Models**:
aws iotsitewise list-asset-models
- **Delete Asset Model**:
aws iotsitewise delete-asset-model --asset-model-id
---
### **149. AWS SageMaker Edge Manager Commands**
SageMaker Edge Manager enables edge device machine learning.
- **Create Edge Packaging Job**:
aws sagemaker create-edge-packaging-job --edge-packaging-job-name --model-name --output-config
- **List Edge Packaging Jobs**:
aws sagemaker list-edge-packaging-jobs
- **Describe Edge Packaging Job**:
aws sagemaker describe-edge-packaging-job --edge-packaging-job-name
---
### **150. AWS Health Dashboard Commands**
AWS Health provides personalized information about service disruptions.
- **Describe Events**:
aws health describe-events --filter
- **Describe Event Details**:
aws health describe-event-details --event-arns
- **Describe Event Aggregates**:
aws health describe-event-aggregates --aggregate-field
### **151. AWS AppRunner Commands**
AWS AppRunner simplifies deploying containerized web applications.
- **Create AppRunner Service**:
aws apprunner create-service --service-name --source-configuration
- **List AppRunner Services**:
aws apprunner list-services
- **Update AppRunner Service**:
aws apprunner update-service --service-arn --source-configuration
- **Delete AppRunner Service**:
aws apprunner delete-service --service-arn
---
### **152. AWS Amplify Commands**
AWS Amplify simplifies front-end and mobile app development.
- **Create Amplify App**:
aws amplify create-app --name
- **List Amplify Apps**:
aws amplify list-apps
- **Start Deployment**:
aws amplify start-deployment --app-id --branch-name --source-url
- **Delete Amplify App**:
aws amplify delete-app --app-id
---
### **153. AWS QuickSight Commands**
AWS QuickSight provides business intelligence dashboards.
- **Create QuickSight Group**:
aws quicksight create-group --aws-account-id --namespace default --group-name
- **List QuickSight Groups**:
aws quicksight list-groups --aws-account-id --namespace default
- **Describe Dashboard**:
aws quicksight describe-dashboard --aws-account-id --dashboard-id
- **Delete QuickSight Dashboard**:
aws quicksight delete-dashboard --aws-account-id --dashboard-id
---
### **154. AWS Proton Commands**
AWS Proton manages infrastructure and application code deployments.
- **Create Proton Service Template**:
aws proton create-service-template --name --description "" --pipeline-provisioning
- **List Proton Services**:
aws proton list-services
- **Update Proton Service**:
aws proton update-service --name --template-name
- **Delete Proton Service Template**:
aws proton delete-service-template --name
---
### **155. AWS EKS Anywhere Commands**
EKS Anywhere provides Kubernetes clusters on premises.
- **Create EKS Anywhere Cluster**:
aws eks-anywhere create-cluster --name --config
- **List EKS Anywhere Clusters**:
aws eks-anywhere list-clusters
- **Update EKS Anywhere Cluster**:
aws eks-anywhere update-cluster --name --config
- **Delete EKS Anywhere Cluster**:
aws eks-anywhere delete-cluster --name
---
### **156. AWS MWAA (Managed Workflows for Apache Airflow) Commands**
MWAA manages workflows with Apache Airflow.
- **Create MWAA Environment**:
aws mwaa create-environment --name --dag-s3-path --requirements-s3-path
- **List MWAA Environments**:
aws mwaa list-environments
- **Get MWAA Environment Details**:
aws mwaa get-environment --name
- **Delete MWAA Environment**:
aws mwaa delete-environment --name
---
### **157. AWS CodeCatalyst Commands**
AWS CodeCatalyst is an integrated development environment for collaboration.
- **Create a CodeCatalyst Space**:
aws codecatalyst create-space --name
- **List CodeCatalyst Spaces**:
aws codecatalyst list-spaces
- **Create CodeCatalyst Project**:
aws codecatalyst create-project --name --space-name
- **Delete CodeCatalyst Space**:
aws codecatalyst delete-space --name
---
### **158. AWS Pinpoint Commands**
AWS Pinpoint manages targeted messaging and analytics.
- **Create Pinpoint App**:
aws pinpoint create-app --create-application-request '{"Name": ""}'
- **Send Pinpoint Email Message**:
aws pinpoint send-messages --application-id --message-request file://message-request.json
- **List Pinpoint Apps**:
aws pinpoint list-applications
- **Delete Pinpoint App**:
aws pinpoint delete-app --application-id
---
### **159. AWS AppFlow Commands**
AWS AppFlow automates data flow between AWS and SaaS applications.
- **Create AppFlow Flow**:
aws appflow create-flow --flow-name --trigger-config '{"triggerType": "OnDemand"}' --source-flow-config --destination-flow-config-list
- **Start AppFlow Flow**:
aws appflow start-flow --flow-name
- **List AppFlow Flows**:
aws appflow list-flows
- **Delete AppFlow Flow**:
aws appflow delete-flow --flow-name
---
### **160. AWS Elemental MediaConvert Commands**
MediaConvert encodes and converts media files.
- **Create MediaConvert Job**:
aws mediaconvert create-job --role --settings file://settings.json
- **List MediaConvert Jobs**:
aws mediaconvert list-jobs
- **Get MediaConvert Job Details**:
aws mediaconvert get-job --id
- **Cancel MediaConvert Job**:
aws mediaconvert cancel-job --id
Here are even more AWS CLI commands, diving into advanced and less commonly used AWS services:
---
### **161. AWS AppConfig Commands**
AWS AppConfig helps with configuration management for applications.
- **Create Configuration Profile**:
aws appconfig create-configuration-profile --application-id --name --location-uri
- **List Configuration Profiles**:
aws appconfig list-configuration-profiles --application-id
- **Deploy Configuration**:
aws appconfig start-deployment --application-id --environment-id --configuration-profile-id --configuration-version
- **Stop Deployment**:
aws appconfig stop-deployment --deployment-id
---
### **162. AWS Backup Commands**
AWS Backup centralizes and automates data backup across AWS services.
- **Create Backup Plan**:
aws backup create-backup-plan --backup-plan file://backup-plan.json
- **List Backup Plans**:
aws backup list-backup-plans
- **Start Backup Job**:
aws backup start-backup-job --backup-vault-name --resource-arn --iam-role-arn
- **Delete Backup Plan**:
aws backup delete-backup-plan --backup-plan-id
---
### **163. AWS CodeStar Commands**
AWS CodeStar provides tools for managing software development projects.
- **Create CodeStar Project**:
aws codestar create-project --id --name --description "" --toolchain file://toolchain.json
- **List CodeStar Projects**:
aws codestar list-projects
- **Associate Team Member**:
aws codestar associate-team-member --project-id --user-arn --project-role
- **Delete CodeStar Project**:
aws codestar delete-project --id
---
### **164. AWS IoT Analytics Commands**
AWS IoT Analytics processes and analyzes IoT data.
- **Create IoT Analytics Channel**:
aws iotanalytics create-channel --channel-name
- **List IoT Analytics Channels**:
aws iotanalytics list-channels
- **Start IoT Analytics Pipeline**:
aws iotanalytics start-pipeline-reprocessing --pipeline-name
- **Delete IoT Analytics Channel**:
aws iotanalytics delete-channel --channel-name
---
### **165. AWS Batch Commands**
AWS Batch runs batch computing workloads.
- **Create Batch Job Queue**:
aws batch create-job-queue --job-queue-name --state ENABLED --priority 1 --compute-environment-order
- **Submit Batch Job**:
aws batch submit-job --job-name --job-queue --job-definition
- **List Batch Jobs**:
aws batch list-jobs --job-queue
- **Terminate Batch Job**:
aws batch terminate-job --job-id --reason ""
---
### **166. AWS Fraud Detector Commands**
AWS Fraud Detector identifies fraudulent activities.
- **Create Fraud Detector Model**:
aws frauddetector create-model --model-id --model-type ONLINE_FRAUD_INSIGHTS --event-type-name
- **List Fraud Detector Models**:
aws frauddetector get-models
- **Create Event Detector**:
aws frauddetector create-event --event-id --event-type-name --event-timestamp --entities
- **Delete Fraud Detector Model**:
aws frauddetector delete-model --model-id
---
### **167. AWS Service Catalog Commands**
AWS Service Catalog manages catalogs of IT services.
- **Create Portfolio**:
aws servicecatalog create-portfolio --name --provider-name
- **List Portfolios**:
aws servicecatalog list-portfolios
- **Add Product to Portfolio**:
aws servicecatalog associate-product-with-portfolio --product-id --portfolio-id
- **Delete Portfolio**:
aws servicecatalog delete-portfolio --id
---
### **168. AWS CodeGuru Commands**
AWS CodeGuru provides automated code reviews and performance insights.
- **Create CodeGuru Repository Association**:
aws codeguru-reviewer associate-repository --repository '{"Name":"","Type":""}'
- **List Repository Associations**:
aws codeguru-reviewer list-repository-associations
- **Request Code Review**:
aws codeguru-reviewer create-code-review --name --repository-association-arn --type PullRequest
- **Delete Repository Association**:
aws codeguru-reviewer disassociate-repository --association-arn
---
### **169. AWS Kinesis Video Streams Commands**
AWS Kinesis Video Streams streams video from connected devices.
- **Create Kinesis Video Stream**:
aws kinesisvideo create-stream --stream-name --data-retention-in-hours 24
- **List Kinesis Video Streams**:
aws kinesisvideo list-streams
- **Get Video Stream Info**:
aws kinesisvideo describe-stream --stream-name
- **Delete Kinesis Video Stream**:
aws kinesisvideo delete-stream --stream-name
---
### **170. AWS Resource Groups Commands**
AWS Resource Groups organizes resources.
- **Create Resource Group**:
aws resource-groups create-group --name --resource-query file://query.json
- **List Resource Groups**:
aws resource-groups list-groups
- **Get Group Resources**:
aws resource-groups get-group-resources --group-name
- **Delete Resource Group**:
aws resource-groups delete-group --group-name
Here are additional AWS CLI commands that expand into further AWS services and use cases:
---
### **171. AWS CloudSearch Commands**
AWS CloudSearch manages scalable search solutions.
- **Create Search Domain**:
aws cloudsearch create-domain --domain-name
- **List Search Domains**:
aws cloudsearch list-domain-names
- **Index Documents**:
aws cloudsearch index-documents --domain-name
- **Delete Search Domain**:
aws cloudsearch delete-domain --domain-name
---
### **172. AWS IoT Core Commands**
AWS IoT Core connects IoT devices to the cloud.
- **Create IoT Thing**:
aws iot create-thing --thing-name
- **List IoT Things**:
aws iot list-things
- **Attach IoT Policy**:
aws iot attach-policy --policy-name --target
- **Delete IoT Thing**:
aws iot delete-thing --thing-name
---
### **173. AWS Lake Formation Commands**
AWS Lake Formation simplifies data lake creation and management.
- **Create Data Lake**:
aws lakeformation create-data-lake-settings --data-lake-settings file://lake-settings.json
- **Grant Permissions**:
aws lakeformation grant-permissions --principal DataLakePrincipalIdentifier= --permissions --resource file://resource.json
- **List Data Lake Resources**:
aws lakeformation list-resources
- **Deregister Data Lake Resource**:
aws lakeformation deregister-resource --resource-arn
---
### **174. AWS Elastic Transcoder Commands**
Elastic Transcoder encodes media files.
- **Create Transcoding Pipeline**:
aws elastictranscoder create-pipeline --name --input-bucket --output-bucket --role
- **List Transcoding Pipelines**:
aws elastictranscoder list-pipelines
- **Create Transcoding Job**:
aws elastictranscoder create-job --pipeline-id --input file://input.json --output file://output.json
- **Delete Transcoding Pipeline**:
aws elastictranscoder delete-pipeline --id
---
### **175. AWS OpsWorks Commands**
AWS OpsWorks automates configuration management with Chef/Puppet.
- **Create OpsWorks Stack**:
aws opsworks create-stack --name --region --service-role-arn --default-instance-profile-arn
- **List OpsWorks Stacks**:
aws opsworks describe-stacks
- **Add OpsWorks Instance**:
aws opsworks create-instance --stack-id --layer-ids --instance-type
- **Delete OpsWorks Stack**:
aws opsworks delete-stack --stack-id
---
### **176. AWS Elastic Beanstalk Commands**
Elastic Beanstalk deploys web applications.
- **Create Elastic Beanstalk Application**:
aws elasticbeanstalk create-application --application-name
- **List Elastic Beanstalk Environments**:
aws elasticbeanstalk describe-environments
- **Deploy New Version**:
aws elasticbeanstalk create-application-version --application-name --version-label --source-bundle S3Bucket=,S3Key=
- **Terminate Elastic Beanstalk Environment**:
aws elasticbeanstalk terminate-environment --environment-name
---
### **177. AWS Step Functions Commands**
AWS Step Functions orchestrate workflows.
- **Create Step Functions State Machine**:
aws stepfunctions create-state-machine --name --role-arn --definition file://state-machine-definition.json
- **List State Machines**:
aws stepfunctions list-state-machines
- **Start Execution**:
aws stepfunctions start-execution --state-machine-arn --input file://input.json
- **Delete State Machine**:
aws stepfunctions delete-state-machine --state-machine-arn
---
### **178. AWS Transit Gateway Commands**
AWS Transit Gateway connects VPCs and on-premises networks.
- **Create Transit Gateway**:
aws ec2 create-transit-gateway --description ""
- **List Transit Gateways**:
aws ec2 describe-transit-gateways
- **Attach VPC to Transit Gateway**:
aws ec2 create-transit-gateway-vpc-attachment --transit-gateway-id --vpc-id --subnet-ids
- **Delete Transit Gateway**:
aws ec2 delete-transit-gateway --transit-gateway-id
---
### **179. AWS Outposts Commands**
AWS Outposts delivers AWS services to on-premises locations.
- **List Outposts**:
aws outposts list-outposts
- **Create Outpost**:
aws outposts create-outpost --name --site-id --availability-zone
- **List Outpost Instances**:
aws outposts list-instances --outpost-id
- **Delete Outpost**:
aws outposts delete-outpost --outpost-id
---
### **180. AWS Rekognition Commands**
AWS Rekognition provides image and video analysis.
- **Detect Faces in Image**:
aws rekognition detect-faces --image '{"S3Object":{"Bucket":"","Name":""}}'
- **Detect Labels in Image**:
aws rekognition detect-labels --image '{"S3Object":{"Bucket":"","Name":""}}'
- **Start Video Analysis**:
aws rekognition start-label-detection --video '{"S3Object":{"Bucket":"","Name":""}}'
- **Delete Rekognition Collection**:
aws rekognition delete-collection --collection-id
---
### **Conclusion**
The AWS CLI provides a robust and efficient way to manage AWS resources through the command line. It’s a versatile tool for developers and system administrators to automate tasks, script infrastructure management, and interact with a wide range of AWS services.
By mastering the AWS CLI commands provided above, you can streamline your AWS resource management and enhance your productivity in the cloud.
---
Top comments (0)