Configure AWS CLI
- We need to login into AWS Console and then use it, for CLI/SDK AWS has a concept of secret key and access key.
- We need to generate secret key and access and configure that in CLI. Create an IAM User as shown here
- Get the List of all the ec2 instances in us-west-2
- Command :
aws ec2 describe-instances
- In the documentation page if you select output then the structure of the output will be shown
- Get the List of all the AMIs and write some filters like get all windows images, ubuntu AMIs
aws ec2 describe-images --filters 'Name=platform,Values=windows'
aws ec2 describe-images --owners 'microsoft'
aws ec2 describe-images --filters 'Name=description,Values=Canonical, Ubuntu*'
- Get the List of all Security groups
- Create an ec2 instace with any AMI selected from above and security group from above with t2.micro as size