AWS CLI: Launch EC2 Instance Guide
How to Launch an EC2 Instance Using AWS CLI
Tasks
Steps
aws ec2 create-key-pair --key-name datacenter-kp --query 'KeyMaterial' --output text > datacenter-kp.pemaws ec2 run-instances --image-id ami-0cd59ecaf368e5ccf --count 1 --instance-type t2.micro --key-name datacenter-kp --security-groups default --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=datacenter-ec2}]'
chmod 400 datacenter-kp.pem
