Creating and Managing Virtual Servers on Amazon Part 4

Watching previous blogs doing great, all of you motivated me to write one more. Well, in my last post, I talked about AWS Cloud SDKs. This time, I’ll talk about Amazon Command Line Interface, a unified tool to manage your AWS services.

Prerequisites

  1. Amazon Account
  2. Amazon Access and Secret keys
  3. Install AWS Command Line Interface

Configuring AWS Command Line Interface

Before getting started with this tool, you need to configure your AWS Command Line Interface. To do that, use the following command:

1
$ aws configure

This command will prompt AWS credentials, default region & output format. Once you have provided all the inputs, a config file is being created in the folder named .aws in your home directory.

1
2
3
4
AWS Access Key ID [None]: Your_AWS_Acces_Key
AWS Secret Access Key [None]: Your_AWS_Secret_Key
Default region name [None]: us-west-2
Default output format [None]: json

Creating a new Virtual Server using AWS Command Line Interface

It is really convenient for you to create an Instance (Virtual Server) using AWS Command Line Interface. All you have to do is to use the commands given below .

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
aws ec2 run-instances --image-id ami-xxxxxxxx --count 1 --instance-type t1.micro --key-name MyKeyPair --security-groups MySecurityGroup
 
// image-id: the id of the AMI which is used to create an Instance.
// count: number of instances you want to create
// instance-type: size of the instance e.g, t1.micro, m1.small etc.
// key-name: name of the the key-pair
// security-groups: name of the created security-group
 
// To create Security group
aws ec2 create-security-group --group-name MySecurityGroup --description "My security group"
 
// group-name: name of the security group
// description: description about the security group
 
// add rules to your created security group
aws ec2 authorize-security-group-ingress --group-name MySecurityGroup --protocol tcp --port 22 --cidr x.x.x.x/24
 
// group-name: name of the security group
// protocol: IP protocol of this permission e.g, tcp, udp, icmp
// port: port to give permission on.
// cidr: The CIDR IP address range. By default it is 0.0.0.0/0 (for all IPs)

Click here for more information on commands provided by EC2 CLI Tool.

In this post, I have explained the process for creating and managing Virtual Servers on Amazon using AWS Command Line Interface.

If you have queries or need any further assistance, write to us at support@shephertz.com

twitter Creating and Managing Virtual Servers on Amazon Part 4facebook Creating and Managing Virtual Servers on Amazon Part 4google Creating and Managing Virtual Servers on Amazon Part 4linkedin Creating and Managing Virtual Servers on Amazon Part 4pinterest Creating and Managing Virtual Servers on Amazon Part 4reddit Creating and Managing Virtual Servers on Amazon Part 4stumbleupon Creating and Managing Virtual Servers on Amazon Part 4tumblr Creating and Managing Virtual Servers on Amazon Part 4

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 8 = sixteen

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>