Cloud Computing with AWS— Decoding DevOps[04]

Bhavyansh @ DiversePixel
6 min readJun 10, 2024

--

In our previous exploration of DevOps, we delved into the bedrock principles of Virtualization, Networking, and Containerization, along with the fundamentals including Linux, Bash Scripting, Git&GitHub. Now, we ascend to the next level: Cloud Computing. This fundamental technology forms the backbone of modern DevOps practices, empowering organizations to achieve unprecedented agility, scalability, and cost efficiency.

The Cloud Revolution: Why it Matters

Cloud computing, in its essence, allows businesses to access and utilize computing resources — servers, storage, databases, software, networking — over the internet. Instead of investing heavily in physical infrastructure, organizations can “rent” these resources on demand, paying only for what they use.

The advantages of this paradigm are undeniable:

  • Agility: Deploying and scaling applications becomes effortless, enabling rapid innovation and adaptation to market demands.
  • Flexibility: The ability to access resources anytime, anywhere, opens doors to geographically distributed teams and global expansion.
  • Cost Savings: By eliminating upfront capital expenditures and managing infrastructure complexities, businesses can optimize spending.
  • Scalability: Cloud platforms seamlessly scale resources up or down based on application needs, ensuring optimal performance and resource utilization.

Types of Cloud Computing

The cloud landscape offers a variety of deployment models:

  • Infrastructure-as-a-Service (IaaS): Provides basic building blocks like servers, storage, and networking, giving users complete control over the underlying infrastructure.
  • Platform-as-a-Service (PaaS): Offers a platform for developing and deploying applications, including middleware, databases, and runtime environments.
  • Software-as-a-Service (SaaS): Delivers ready-to-use applications accessible via the internet, eliminating the need for installation and maintenance.

Amazon Web Services (AWS): A Premier Cloud Platform

Amazon Web Services (AWS) stands as a dominant force in the cloud market, offering an extensive portfolio of services for virtually every need. Let’s delve into the most popular offering:

  • EC2 (Elastic Compute Cloud): The workhorse of AWS, EC2 provides virtual servers (instances) that act as building blocks for applications. These instances can be customized with different operating systems, software packages, and configurations.

Leveraging EC2 for DevOps Success

EC2 empowers DevOps practitioners with a powerful arsenal for deploying and managing applications:

  • API-driven provisioning: Automate instance creation, configuration, and management through programmatic interfaces, enabling seamless integration with CI/CD pipelines.
  • Scalability and elasticity: Easily scale up or down EC2 instances in response to fluctuating workloads, ensuring optimal performance and resource utilization.
  • Integration with other AWS services: Seamlessly integrate EC2 with other AWS services, such as S3 (object storage), EFS (file system), RDS (database), and Lambda (serverless computing), creating a robust and comprehensive application environment.

Creating an EC2 Instance: A Step-by-Step Guide

  1. Gathering Requirements:
  • Define the instance size and storage needs.
  • Identify the operating system and required software packages.
  • Specify the security group for network access control.

2. Key Pair Creation: Generate an SSH key pair for secure access to the EC2 instance.

3. Security Group Configuration: Define the inbound and outbound rules that govern network traffic to and from the instance.

4. Instance Creation:

  • Choose an AMI (Amazon Machine Image) that aligns with your requirements.
  • Select the appropriate instance type based on performance and cost considerations.
  • Configure storage and add tags for organization and identification.
  • Specify the security group to manage network access.
  • Review the settings and launch the instance.

Managing EC2 Instances: Best Practices

  • Naming Conventions: Employ consistent naming conventions across instances and resources, incorporating project name, environment, and region for clarity.
  • Tags: Tag instances for easy identification, grouping, and filtering.
  • Security Group Management: Maintain strict security rules, allowing access only to authorized services and users.
  • Monitoring and Logging: Monitor instance performance and capture logs for debugging and troubleshooting.
  • Backup and Recovery: Implement robust backup and recovery procedures to safeguard data and ensure business continuity.

We will be seeing how to implement these features in upcoming posts.

Let’s spin up an EC2 instance together

  1. Create a free tier eligible AWS account if you haven’t already, it is recommended to create an IAM user with Administrator privileges to log in to AWS.
Log in to your AWS account as an IAM user

2. Our requirements:

  • A free tier eligible instance
  • The OS powering most of the world: Linux

3. Let’s create security group (Virtual firewall) for our instance first

  • Navigate to Security Groups
  • Create Security Group
  • Add an Inbound Rule to be able to access the instance from your machine (select My IP in source)

4. Now that we have the Security Group, Let’s generate a key pair which we will use to access our instance.

  • Navigate to Key Pair in Network & Security tab
  • Click on Create Key Pair
  • Name it and use .pem format unless you’re using PuTTY to login
  • All set, now we’re spinning up an EC2 instance next

5. Search for EC2 in services section and select EC2

  • Click on Launch an Instance
  • Provide details
  • Choose an AMI, I am going with Ubuntu 24
  • Select instance type and the remaining details of Key pair and Security Group
  • Wait for initialization to finish, wait for a few minutes
  • Refresh AWS console

6. Test our instance’s access

  • Select the instance, get it’s public IP
  • Open your terminal and connect using credentials and username as seen in ‘Connect’ tab
  • Username: ubuntu
  • Lets connect using ssh: ssh -i /path/to/your/key.pem ubuntu@public_ip
  • And we’re in

So we went through the prerequisites and launched an EC2 instance.

Things to note:

  • It takes some time for the instance to become available
  • If you cannot access your instance, check the security group associated with it
  • Use correct naming conventions and use tags as they help filter when you need it
  • You get (as of now) 30GB of general purpose storage and 750 hours of usage (per month)
  • Stop the instance when not using (find the settings under Instance state)

I have stopped the instance and terminated it.

This was it. We went through the basics of Cloud Computing and AWS and then we saw accessing an EC2 instance.

I am learning and building in public, you can follow my progress here on medium and on X @ bhavyansh001

--

--

Bhavyansh @ DiversePixel
Bhavyansh @ DiversePixel

Written by Bhavyansh @ DiversePixel

Hey I write about Tech. Join me as I share my tech learnings and insights. 🚀

No responses yet