AWS re/Start Lab · Bases de Datos

Introducción a Amazon Aurora

Creación de una instancia de Amazon Aurora (compatible con MySQL), configuración de conectividad desde EC2 mediante Session Manager y consulta de datos con SQL.

Lab Summary

Created an Amazon Aurora MySQL-compatible cluster through the Amazon RDS console, connected to an EC2 instance via Session Manager, installed the MariaDB client, and executed DDL and DML statements against the world database.

Aurora Instance Setup

Creating an Aurora MySQL-compatible cluster with the proper VPC and security group configuration.

SQL Query Workflow

Installing the MariaDB client on EC2, connecting via the cluster endpoint, and running DDL/DML operations against the world database.

AWS Services Used

Amazon Aurora

Fully managed, MySQL-compatible relational database with up to 5x MySQL performance.

Amazon RDS

Managed relational database service that handles setup, operation, and scaling.

Amazon EC2

Virtual compute instance used as the client to connect to Aurora.

Step-by-Step Walkthrough

Detailed documentation of the four tasks: creating the Aurora cluster, connecting to EC2, configuring the client, and querying data.

01

Create an Aurora instance

  • Navigated to RDS in the AWS Management Console.
  • Created a database with the Standard create method.
  • Selected Aurora (MySQL Compatible) with MySQL 8.0.
  • Configured cluster identifier: aurora, master username: admin, password: admin123.
  • Selected the Dev/Test template and Burstable classes db.t3.medium.
  • Disabled Multi-AZ Replica (not needed for a lab environment).
  • In Connectivity: selected LabVPC, dbsubnetgroup, No public access, removed the default security group, and added DBSecurityGroup.
  • Disabled Enhanced Monitoring, set initial database name: world.
  • Disabled encryption and auto minor version upgrade.
02

Connect to an Amazon EC2 Linux instance

  • Connected to the Command Host EC2 instance via Session Manager (following the standard EC2 connection workflow).
03

Configure the EC2 instance to connect to Aurora

  • Installed the MariaDB client: sudo yum install mariadb -y
  • Copied the writer endpoint from the Aurora cluster's Connectivity & security tab.
Cluster endpoints The cluster endpoint connects to the current primary DB instance for write operations. The reader endpoint load-balances read-only queries across replicas. For this lab with a single instance, both endpoints route to the same instance.
  • Connected to Aurora: mysql -u admin --password='admin123' -h <cluster-endpoint>
04

Create a table and insert and query records

  • Listed databases with SHOW DATABASES; (observed the world database).
  • Switched to the target database: USE world;
  • Created the country table with columns for Code, Name, Continent, Region, SurfaceArea, IndepYear, Population, LifeExpectancy, GNP, GNPOld, LocalName, GovernmentForm, Capital, and Code2. Set Code as the PRIMARY KEY.
  • Inserted 5 rows: Gabon, Ireland, Thailand, Costa Rica, and Australia.
  • Ran the query: SELECT * FROM country WHERE GNP > 35000 and Population > 10000000;
  • The query returned Australia and Thailand, the two countries meeting both conditions.

Query Reference

SQL statements and connection commands used during the lab.

SQL

SHOW DATABASES;

Lists all databases on the Aurora instance.

SQL

USE world;

Switches the active database context to world.

SQL

CREATE TABLE country (...)

Defines the country table schema with 14 columns and Code as the primary key.

SQL

INSERT INTO country VALUES (...)

Inserts country records into the table (Gabon, Ireland, Thailand, Costa Rica, Australia).

SQL

SELECT * FROM country WHERE GNP > 35000 and Population > 10000000;

Filters countries by GNP and population thresholds, returning Australia and Thailand.

CLI

mysql -u admin --password='admin123' -h <endpoint>

Connects to the Aurora cluster via the MariaDB client.

  • -u : Username
  • -p : Password
  • -h : Host (cluster endpoint)

Key Learnings

What was learned

How to create an Aurora MySQL-compatible cluster in the AWS console
How Aurora cluster endpoints work (writer for DDL/DML, reader for read-only queries)
How to install and use the MariaDB client to connect to Aurora from EC2
How to execute DDL (CREATE TABLE) and DML (INSERT, SELECT) against an Aurora database

Technical Conclusion

Amazon Aurora is a managed MySQL-compatible database that simplifies administrative tasks such as patching, backups, and scaling while providing high performance. Combining RDS/Aurora with EC2 creates a complete client-server database workflow: the database layer handles persistent storage and structured querying, while the compute layer provides a secure, interactive environment for administration and application logic.