Create an EC2 Instance using AWS CLI

+1 vote
Can someone help me with creating an EC2 instance using AWS CLI?
Feb 15 in AWS by Theodore
1,059 views

2 answers to this question.

0 votes

You can use the following command to create an EC2 Instance:-

C:\Users\priyj_kumar>aws ec2 run-instances --image-id ami-0080e4c5bc078760e --key-name yourkeyname --instance-type t2.micro --region us-east-1 --subnet-id your-subnet-id --count 1
answered Feb 15 by Priyaj
• 56,940 points

After creation of the EC2 instance you will get a log like this:-

Thank you. This works fine. There will be a log can you share that aswell
Hello @Dev, its already uploaded you can have a look at it.
Thank you priyaj, the command works fine. I changed the count to 3 and got 3 instances. This is easy rather than creating 3 instance again and again
0 votes
answered Feb 15 by Dev
• 360 points

Related Questions In AWS

+1 vote
2 answers

How to launch and access an instance using AWS-CLI?

aws ec2 run-instances --image-id ami-id --key-name yourkeyname ...READ MORE

answered Feb 23 in AWS by Shashank
• 1,350 points
161 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers

Launching an EC2 Instance using AWS SDK Java

package com.ec2application.ec2application; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.regions.Regions; import com.amazonaws.services.ec2.AmazonEC2; import ...READ MORE

answered Jan 22 in AWS by Priyaj
• 56,940 points
694 views