← Back to list

AWS Cloud Web Application Building

Phase 1: Planning the design and estimating cost

Jibran Hanan · 2026-05-18 11:04 · 0 claps · 8.5 min read
#cloud-computing #aws #ec2 #aws-vpc #aws-cloud9
Open on Medium ↗
Wiki topics: 🌐 · Web Development ☁️ · DevOps & Cloud

AWS Cloud Web Application Building

Phase 1: Planning the design and estimating cost

Task 1: Creating an architectural diagram

Task 2: Developing a cost estimate

I then, used the AWS Pricing Calculator to estimate the cost and exported a cost estimate PDF file.

Phase 2: Creating a basic functional web application

Task 1: Creating a virtual network

Create a virtual network to host the web application.

Tip: Create networking resources such as a virtual private cloud (VPC) and subnets.

When you have accessed the Lab, head over to ‘Services’ and select ‘VPC’

Go ahead and click on ‘Create VPC’, and then configure accordingly

  • 2 A.Z (Availability Zones)
  • 2 Public & Private Subnets

Customize Subnets CIDR Blocks:

  • Public subnet CIDR block in us-east-1a: 10.0.0.0/27
  • Public subnet CIDR block in us-east-1b: 10.0.0.32/27
  • Private subnet CIDR block in us-east-1a: 10.0.0.64/27
  • Private subnet CIDR block in us-east-1b: 10.0.0.96/27

Press in ‘Create VPC’ and wait for a few seconds:

Task 2: Creating a virtual machine

Create a virtual machine in the cloud to host the web application.

To install the required web application and database on the virtual machine, use the JavaScript code given to you in the instructions

Tips:

Use a compute service such as Amazon Elastic Compute Cloud (Amazon EC2).

Use the latest Ubuntu Amazon Machine Image (AMI).

Once again, head back to ‘Services’ and choose ‘EC2’

Press enter or click to view image in full size

Configure the instance accordingly

Key pair: vockey

VPC: The VPC n/w we had created earlier

Subnet: <vpc-name>-subnet-public1

We will be creating a security group, name it something meaningful and a valid description.

The load balancer security group allows inbound HTTP (80) from anywhere to make the application publicly accessible.

The web server security group allows inbound HTTP (80) only from the ALB, ensuring that EC2 instances are not directly exposed.

The database security group allows inbound MySQL/Aurora (3306) only from the WebServer-SG so the application can connect to the database, and temporarily from the Cloud9 environment for the database migration step.

This setup ensures proper security isolation across the load balancer, application layer, and database layer.

So, before we launch this instance, we require to set up a Cloud9 Environment etc:

Create the environment and then head over back to the instance configuration

In the user data box, paste the ‘SolutionCodePOC’ which has been provided to us

After this, launch the instance and then we must test it.

Task 3: Testing the deployment

Test the deployment of the web application to ensure it is accessible from the internet and functional.

Use the Instances Public IP to access and see if it accessible:

Phase 3: Decoupling the application components

In this phase, you will continue building. The objective is to separate the database and the web server infrastructure so that they run independently. The web application should run on a separate virtual machine, and the database should run on the managed service infrastructure.

Task 1: Changing the VPC configuration

Update or re-create the virtual network components that are necessary to support hosting the database separately from the application.

Note: You need private subnets in a minimum of two Availability Zones.

Create a sperate security group for the database using cloud9 environments

Configure as shown above in the screenshots and then create the security group

Task 2: Creating and configuring the Amazon RDS database

Create an Amazon Relational Database Service (Amazon RDS) database that runs a MySQL engine. You can choose to create a provisioned instance or run it serverless.

We will create a subnet group.

Configure it as shown above in the screenshots and then click ‘create’. Next, we will be making a database.

Use the above configurations as shown in the screenshots and then create database.

Then we will continue with task 3.

Task 3: Configuring the development environment

We connect to cloud9 environment and then make changes to the provided scripts to run on the cloud9 terminal.

We have to add the RDS endpoint etc and make changes according to our application and then run on the terminal as shown below.

Task 4: Provisioning Secrets Manager

We then check from the secrets manager if the secret is created

Further make changes in the commands in the script and replace the <EC2instancePrivateip> with internal IP address of the EC2 instance created in Phase-2 earlier and then run on the cloud9 terminal.

After creating the database and using it.

We will run commands to check that our previously entered data on the application is in the database as shown below.

Task 5: Provisioning a new instance for the web server

Create a new virtual machine to host the web application.

For the AWS Identity and Access Management (IAM) profile on the EC2 instance, attach the existing LabInstanceProfile profile. This profile attaches an IAM role called LabRole to the instance so that it can fetch the secret securely.

The process is almost similar apart from choosing ‘LabInstanceProfile’ in the Advanced Details section

Task 6: Migrating the database

In the User Data portion, upload the code that is given for the server and then launch the instance.

Then you should test the application and it should run.

Phase 4: Implementing high availability and scalability

In this phase, you will complete the design and fulfill the remaining solution requirements. The objective is to use the key components that you created in earlier phases to build a scalable and highly available architecture.

Task 1: Creating an Application Load Balancer

Launch a load balancer. The endpoint will be used to access your web application.

Tip: Use a minimum of two Availability Zones.

On the left panel of the EC2 dashboard, you can see Load Balancers, click on that

Use the above configurations, before we create this we will also need to create a target group.

Use the above configurations and then create the target group.

Then, head over back to the application load balancer.

Complete the configuration and then create the load balancer.

Task 2: Implementing Amazon EC2 Auto Scaling

Create a new launch template and use an Auto Scaling group to launch the EC2 instances that host the web application.

To accomplish this, you can create an AMI from the running instance or create a new AMI and install the necessary packages and application code. Then, configure an Auto Scaling group to use the load balancer.

First, we need to create the launch template

Use the above configurations and then create

Once this is done then head over to the auto scaling group configurations and do them accordingly as shown in the following screenshots.

Do the above configurations and then create the auto scaling group.

Task 3: Accessing the application

Access the application and perform a few tasks to test it

You should see more instances as above.

Copy the DNS endpoint of the load balancer and then test if your application is working

The application is working perfectly, and we have completed our project.


메타데이터
post_id
53b751a66e88
slug
aws-cloud-web-application-building-53b751a66e88
url
https://medium.com/@jibranhanan6/aws-cloud-web-application-building-53b751a66e88
canonical_url
https://medium.com/@jibranhanan6/aws-cloud-web-application-building-53b751a66e88
author_url
https://medium.com/@jibranhanan6
status
ok
fetched_at
2026-06-09 15:37:30