AWS Task-1 using AWS CLI.

AWS Task-1 using AWS CLI.

What is AWS CLI?

The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.

1.First we need to install AWS CLI software.

https://awscli.amazonaws.com/AWSCLIV2.msi

2.After successfully installing,create a IAM User in AWS.

No alt text provided for this image
No alt text provided for this image

Attach existing policies(policy name):power user access,so that we can access any services except billing account and IAM account.

No alt text provided for this image
No alt text provided for this image

3.Create user.

No alt text provided for this image

4.Then open CLI and then configure AWS by providing access key and secret key.

No alt text provided for this image


5.Then create key pair by using the command:

aws ec2 create-key-pair --key-name key-name
No alt text provided for this image

6.key pair is successfully created.

No alt text provided for this image

7.In this step we will create a security group using the command:

aws ec2 create-security-group --group-name security --description securitygroup
No alt text provided for this image

Security group has been created.

No alt text provided for this image

8.Then we have to add inbound rules using the command:

aws ec2 authorize-security-group-ingress --group-name security --protocol tcp --port 22 --cidr 0.0.0.0/0
No alt text provided for this image

9.Now we launch an instance using the key pair and security group that has been created else it will use the default security group.

No alt text provided for this image

In the above command image-id is AMI id.An AMI is a template that contains the software configuration (operating system, application server, and applications) required to launch your instance.

Instance type is t2.micro.Amazon EC2 provides a wide selection of instance types optimized to fit different use cases. Instances are virtual servers that can run applications. They have varying combinations of CPU, memory, storage, and networking capacity, and give you the flexibility to choose the appropriate mix of resources for your applications.And count is how many instances you want to launch.

10.Now I have created a volume of 1 GB using AWS CLI:

No alt text provided for this image
No alt text provided for this image


11.In above image you can see volume has been created and it is available,now we have to attach this volume to the instance.

No alt text provided for this image
No alt text provided for this image

Now you can see volume is attached to an instance and it is in use.

Note:Create and attach the volume in the same region as instance or else it gives error.

12.Now to stop instances we use the following command:

aws ec2 stop-instances --instance-ids i-0b249600d4cc2f740
No alt text provided for this image

13.Then terminate the instances:

aws ec2 terminate-instances --instances-ids i-0b249600d4cc2f740







To view or add a comment, sign in

More articles by Vadlamani Lakshmi Bhargavi

  • Confusion matrix for Detecting DoS attacks

    A confusion matrix is a technique for summarizing the performance of a classification algorithm. Classification is a…

    1 Comment
  • GUI container on top of docker

    Task 02 👨🏻💻 Task Description 📄 📌 GUI container on the Docker 🔅 Launch a container on docker in GUI mode 🔅 Run…

    2 Comments
  • Deploying MachineLearning model inside Docker Container

    Task 01 👨🏻💻 Task Description 📄 👉 Pull the Docker container image of CentOS image from DockerHub and create a new…

  • Configuring Docker Using Ansible

    Configuring Docker Container With HTTPD Server Image and Hosting a Webpage: TASK DESCRIPTION: Write an ansible playbook…

  • Industry use cases on ansible

    Lets first talk about ansible: Ansible is an Open Source Software that is used for automation of…

  • Industry use cases on kubernetes/openshift

    This Article is about how container adoption is growing rapidly in the enterprise and how openshift platform based on…

    2 Comments
  • Industry use cases on automation using ansible

    The article is about: "Industry use cases on Automation using ansible with two best industry expert Mr.Sreejith anujan…

  • Industry use cases solved Using Kubernetes

    Before we dive into kubernetes let’s briefly discuss some background. This will help us to better understand the…

  • Automation Using Python

    Here's an article on Automation using python. Me and my teammates have created a menu driven program which can automate…

  • High Availability Web Server Architecture using AWS CLI

    Task Description: webserver configured on ec2 instance. Document root(/var/www/html)made persistent by mountingon EBS…

Others also viewed

Explore content categories