Ravindra BagaleCourses & study guides मराठी Track your progress

Create an Amazon Aurora Database Step by Step

Create a small Aurora MySQL cluster in ap-south-1, note the endpoints, run one query path, then delete the cluster. Aurora is not free — treat this as a short lab.

What you'll learn in this chapter

  • Create Aurora MySQL cluster (dev size)
  • Set master user and networking
  • Find writer endpoint and connect notes
  • Delete cluster and instances

Cost — read before create

Aurora instances bill per hour while available. Use the smallest dev/test class shown (for example t3.medium / t4g.medium — pick what the console offers for Aurora MySQL). Delete within an hour. Do not enable Production template extras you do not need.

1. Lab: click by click

How to do it (step by step)

A. Subnet group and SG

  1. RDS → Subnet groups → Create DB subnet group lab-aurora-subnets covering ≥2 AZs in your VPC.
  2. Create SG aurora-lab-sg: inbound MySQL 3306 from your EC2 SG or CloudShell/VPN SG only — not 0.0.0.0/0.

B. Create cluster

  1. RDS → Databases → Create database.
  2. Engine: Amazon Aurora → Aurora (MySQL compatible). Pick a current Aurora MySQL version.
  3. Templates: Dev/Test.
  4. DB cluster identifier: lab-aurora-mysql. Master username: admin. Master password: long random — save in a password manager.
  5. Instance class: smallest burstable offered (e.g. db.t3.medium or db.t4g.medium).
  6. Multi-AZ / Aurora Replica: create don’t create an Aurora Replica for this lab (cheaper).
  7. Connectivity: same VPC, subnet group lab-aurora-subnets, Public access: No, SG aurora-lab-sg.
  8. Additional: uncheck “Enable Enhanced Monitoring” extras if you want lower noise; leave encryption default on. Create database.
  9. Wait until Status = Available (several minutes).

C. Endpoints

  1. Open the cluster → Connectivity & security. Copy Writer endpoint (and Reader if any).
  2. From an EC2 in the same VPC (with mysql client):
sudo dnf install -y mariadb105  # or mysql client package available
mysql -h WRITER_ENDPOINT -u admin -p
# then:
SHOW DATABASES;
CREATE DATABASE labdb;
USE labdb;
CREATE TABLE t(id INT PRIMARY KEY, note VARCHAR(40));
INSERT INTO t VALUES (1,'aurora-lab');
SELECT * FROM t;
EXIT;

Expected: row 1 | aurora-lab. If timeout — fix SG source and confirm EC2 is in a subnet that can route to the DB subnets.

Cleanup (required)

  1. RDS → select cluster lab-aurora-mysql → Actions → Delete.
  2. Uncheck “Create final snapshot” for a disposable lab (or take one if you want practice). Confirm by typing the name.
  3. Also delete remaining instances if the console asks separately. Delete subnet group and SG when unused.
  4. Billing → verify Aurora charges stop after deletion propagates.

2. Interview angles

Q. Writer endpoint used for?

INSERT/UPDATE/DDL — single writer.

Q. Public access No — why?

DB stays private; jump via EC2/VPN/bastion.

Q. Why Dev/Test template?

Fewer HA extras; lower lab cost.

Q. Forgot to delete?

Hourly instance + storage charges continue.

Try at home

  1. Repeat with Aurora PostgreSQL if free time (then delete).
  2. Screenshot endpoints only — never commit passwords to git.

In short

  1. Dev/Test Aurora MySQL → writer endpoint → mysql client.
  2. SG least privilege on 3306.
  3. Delete cluster the same session.

Practice Tasks

About this scenario

New York News Daily is a media business in New York. Rachel Cohen looks after its IT and cloud work. They count money in USD and run their AWS resources in the us-east-1 Region. In the tasks below you do real jobs for them using what this lesson teaches. All names, account IDs, IP addresses and numbers are made up for practice.

0 / 12

Easy Find the database endpoint

Why: Your app connects using the endpoint name, not an IP.

What to do: Describe DB instance nynewsdaily-db.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Easy Biggest orders first

Why: Querying the database is daily work after you set up RDS.

What to do: Show order id and amount, biggest amount first.

Tables: customers(id, name, city) and orders(id, customer_id, amount, odate).

How:
  1. Find the table the task is about (see the table list above the box).
  2. Write the SQL statement step by step: what, from where, which rows.
  3. End the statement with ;
  4. Click Check answer. Your query runs on a practice copy of the table.

Easy Filter customers by city

Why: Querying the database is daily work after you set up RDS.

What to do: List the names of customers in Pune.

Tables: customers(id, name, city) and orders(id, customer_id, amount, odate).

How:
  1. Find the table the task is about (see the table list above the box).
  2. Write the SQL statement step by step: what, from where, which rows.
  3. End the statement with ;
  4. Click Check answer. Your query runs on a practice copy of the table.

Medium Remove small orders

Why: Querying the database is daily work after you set up RDS.

What to do: Delete orders with amount below 200.

Tables: customers(id, name, city) and orders(id, customer_id, amount, odate).

How:
  1. Find the table the task is about (see the table list above the box).
  2. Write the SQL statement step by step: what, from where, which rows.
  3. End the statement with ;
  4. Click Check answer. Your query runs on a practice copy of the table.

