Begin your journey by creating the aws account
To start working with aws, you need to login to the site: https://aws.amazon.com/ and create your account by providing your name, address and card details. Visit the "AWS Free Tier" site to learn more about free services.
Root Account
Root account is the one with which you create your aws account.
IAM User
We create and configure the IAM user for development.
Decide your Region
Region is nothing but a geographical location that you belong to, or the closest one.
Set your budget
The first thing to set up before you start your journey is billing budget. You can setup email notifications for billing alert.
AWS Services
There are 100s of services provided by AWS. Each one of them has got it's own purpose. One does not need all of them, instead use the ones that we need.
EC2 - Virtual Machine
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, re-sizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.
RDS - Database
Amazon Relational Database Service (Amazon RDS) makes it easy to set up, operate, and scale a relational database in the cloud. Eg: Oracle, PostgreSQL, MySQL etc.
Route 53 - Your Web Address
Amazon Route 53 is a highly available and scalable cloud Domain Name System (DNS) web service.
S3 - Storage
Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.
Building an interactive page with RDS operations
AWS offers various options to build a website. In our example we are trying to achieve it with minimal aws resources. We will not be trying to provision an EC2 instance instead we will go for S3 for storing our files and hosting the solution.
1. Create your PostgreSQL database using RDS
PostgreSQL is a powerful, open source object-relational database system that uses and extends the SQL language combined with many features.
- Login to AWS console and chose the service RDS.
- Create PostgreSQL Database under RDS service.
- Download SQL Workbench to access your cloud DB.
- Create the Employee table.
2. Build your Lambda function with DB operations
AWS Lambda lets you run code without provisioning or managing servers.With Lambda, you can run code for virtually any type of application or back-end service.
- Login to AWS console and chose the service Lambda.
- Create function
- Chose the language as Python 3.8
- Select the default Role
- Build code for Insert, Update, Delete and Select operations
3. Create REST API using API Gateway
Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale.
- Login to AWS console and chose the service API Gateway.
- Create API by Selecting the Lambda function created
- Method POST
- Enable CORS
- Deploy API and note down the Invoke URL
4. Build your ' index.html ' Home Page
Develop the index.html file with the following functionality in your local machine.
- Javascript functions to call API - fetch(Invoke URL)
- Build Separate JS functions for Insert, update, Delete and Select
- Place your HTML controls to contain table rows
5. Create S3 bucket
To upload and host the our files like HTML, CSS, JPG etc. we will be creating and S3 bucket
- Login to AWS console and chose the service S3
- Create bucket giving a name
- Bucket name should be the domain name to use Route 53 DN
- Upload all files like HTML, CSS, JPG etc
6. Route 53 Domain Name of your choice
Route 53 enables you to purchase the Domain name of your choice based on the availability. It costs approximately USD $12.
- Login to AWS console and chose the service Route 53
- Go to Registered Domains Section
- Search for the Doamin you want
- Once finalized, make the payment and the Route 53 is Ready
- Go to Hosted zones in Route 53, create A record Alias pointing to S3
WebSite Demo
The below demo screen allows you to insert, update and delete item in PostgreSQL DB. The column 'Id' is the key for the table and it is unique and mandatory. You can select an item details by providing the Id.
Id : | |
First Name : | |
Last Name : | |
Job : | |
Dept : | |
Salary : |
Team
This is a website developed and hosted on Amazon S3 to familiarize the AWS cloud concepts.
Binu Mathew
AWS ArchitectContact
Please provide your comments and queries if any.
Address
A1-308, Electronic City, Bangalore
Email Us
binukmathew@gmail.com
Call Us
+91 9886204080