??AWS CLI COMMANDS??

??AWS CLI COMMANDS??

Task Description

?? Create a key pair.

?? Create a security group.

?? Launch an instance using the above created key pair and security group.

?? Create an EBS volume of 1 GB.

?? The final step is to attach the above created EBS volume to the instance you created in the previous steps.

Let's start by knowing what exactly is Cloud Computing and AWS services?

Cloud computing is the on-demand availability of?computer system resources, especially data storage (cloud storage) and?computing power, without direct active management by the user.?The term is generally used to describe?data centers?available to many users over the?Internet.

Large clouds, predominant today, often have functions?distributed over multiple locations from central?servers. If the connection to the user is relatively close, it may be designated an?edge server.

Clouds may be limited to a single?organization?(enterprise clouds), or be available to multiple organizations (public cloud).

Amazon Web Services (AWS)?is a secure cloud services platform, offering compute power, database storage, content delivery and other functionality to help businesses scale and grow.

In simple?words AWS allows you to do the following things-

  1. Running web and application servers in the cloud to host dynamic websites.
  2. Securely store all your files on the cloud so you can access them from anywhere.
  3. Using managed databases like MySQL, PostgreSQL, Oracle or SQL Server to store information.
  4. Deliver static and dynamic files quickly around the world using a Content Delivery Network (CDN).
  5. Send bulk email to your customers.

Before we proceed to the CLI Commands, let's proceed to creating IAM User for configuring AWS CLI.

Go to the IAM user service. Then, click on "Add User" and remember to give Programmatic Access and AWS Management Console access .

Then after proceeding to next in Permissions give PowerUserAccess and then finally create the user.

No alt text provided for this image

Now after the successful creation, don't forget to copy the Access Key and the Secret Key.

Now after that open your command prompt and run the command: aws configure

No alt text provided for this image

Now, after the successful configuration; let's start with creating the key pair.

CLI COMMAND:- aws ec2 create-key-pair --key-name TASK2

No alt text provided for this image

Now, let's create a security group.

CLI COMMAND:- aws ec2 create-security-group --group-name MySecurityGroup -- description "My security group" --vpc-id vpc-fe30da95

No alt text provided for this image

We have created the security group but ingress or inbound rules are not being created so we need to create these rules.?

No alt text provided for this image


CONFIGURING THE SECURITY GROUP:-

CLI COMMAND:- aws ec2 authorize-security-group-ingress --group-id sg-04b33f8f53a9485ab --group-name MySecurityGroup --protocol tcp --port 22 --cidr 0.0.0.0/0

No alt text provided for this image

NOW WE ARE READY TO LAUNCH THE INSTANCES

CLI COMMAND:- aws ec2 run-instances --image-id ami-00bf4ae5a7909786c --instance-type t2.micro --subnet-id subnet-de3d2eb6 --security-group-ids sg-04b33f8f53a9485ab --key-name TASK2 --count 1

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

Now, let's create an EBS Volume of 1GB

CLI COMMAND:- aws ec2 create-volume --availability-zone ap-south-1a --volume-type gp2 --size 1

No alt text provided for this image

Now, let's attach them to our newly launched instance

CLI COMMAND:- aws ec2 attach-volume --volume-id vol-071a1e3740f11161d --instance-id i-0518fac336783722a --device /dev/sdf

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

DETACHING THE VOLUME CREATED

CLI COMMAND:- aws ec2 detach-volume --device /dev/sdf --instance-id i-0518fac336783722a --volume-id vol-071a1e3740f11161d

No alt text provided for this image

TERMINATE THE INSTANCE CREATING.

CLI COMMAND:- aws ec2 terminate-instances --instance-id i-0518fac336783722a

No alt text provided for this image

TASK COMPLETED


Rabindra Khalane

executive at Rolta India Limited

3 年

Very Good

回复

要查看或添加评论,请登录

Vrushali Mahajan的更多文章

  • ??AMAZON SQS AND NASA??

    ??AMAZON SQS AND NASA??

    Amazon provides SDKs in several programming languages including Java, Ruby, Python, .NET, PHP, Go and JavaScript.

  • ??K-mean clustering and its real usecase in the security domain??

    ??K-mean clustering and its real usecase in the security domain??

    Let's first understand, what exactly is K-mean clustering in machine learning? K-means clustering is one of the…

  • ??HELM CHARTS??

    ??HELM CHARTS??

    Before we start let us know what are Helm Charts and why do Kubernetes use them? Helm uses a packaging format called…

  • ??Multi-Node Cluster & Stateful Apps Like MySql and Wordpress??

    ??Multi-Node Cluster & Stateful Apps Like MySql and Wordpress??

    What is Kubernetes exactly? Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling,…

    2 条评论
  • ??USE CASES OF JAVASCRIPT??

    ??USE CASES OF JAVASCRIPT??

    Let's start with What exactly is Javascript? JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled…

  • IBM AND ITS USE CASES SOLVED BY KUBERNETES

    IBM AND ITS USE CASES SOLVED BY KUBERNETES

    Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of…

  • IMAGE PROCESSING WITH OPENCV USING PYTHON

    IMAGE PROCESSING WITH OPENCV USING PYTHON

    What is Image Processing? Image processing aims to transform an image into digital form and performs some process on…

  • ??CYBER CRIMES AND CONFUSION MATRIX??

    ??CYBER CRIMES AND CONFUSION MATRIX??

    Let's start with knowing, what exactly is cyber crime? Cybercrime is criminal activity that either targets or uses a…

  • RUNNING GUI APPS IN A DOCKER CONTAINER

    RUNNING GUI APPS IN A DOCKER CONTAINER

    What is GUI? Graphical user interface (GUI), a computer program that enables a person to communicate with a computer…

  • Running Machine Learning model in Docker Container

    Running Machine Learning model in Docker Container

    Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers…

社区洞察

其他会员也浏览了