Start an Instance
aws ec2 start-instances --instance-ids Instance Id
Stop an Instance
aws ec2 stop-instances --instance-ids Instance Id
Create / Delete TAGS
aws ec2 create-tags --resources ami-1a2b3c4d i-10a64379 --tags Key=webserver,Value= Key=stack,Value=Production
aws ec2 create-tags --resources Instance-Id --tags Key=Name,Value=Testing
aws ec2 delete-tags --resources Instance-Id --tags Key=Name,Value=Testing
Attach / Detach Volumes to EC2
aws ec2 attach-volume --volume-id vol-45de780c --instance-id Instance-Id --device /dev/sdf
aws ec2 detach-volume --volume-id vol-45de780c --instance-id Instance-Id --device /dev/sdf
Create / Delete EBS Volume
aws ec2 create-volume --size 1 --region us-east-1 --availability-zone us-east-1a
{
"AvailabilityZone": "us-east-1a",
"Attachments": [],
"Tags": [],
"VolumeType": "standard",
"VolumeId": "vol-6mb5678943",
"State": "creating",
"SnapshotId": null,
"CreateTime": "2014-06-26T10:30:16.168Z",
"Size": 1
}
aws ec2 delete-volume --volume-id vol-45de780c
Comments