MOCs
- Overview
- Tips and Tricks
- Installation
- Configuration
- EC2 Management
- S3 Operations
- IAM Management
- RDS Operations
- Lambda Functions
- CloudFormation
- CloudWatch
Overview
The AWS CLI is an open-source tool that enables you to interact with AWS services using commands in your command-line shell. With minimal configuration, the AWS CLI enables you to start running commands that implement functionality equivalent to that provided by the browser-based AWS Management Console.
Documenation
For detailed installation instructions for various platforms, refer to the official AWS CLI documentation.
Tips and Tricks
- Using Profiles for Multiple Accounts:
If you manage multiple AWS accounts, you can configure named profiles for each.
- Specifying Output Formats:
You can specify the output format for the commands. The default is JSON, but you can also specify text or table.
Installation
AWS CLI can be installed using pip, the Python package manager, or by downloading and running the installer from AWS.
Configuration
Before you can run any commands, you need to configure the AWS CLI with your credentials.
This command prompts you for four pieces of information:
- AWS Access Key ID
- AWS Secret Access Key
- Default region name
- Default output format
EC2 Management
- List EC2 Instances:
- Start an EC2 Instance:
- Stop an EC2 Instance:
S3 Operations
- List S3 Buckets:
- Copy File to S3 Bucket:
- Download File from S3 Bucket:
IAM Management
- List IAM Users:
- Create IAM User:
RDS Operations
- List RDS Instances:
- Create RDS Instance:
Lambda Functions
- List Lambda Functions:
- Create Lambda Function:
CloudFormation
- List CloudFormation Stacks:
- Create CloudFormation Stack:
CloudWatch
- List CloudWatch Alarms:
- Put CloudWatch Metric Alarm: