Building basic Cloud Infrastructure using AWS Cloud
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. # All the above steps must be performed using AWS CLI
What is the AWS Command Line Interface?
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.
? First we have to install AWS CLI
Link : https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html
?? Step-1> Login to AWS account and Find Access key and Secret key by using IAM Service.
?? Step-2> Create Key Pair
Command for create Key pair
aws create-key-pair --key-name keycli
??Step-3> Create Security Group
Command for create security group
aws ec2 create-security-group --group-name <name> --description <description>
aws ec2 authorize-security-group-ingress --group-id sg-038236d417f92b48b --protocol tcp --port 22 --cidr 0.0.0.0/0
??Step-4> Launch EC2 Instance by using above Key Pair and Security Group
Command for Launch ec2 instance
aws ec2 run-instances --image-id ami-0e306788ff2473ccb --instance-type t2.micro --count 1 --subnet-id subnet-884f47e0 --security-group-ids sg-038236d417f92b48b --key-name keycls
??Step-5> Create EBS Volume and attach it to the EC2 Instance we launched
Command for create EBS Volume
aws ec2 create-volume --volume-type <volume_type> --size <volume_size> --availability-zone <Zone_name>
?? Step-6> Attach EBS Volume to EC2 Instance
aws ec2 attach-volume --volume-id <volume_id> --instance-id <instance_id> --device <device_name>
aws ec2 describe-volumes
??Step-7> We have to Terminate the EC2 Instance
Before terminate first we Detach the EBS Volume using command -
??Terminate the EC2 Instance using command -
aws ec2 terminate-instances --instance-ids <instance_id>
??????So We have we have successfully performed the task??????
Thanks Mr.Vimal Daga (Mentor) for giving such a challenging task which helps to me to explore my core concepts of Cloud Computing .