Launching an AWS Instance and configuring Security groups  πŸŒ₯οΈπŸ”’

Launching an AWS Instance and configuring Security groups πŸŒ₯οΈπŸ”’

Β·

3 min read

AWS (Amazon web services) is the most popular cloud platform and EC2 Instance (Elastic compute cloud) is the service of AWS that is used mostly to create a virtual server with in minutes. In AWS, Instance is basically a server.

Security groups is like a firewall for EC2 instance that controls all the Inbound and Outbound traffic.

Let's use a door as an example: only if you allow, someone can enter; otherwise, they are not allowed.

So let’s dive into it creating an EC2 instance & Configuring it with security group.

[1.] Login into your AWS account πŸšͺ:

Go to AWS Console: Open your browser and head to the AWS Management Console.

[2.] Launch an EC2 Instance πŸš€:

You can search for the EC2 service, and before launching an instance, select the region where you want your server to be.

  • Name & Tags 🏷️ - Tags are used to label your instances (e.g., β€œName: MyFirstEC2”).

  • AMI (Amazon Machine Image) πŸ–₯️ - This is similar to Operating system, so you can use different OS. For now, Let’s go with ubuntu. (Choose any Free tier Eligible option.)

  • Instance type πŸ’»- While practicing anything micro costs less. In AWS, t2.micro is Free tier Eligible option.

  • Key pair (login) πŸ”‘ - Create a new key pair to login into the remote server.

    1. PPK for use with putty

    2. PEM for use with SSH

Click on β€œcreate key pair”.

  • NOTE: Do not share your Access Keys and Secret Access keys on any public platform.

Network Settings :

[3.]Firewall (Security groups) πŸ”‘-

We can either select the existing security group or create security group.

  • Best Practices for Security Groups πŸ”’

    • Minimize Open Ports: Only open ports that are necessary for your instance to function (e.g., SSH for admin access, HTTP/HTTPS for web servers).

    • Restrict Access by IP: Limit SSH (Port 22) access to your own IP address and avoid leaving it open to the public internet.

    • Use Multiple Security Groups: You can assign multiple security groups to a single EC2 instance to manage different types of traffic (e.g., one for web access, one for database access).

    • Add Rules to Security Group*:*

      • Port 22 (Allow SSH traffic from)

      • Port 443 (Allow HTTPS traffic from Internet)

      • Port 80 (Allow HTTP traffic from Internet.

  • Configure Storage πŸ’Ύ - Add storage up to 30GB for the Free tier, or stick with the default storage of 8GB.

    Once done with all these Review the changes before Launching the Instance.

    Conclusion πŸŽ‰

    This guide covered launching an AWS EC2 instance, setting up security groups, and understanding their importance in controlling access and keeping your cloud resources safe and secure.

    By following these steps, you can try launching EC2 instance but also immediately terminate the instance, if not used.

    Happy Learning! πŸŽ‰

Β