"Unraveling Cloud Mysteries: Deep Dive into AWS Services".
session 2

"Unraveling Cloud Mysteries: Deep Dive into AWS Services".

Let's kick off the second blog session on AWS cloud.

Steps to launch an EC2 instance.

  • Sign in to AWS Console: - Log in to your AWS Management Console using your credentials.
  • Navigate to EC2 Dashboard: - From the AWS Console, go to the EC2 Dashboard by selecting "Services" and then "EC2" under the Compute section.
  • Click on "Launch Instance": - In the EC2 Dashboard, click on the "Launch Instance" button to start the instance creation process.
  • Choose an Amazon Machine Image (AMI): - Select an AMI that suits your requirements, such as a pre-configured OS or application environment.
  • Choose an Instance Type: - Choose the instance type based on your workload needs, such as general-purpose, compute-optimized, memory-optimized, etc.
  • Configure Instance Details:- Configure instance details like the number of instances, network settings (VPC, subnet), and storage (EBS volumes).
  • Add Storage (Optional): - Add additional storage if needed, specifying volume type, size, and configuration options.
  • Add Tags (Optional): - Tag your instance for better organization and management, adding key-value pairs for identification.
  • Configure Security Group: - Create or select a security group to define inbound and outbound traffic rules, specifying protocols, ports, and IP ranges.
  • Review and Launch:

- Review your instance configuration details, making sure everything is set correctly.

- Click "Launch" to initiate the instance creation process.

  • Create Key Pair (Optional):- If you haven't already created a key pair, AWS will prompt you to create or select an existing key pair for SSH access to the instance.
  • Launch Instance: - Click "Launch Instances" to finalize and launch your EC2 instance.


When we Launch an instance with Amazon Linux then it gives us the facility to connect through the browser directly but AWS does not give the facility for every AMI to connect through the browser. If we launch RedHat Linux it does not give us the facility to connect through the browser. If we try to connect an Instance based on Redhat Linux AMI through the browser, then it will fail to connect to our instance.

  • Here is the information about the default usernames for various AMIs used to launch instances:- Amazon Linux 2: Default username is ec2-user.- Amazon Linux: Default username is ec2-user.- CentOS: Default usernames are centos or ec2-user.- Debian: Default username is admin.- Fedora: Default usernames are fedora or ec2-user.- RHEL (Red Hat Enterprise Linux): Default usernames are ec2-user or root.- SUSE Linux Enterprise Server: Default usernames are ec2-user or root.- Ubuntu: Default username is ubuntu.- Oracle Linux: Default username is ec2-user.You can use this information to log in to instances created from these AMIs.If we try to connect an Instance based on Redhat Linux AMI through the browser, then it will fail to connect to our instance.
  • To solve this, we will download GIT BASH
  • After downloading and installing it, We can open Gitbas, which will give us a terminal. Whenever we want to connect to any instance via ssh we need 3 things.1. IP Address of the computer you want to connect.2. Account name or User Name.3. Key or Password.
  • To connect to the target computer you need the following command.ssh IpAddress -l ec2-user -i key(which you downloaded while launching instance).

Git bash terminal image

1. Launch an Instance in the AWS Virginia Region:

  • - Start by logging into your AWS account and navigating to the EC2 dashboard.
  • - Choose the Virginia region (us-east-1) as your preferred region for launching the instance.
  • - Follow the steps to launch a new EC2 instance, selecting the desired AMI, and instance type, configuring security groups, and optionally adding key pairs for SSH access.

2. Connecting to the Instance Launched in the Virginia Region from Your Device (Windows) using SSH:

  • - Open a terminal or command prompt on your Windows device.
  • - Use the ssh a command followed by the public IP address of your Virginia instance and the username (`ec2-user` for Amazon Linux-based AMIs).
  • Example: ssh ec2-user@<Virginia_Instance_IP>
  • - Add the -i flag followed by the path to the private key file (.pem) that you downloaded while launching the instance.
  • Example: -i /path/to/key.pem
  • - Include the -N flag to ensure that no remote command is executed.
  • - Use the -D flag followed by the desired local port (e.g., 9090) to create a dynamic SOCKS proxy tunnel.
  • Example: -D 9090
  • - The complete command will look like
  • ssh ec2-user@<Virginia_Instance_IP> -i /path/to/key.pm -N -D 9090

3. This Command Creates the Tunnel between the Instance in Virginia and Your Device (Windows):

  • - Running the SSH command as described establishes a secure connection between your Windows device and the EC2 instance in the Virginia region.
  • - The -D option sets up a SOCKS proxy on your local machine using a port 9090, allowing you to route your internet traffic through the EC2 instance.
  • - This setup effectively creates a SOCKS proxy, enabling you to access restricted or geo-blocked content, bypass firewalls, and enhance your privacy and security while browsing.

By following these steps and executing the SSH command with the appropriate parameters, you can establish a SOCKS proxy tunnel between your Windows device and the AWS EC2 instance launched in the Virginia region.

SOCKS proxy: A SOCKS proxy is a networking protocol that allows clients to establish a secure and indirect connection to servers through a proxy server.

Host your website in AZ directly near your customers...

AWS global infrastructure gives you the capability to reduce latency. For eg:-if you have hosted your website in Mumbai and your customers are from California it will take a lot of time and there will be an increase in the latency issues. So, AWS provides the global infrastructure in which you can host your website on Amazon directly near your customers.

  • Launch the instance in the California region
  • Login to the root user. Root is the admin user in Linux.

root user

  • Installing the webserver (httpd is the software from Apache) Command:-yum install httpd

  • Create or Copy the html folder in /var/www/html/ directory
  • Command :-cat > index.html

  • Starting the webserverCommand:-systemctl start httpd
  • Check your website by entering the URL in your browserhttps://IP/(Filename)
  • AWS instances have an internal firewall which means no one can access your website through the Internet.
  • Go to your security groups > edit inbound rules.

  • Now when you refresh your page you can see the website.
  • From your CLI you can also access the website by using curl https://IP/(filename)
  • From curl and by using the options available with the curl command you can also see the time required. curl -w “{%total_time%}”https://IP/(filename)
  • To decrease the latency, AWS has a service called GLOBAL ACCELERATOR AWS has created its infrastructure by putting the wires all over the world Even if there is any disaster in any region in between the route of the wire site can reroute itself. If any fault happens they know how to tolerate the fault it is known as fault tolerance.

Stay tuned for our next session, where we'll continue our journey into the vast world of cloud computing!



Lionel Tchami

???? DevOps Mentor | ?? Helping Freshers | ????Senior Platform Engineer | ?? AWS Cloud | ?? Python Automation | ?? Devops Tools | AWS CB

12 个月

Exciting journey ahead with AWS EC2 features! ?? #TechInnovation

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

Ankit Kumar的更多文章

社区洞察

其他会员也浏览了