AWS useful commands

EC2

Stop ec2 instance

aws ec2 stop-instances --instance-ids <ec2-id>

Start ec2 instance

aws ec2 start-instances --instance-ids <ec2-id>

AMI

Create an AMI from ec2 instance

aws ec2 create-image --instance-id <ec2-id> --name <new ami name>

Deregister AMI

aws ec2 deregister-image --image-id <ami-id>