सीधे मुख्य सामग्री पर जाएं

How to configure EC2, EBS, and S3 in AWS using AWS CLI

Open the AWS Console, and login into your account..



How to create I Am user_?

The process is that:-...

Step 1) Search IAM services and an IAM dashboard window will open.



Step 2) In the left navigation panel select users.


Step 3) Enter username and check Access key — Programmatic access. Click on add user..



Step 4) Set permission for your user, and check administrator access. Click on add tags.



Step 5)Enter key-vale and click on next.




step 6) Now click on create user button.



Step 7) User is created successfully.


Now ,
We will install AWS cli machine in our system.....
: )
------
What is the AWS cli and why we need that_?
And
-
The AWS Command Line Interface (AWS CLI) is an open-source tool that enables you to interact with AWS services using commands in your command-line shell. With minimal configuration, the AWS CLI enables you to start running commands that implement functionality equivalent to that provided by the browser-based AWS Management Console from the command prompt in your terminal program.

To download the software please visit the website.

Download AWS CLI

After installation open cmd and type the 

Use Cammand: aws --version


Now , AWS cli was installed sucessfully _..

: )

Nxt movement.....

Step 1) Now we will configuration of cli

The aws configure command is used to set up your AWS CLI, open cmd type the following command.



Now select output format -> JAISON, press enter if already selected.Now select output format -> JAISON

PRESS ENTER BUTTON ...



Now, we have successfully completed our

AWS configuration....

: )

NOTE:---

If you have any problem...

Mostly the problem was Add Environmental variable....

Go on your windows search bar....

& Search Environmental variable



Click on edit button


Copy the AWS CLI path


Then select  name...: AWS -work

     Variable : path of aws cli file


Click on done ....

Now , see everything is fine...


*We will lonch Amazon ec2 instence by

AWS CLI....

Step 1) Creating key pair with AWS CLI

Enter the command to create a key pair 

Use CAMMAND: aws ec2 create-kay-pair --key-name



To display your key-pair
USE CAMMAND :-

aws ec2 describe-key-pairs --key-name ApniKeyPair



Kay-pair is created sucessfully..

Step 2) Creating Security Groups for Amazon EC2.

You can create a security group for your Amazon Elastic Compute Cloud (Amazon EC2) instances that essentially operates as a firewall, with rules that determine what network traffic can enter and leave.

  USE CAMMAND :- aws ec2 create-security-group —  my-sg — description “My security group” — vpc-id vpc-1a2b3c4d

group-name: It could be any valid group name.

description:- It could be any related description.

VPC ID :- You can find vpc from here — > goto VPC services → click on VPCs





This is your vpc id use this to create a security group.



NOW, WE HAVE SUCCESSFULLY CREATED A SECURITY GROUP IN AMAZON ec2..

Step 3) Launching an EC2 Instance using AWS CLI.

To launch an Amazon EC2 instance using the AMI you selected..
USE CAMMAND :- aws ec2 run-instances — image-id ami-xxxxxxxx — count 1 — instance-type t2.micro — key-name MyOwnKeyPair — security-group-ids sg-93027894f8 — subnet-id subnet-6e7f829e .

IMAGE ID :- To find the image id goto ec2 console → click on launch instance → select machine image and copy its image id(we are selecting amazon LINUX).






KEY NAME- We have already created key pair.

SUB-NET-ID :- To find subnet id goto — > ec2 management console → click on launch instance → goto network settings → click edit (because it is deafult) and select any subnet other than 1c beacuse t2.micro does not work in 1c, and copy its id.:

SECURITY GROUP- we have already created a security group.




We have successfully launched Amazon ec2 by AWS CLI....

: )


Nxt:-----------

We will attach Ebs volume to our ec2 instence by AWS CLI....

You have to create an EBS volume in the same availability zone that of your EC2 instance to attach it to EC2 instance.

USE CAMMAND :- aws ec2 create-volume — volume-type gp2 — size 8 — availability-zone us-east-1b


Now attach EBS volume to ec2 instance. 

USE CAMMAND :- aws ec2 attach-volume — volume-id (your volume id) — instance-id (instance id) — device /dev/sdf



To upload an object to S3 bucket use command :- aws s3 cp object_name s3://bucketnameTo upload an object to S3 bucket
USE CAMMAND:- aws s3 cp object_name s3://BUCKET NAME


Now make object public using acl to access it.



USE CAMMAND :- aws s3api put-object-acl — bucket (bucketname) — key (object-name) — acl-public-read.



NOW EVERYONE CAN ACCESS THE OBJECT PUBLICLY

I HOPE  ...
MY BLOG CAN HELP YOU ..

THANK YOU....


: )

Have a great day.....

😉😉😉

टिप्पणियाँ

इस ब्लॉग से लोकप्रिय पोस्ट

How to Take an Screen shot on Windows 7/8/10/11

  It is simple to take Screen-shot in windows/7/8/11 To Take screen-shot in windows 7 follow  this steps & me also..  Step : 1 ) Come on the home screen  of windows     Step : 2) Press Window button or key on the keyboard Step : 3) Search snipping tool and click it.. Step : 4) Here is open an popup........   Step : 5) Click on the new button..     There is four options to take screen shot    Step : 6) If you want to take a circle or any                        shap screenshot then select this option.     See this Step : 7) If you select second option ,t here is a Rectangular snip   Then one + icon is floating... So you can dreg this icon and it's grab shot Step : 8) If you choose third option there is window snip              In this snip you can snap all window when you touch any point on window.       ...