Neha sonone
3 min readDec 2, 2020

--

The Task is to:

  • setting up was CLI
  • creating IAM user
  • configuring AWS-CLI
  • creating KeyPairs, security groups Adding Rules to security groups, creating volumes, Attaching volumes using was CLI.
  • launching AWS EC2 instance and integrating all the above services with it using AWS CLI.

— First step is to create an IAM user with power access user permission.

AWS Identity and Access Management (IAM):- enables you to manage access to AWS services and resources securely. Using IAM, you can create and manage AWS users and groups, and use permissions to allow and deny their access to AWS resources.

Let's start how?

— first, log in to AWS Management Console and can find the IAM service

— now Add user in IAM.

— after creating a user u will get the access -key and secret key CSV file, download this file because we need this when we used to log in through CLI

— now go to windows CLI and see whether the AWS-CLI for windows is installed or not by command

aws  --version

— u can install AWS-CLI for windows by this link:-https://docs.aws.amazon.com/cli/latest/userguide/install-windows.html

— after this, we have to configure AWS in the bases so that we can use it by command aws configure, it requires ur Access key and secret key so copy the access key there and secret key and provide the default region name. then after that, u are good to go with the practical.

— to get more help to start an instance follow the command.

— gather the info about what is the need to launch an instance as we are not using AWS GUI for it and everything we have to do through CLI so for that we have to make a command for it using the requirements.

  • AMI name- Amazon Linux, AMI id we need.
  • instance type:- t2 micro
  • subnet(Availability zone):- we have to take subnet id and not 1a, 1b,1c because AWS CLI doesn't support
  • security group: — -security-group-ids,
  • key name.

— after gathering all the info make one command out of it.

— Creating volume using AWS CLI.

— Attaching volume to the instance we launched

— now see in the GUI of aws portal whether the volume created or not

**successfully launched an instance, created volume, and attached that volume to the instance — all done using the AWS-CLI **

--

--