AWS CLI
- AWS CLI is a command line interface to interact with AWS
- AWS CLI can be installed on Windows, Linux or mac
- To authenticate AWS CLI we need IAM user.
- Lets generate IAM Credentials (Secret Access Key Id, Secret Access Key)
- Navigate to IAM in services from console
- Now execute
aws configure
How to work on CLI
- AWS CLI will have following format
aws <service> <command/action> [--arg1 value1] .. [--argn valuen]
- Refer Here for aws ec2 commands.
-
Generally commands will have following prefixes
- to view
describe*list* - to create
create*run* - to delete
delete*terminate* - to modify
modify*update*
- to view
- AWS CLI relies on ID’s rather than names in many cases
- for all the commands
--region and --queryare supported
Exercise
- Get all the vpcs from aws cli for a particular region
aws ec2 describe-vpcs --region us-west-2 - Get all the security groups
aws ec2 describe-security-groups - Get the AMI id of the ubuntu 22.04