Medium Orders with customer names

Why: Querying the database is daily work after you set up RDS.

What to do: Show each customer name with each order amount.

Tables: customers(id, name, city) and orders(id, customer_id, amount, odate).

How:
  1. Find the table the task is about (see the table list above the box).
  2. Write the SQL statement step by step: what, from where, which rows.
  3. End the statement with ;
  4. Click Check answer. Your query runs on a practice copy of the table.

Medium Total sales

Why: Querying the database is daily work after you set up RDS.

What to do: Show the total of all order amounts as one number.

Tables: customers(id, name, city) and orders(id, customer_id, amount, odate).

How:
  1. Find the table the task is about (see the table list above the box).
  2. Write the SQL statement step by step: what, from where, which rows.
  3. End the statement with ;
  4. Click Check answer. Your query runs on a practice copy of the table.

Medium Fix a city

Why: Querying the database is daily work after you set up RDS.

What to do: Customer 5 moved to Rome. Update the record.

Tables: customers(id, name, city) and orders(id, customer_id, amount, odate).

How:
  1. Find the table the task is about (see the table list above the box).
  2. Write the SQL statement step by step: what, from where, which rows.
  3. End the statement with ;
  4. Click Check answer. Your query runs on a practice copy of the table.

Medium Turn on Multi-AZ

Why: Multi-AZ keeps a standby copy in another AZ and fails over automatically.

What to do: Modify nynewsdaily-db to be Multi-AZ and apply the change immediately.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Hard Sales per customer

Why: Querying the database is daily work after you set up RDS.

What to do: Show customer_id and total amount per customer, only where total is above 1000.

Tables: customers(id, name, city) and orders(id, customer_id, amount, odate).

How:
  1. Find the table the task is about (see the table list above the box).
  2. Write the SQL statement step by step: what, from where, which rows.
  3. End the statement with ;
  4. Click Check answer. Your query runs on a practice copy of the table.

Hard Customers with no orders

Why: Querying the database is daily work after you set up RDS.

What to do: List names of customers who have never ordered.

Tables: customers(id, name, city) and orders(id, customer_id, amount, odate).

How:
  1. Find the table the task is about (see the table list above the box).
  2. Write the SQL statement step by step: what, from where, which rows.
  3. End the statement with ;
  4. Click Check answer. Your query runs on a practice copy of the table.

Hard Create a MySQL database

Why: RDS runs the database for you: backups, patches and failover are managed.

What to do: Create RDS instance nynewsdaily-db: engine mysql, class db.t3.micro, 20 GiB storage, master user admin, master password from $DB_PASS.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Hard Create a read replica

Why: Read replicas take report and read traffic off the main database.

What to do: Create read replica nynewsdaily-db-ro from source nynewsdaily-db.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Revision, comparison and interview cards

Revise this lesson in a few minutes. Save the cards on your phone or download them as PNG files. The QR code on each card opens this lesson.

Revision card: Create Aurora cluster step by step. Clicking Production defaults in a student account burns money fast. In ap-south-1 create an Aurora MySQL cluster with Dev/Test template, small class, strong master password, and note the endpoints. RDS console → Create database → Aurora MySQL → Dev/Test → set master user/password → create. Copy cluster endpoint. Describe-db-clusters shows available; endpoint hostname ends with rds.amazonaws.com.
Revision card: Create Aurora cluster step by step · Download PNG · Open card page
Revision card: Connect and run a query. A cluster that nobody queries teaches nothing — and security groups often block you. Allow the client SG or CloudShell path to port 3306/5432. Use mysql/psql against the cluster endpoint with SSL as required. From EC2 or notes: mysql -h CLUSTER_ENDPOINT -u admin -p → CREATE DATABASE lab; SELECT 1; Query returns 1; a lab table insert is visible on a reconnect.
Revision card: Connect and run a query · Download PNG · Open card page
Revision card: Delete Aurora so billing stops. Aurora instances and storage keep costing after you close the laptop. Delete the DB instance(s) and the cluster. Skip final snapshot for a pure lab if policy allows; never leave Dev/Test clusters for weeks. Actions → Delete cluster/instances → confirm. Verify RDS console list is empty for the lab. Next-day Cost Explorer shows no ongoing Aurora instance hours for that id.
Revision card: Delete Aurora so billing stops · Download PNG · Open card page
Comparison: Aurora provisioned vs Aurora Serverless v2. Aurora provisioned: Fixed instance class you choose. Aurora Serverless v2: Scales in ACU within min/max.
Comparison: Aurora provisioned vs Aurora Serverless v2 · Download PNG · Open card page
Interview card: Why Dev/Test template in the lab?. Production defaults pick larger instances and extras that burn student budgets. Dev/Test keeps size and features appropriate for learning and quick delete. Create database → Aurora → Dev/Test → delete the same day after SELECT 1.
Interview card: Why Dev/Test template in the lab? · Download PNG · Open card page
Interview card: Cluster endpoint vs instance endpoint?. Cluster endpoint points at the current writer; instance endpoints target a specific instance. Apps usually use the cluster endpoint so failover moves the writer automatically. mysql -h cluster-endpoint … for writes; optional reader endpoint for read scale.
Interview card: Cluster endpoint vs instance endpoint? · Download PNG · Open card page

More cards: Ravi Sir's Cards.