Menu

Log in

Sign up

From beginner to master of web design, coding, infrastructure operation, business development and marketing

  • COURSES
  • HTML & CSS Introduction
  • HTML & CSS Coding with AI
  • Linux Introduction
  • Docker Basics
  • Git & GitHub Introduction
  • JavaScript Coding with AI
  • Django Introduction
  • AWS Basics
  • Figma Introduction
  • SEO Tutorial for Beginners
  • SEO with AI
  • OTHERS
  • About
  • Terms of Service
  • Privacy Policy

© 2024 D-Libro. All Rights Reserved

AWS BasicsChapter 4. Building Scalable Infrastructure with AWS

Defining Target AWS Configurations

Defining Target AWS Configurations

Defining Target AWS Configurations

Before jumping into the next steps, let’s take a moment to zoom out. So far, we’ve worked with a few key AWS services—you’ve already launched an EC2 instance, connected your app to S3 for file storage, and added CloudWatch to keep an eye on things.

Now we’re going to bring those pieces into a proper structure—something that’s closer to how things are done in production.

This isn’t a full reset. You’re not starting from scratch. Instead, you’ll take what you’ve built and place it inside a more complete, better-organized environment.

What you’re building

The goal here isn’t to use every AWS tool available. That would only complicate things. Instead, we’re aiming for a setup that gives your app a solid foundation—something reliable, secure, and flexible enough to handle more traffic, more features, and more users.

You’ll still use EC2 and S3—but now, they’ll live inside a setup that’s been intentionally designed to support them. Here’s how the pieces come together.

A private network with VPC

We’ll start by setting up a Virtual Private Cloud (VPC)—basically your own private corner of the AWS network. Instead of putting everything directly on the internet, you’ll organize your infrastructure so that some parts are public and others are private.

  • Public subnets will host components like your web server, which need to receive traffic from users online.

  • Private subnets will hold sensitive services like your database, which shouldn’t be reachable from the internet.

We’ll also set up:

  • An Internet Gateway, which allows resources in your public subnet (like the web server) to send and receive traffic over the internet.

  • A Route Table, which defines how traffic is directed within your VPC—ensuring that each subnet knows how to reach other parts of your network or the internet when needed.

Note: In this guide, we won’t set up a NAT Gateway, mainly because it can add noticeable cost even in small test environments. But it’s worth knowing about. A NAT Gateway allows resources in a private subnet—like your database—to make outbound connections (for example, downloading updates) without being exposed to incoming traffic from the internet. In production environments, it’s commonly used to strike a balance between security and functionality.

Rebuilding EC2 and reconnecting S3

You’ve already worked with EC2 to run your app and used S3 to store image files. Now, it’s time to rebuild EC2 inside your VPC and make sure it still connects smoothly to S3.

This time, the EC2 instance will sit in a public subnet, secured by a security group that controls what traffic is allowed. Once everything’s set up, you’ll create an Amazon Machine Image (AMI) so you can reuse the configuration later without repeating the setup from scratch.

With EC2 now inside your VPC, you’ll also reconnect it to S3. This involves checking that your app can still upload and access media files the same way it did before. The storage setup doesn’t change—S3 remains your place for static content—but making sure it works inside your new network is key.

Moving the database to RDS

Running a database on EC2 works, but it puts a lot on your shoulders: updates, backups, tuning, and troubleshooting. Now’s the time to shift that responsibility to Amazon RDS, a managed database service that does most of the heavy lifting for you.

The RDS instance will be placed in a private subnet, keeping it isolated and secure. Your EC2 server will be the only one with permission to talk to it. That’s exactly how production environments are structured.

Getting ready for growth with a Load Balancer

If your app starts getting more traffic—or if you just want to be prepared—it’s smart to spread the load across more than one server. We’ll add an Application Load Balancer (ALB) that automatically distributes incoming traffic. This helps with performance and ensures that your app stays available even if one of your servers goes down.

You don’t have to scale right away. But by including a load balancer now, you’re giving yourself room to grow when the time comes.

What comes next

Now that you know where you’re headed, it’s time to build the pieces, one step at a time. You’ll prep your app, set up the network, rebuild your EC2 server inside the VPC, reconnect it to S3, and connect to a new RDS database.

By the end of this process, you won’t just understand how AWS services work—you’ll have used them to create a working, scalable cloud environment. And when you see it all come together, you’ll realize how far you’ve come.

Tags:

EC2 Instance

AWS Configurations

Virtual Private Cloud

Amazon RDS

Application Load Balancer

AWS Basics
Course Content

Chapter 1. Cloud and AWS Fundamentals

Introduction to Cloud Computing

Discovering Amazon Web Services (AWS)

AWS vs. Azure vs. Google Cloud

Chapter 2. Setting Up the AWS Environment

Creating Your AWS Account

Managing User Access with IAM

Managing AWS Cost from the Beginning

Chapter 3. Deploying a Web App on AWS with a Simple Setup

Preparing a Web App for Deployment

Launching and Configuring EC2 Instances

Implementing Storage with Amazon S3

Chapter 4. Building Scalable Infrastructure with AWS

Defining Target AWS Configurations

Configuring Your Virtual Private Cloud (VPC)

Using AMIs to Recreate EC2 Instances in a Custom VPC

Setting Up a Relational Database with RDS

Distributing Traffic with Elastic Load Balancing (ELB)

Monitoring Performance with CloudWatch

Chapter 5. Next Steps on Your AWS Journey

Exploring AWS Further: Rise of AI Services

Certification and Continuing Your AWS Journey

Chapter 1. Cloud and AWS Fundamentals

Introduction to Cloud Computing

Discovering Amazon Web Services (AWS)

AWS vs. Azure vs. Google Cloud

Chapter 2. Setting Up the AWS Environment

Creating Your AWS Account

Managing User Access with IAM

Managing AWS Cost from the Beginning

Chapter 3. Deploying a Web App on AWS with a Simple Setup

Preparing a Web App for Deployment

Launching and Configuring EC2 Instances

Implementing Storage with Amazon S3

Chapter 4. Building Scalable Infrastructure with AWS

Defining Target AWS Configurations

Configuring Your Virtual Private Cloud (VPC)

Using AMIs to Recreate EC2 Instances in a Custom VPC

Setting Up a Relational Database with RDS

Distributing Traffic with Elastic Load Balancing (ELB)

Monitoring Performance with CloudWatch

Chapter 5. Next Steps on Your AWS Journey

Exploring AWS Further: Rise of AI Services

Certification and Continuing Your AWS Journey

FAQ: Defining Target AWS Configurations

What is the purpose of setting up a Virtual Private Cloud (VPC)?

A VPC provides a private network within AWS, allowing you to organize your infrastructure with public and private subnets for better security and management.

Why should I use Amazon RDS instead of running a database on EC2?

Amazon RDS is a managed database service that handles updates, backups, and maintenance, reducing the operational burden compared to managing a database on EC2.

How does an Application Load Balancer (ALB) benefit my application?

An ALB distributes incoming traffic across multiple servers, improving performance and ensuring availability even if one server fails.

What role does a security group play in an EC2 setup?

A security group acts as a virtual firewall, controlling inbound and outbound traffic to your EC2 instances, enhancing security within your VPC.

Why is it important to reconnect EC2 to S3 after setting up a VPC?

Reconnecting ensures that your application can continue to upload and access media files stored in S3, maintaining functionality within the new network setup.