Hands-On Lab1,056 words

Hands-On Lab: Provisioning AWS Database Services (RDS & DynamoDB)

AWS database services

Hands-On Lab: Provisioning AWS Database Services (RDS & DynamoDB)

Welcome to this guided hands-On lab! In this session, you will explore the AWS core database services covered in the AWS Certified Cloud Practitioner (CLF-C02) exam. You will gain practical experience deciding between and provisioning both relational (Amazon RDS) and non-relational/NoSQL (Amazon DynamoDB) managed databases.

Prerequisites

Before starting this lab, ensure you have the following:

  • AWS Account: An active AWS account. (Free-tier eligible is recommended).
  • IAM Permissions: An IAM user or role with AdministratorAccess or specific full access to RDS and DynamoDB.
  • AWS CLI: The AWS Command Line Interface installed and configured (aws configure) with your Access Key, Secret Key, and default region (e.g., us-east-1).
  • Basic Knowledge: Familiarity with basic database concepts (rows, columns, key-value stores).

Learning Objectives

By completing this lab, you will be able to:

  1. Provision a fully managed NoSQL database using Amazon DynamoDB.
  2. Provision a managed relational database instance using Amazon RDS.
  3. Compare the deployment speeds and configuration requirements of relational vs. non-relational services.
  4. Navigate both the AWS CLI and the AWS Management Console to manage database resources.

Architecture Overview

In this lab, you will act as a Cloud Practitioner deploying two different database models to support a hypothetical application.

Loading Diagram...

Database Selection Decision Tree

The following flowchart illustrates the decision-making process for choosing an AWS database service, based on the requirements discussed in the CLF-C02 curriculum:

Loading Diagram...

Step-by-Step Instructions

Step 1: Create a DynamoDB Table

Amazon DynamoDB is a fast, flexible NoSQL database service. Because it is serverless, provisioning a table takes only seconds. We will create a table to store user profiles.

bash
aws dynamodb create-table \ --table-name brainybee-lab-users \ --attribute-definitions AttributeName=UserId,AttributeType=S \ --key-schema AttributeName=UserId,KeyType=HASH \ --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 \ --region us-east-1

[!TIP] In the CLI command above, AttributeType=S denotes that the UserId partition key is a String.

📸 Screenshot: You should see a JSON output showing the TableStatus as CREATING or ACTIVE.

🖥️ Console alternative
  1. Log in to the AWS Management Console.
  2. Search for and navigate to DynamoDB.
  3. Click Create table.
  4. Enter Table name: brainybee-lab-users.
  5. Enter Partition key: UserId (Leave type as String).
  6. Leave default settings and click Create table.

Step 2: Insert Data into DynamoDB

Unlike relational databases, DynamoDB does not require you to define all columns before adding data. You can insert varied attributes on the fly.

bash
aws dynamodb put-item \ --table-name brainybee-lab-users \ --item '{"UserId": {"S": "user_001"}, "Name": {"S": "Ada Lovelace"}, "Role": {"S": "Cloud Engineer"}}' \ --region us-east-1
🖥️ Console alternative
  1. In the DynamoDB console, click on Explore items in the left sidebar.
  2. Select the brainybee-lab-users table.
  3. Click Create item.
  4. Add the UserId value as user_001.
  5. Click Add new attribute -> String to add Name and Role.
  6. Click Create item.

Step 3: Provision an Amazon RDS Instance

Amazon RDS allows you to launch relational databases (like MySQL, PostgreSQL, or SQL Server) without worrying about hardware provisioning or OS patching. We will launch a small MySQL database.

Note: RDS instances take several minutes to provision because AWS is deploying a managed compute instance in the background.

bash
aws rds create-db-instance \ --db-instance-identifier brainybee-lab-db \ --db-instance-class db.t3.micro \ --engine mysql \ --master-username admin \ --master-user-password LabPassword123! \ --allocated-storage 20 \ --no-multi-az \ --region us-east-1

[!IMPORTANT] We are using --no-multi-az to keep costs low and provisioning fast. In a production environment, you would enable Multi-AZ for high availability and synchronous replication to a standby instance in a different Availability Zone.

📸 Screenshot: Look for the DBInstanceStatus field in the CLI output. It will initially say creating.

🖥️ Console alternative
  1. Navigate to RDS in the AWS Management Console.
  2. Click Create database.
  3. Choose Standard create and select the MySQL engine.
  4. Under Templates, choose Free tier.
  5. Enter DB instance identifier: brainybee-lab-db.
  6. Enter Master username admin and password LabPassword123!.
  7. Leave instance configuration as db.t3.micro.
  8. Click Create database at the bottom.

Checkpoints

Verify that your resources have been successfully provisioned.

Checkpoint 1: Verify DynamoDB Table Check if your DynamoDB table is active and contains the item you added.

bash
aws dynamodb scan --table-name brainybee-lab-users --region us-east-1

Expected Result: A JSON response showing Count: 1 and the item details for Ada Lovelace.

Checkpoint 2: Verify RDS Instance Status Check if your RDS instance has finished creating. (This may take 5-10 minutes).

bash
aws rds describe-db-instances \ --db-instance-identifier brainybee-lab-db \ --query 'DBInstances[*].[DBInstanceStatus,Endpoint.Address]' \ --region us-east-1

Expected Result: The status should eventually transition from creating to available, and an endpoint address will be populated.


Clean-Up / Teardown

[!WARNING] Cost Warning: Remember to run the teardown commands to avoid ongoing charges. RDS instances incur hourly charges if left running outside of the Free Tier. DynamoDB charges for provisioned capacity.

Execute the following commands to delete the resources created in this lab:

1. Delete the DynamoDB Table

bash
aws dynamodb delete-table \ --table-name brainybee-lab-users \ --region us-east-1

2. Delete the RDS Instance

To delete the database without creating a final backup snapshot, use the --skip-final-snapshot flag.

bash
aws rds delete-db-instance \ --db-instance-identifier brainybee-lab-db \ --skip-final-snapshot \ --region us-east-1

Verify deletion by checking the AWS Console. The RDS instance status will change to deleting before it disappears.


Troubleshooting

Common ErrorLikely CauseSolution
AccessDeniedExceptionThe IAM user configuring the CLI lacks sufficient permissions.Ensure your IAM user has AmazonDynamoDBFullAccess and AmazonRDSFullAccess (or Administrator access).
InvalidParameterValue (RDS)The provided RDS password does not meet complexity requirements.Ensure the password is at least 8 characters long and contains letters and numbers (e.g., LabPassword123!).
ResourceNotFoundException (DynamoDB)Table creation is still pending, or you specified the wrong region.Wait 10 seconds and try again, or ensure --region us-east-1 is appended to your command.
VPCIdNotSpecified (RDS)Your account might lack a default VPC in the specified region.Use the AWS Management console to create the RDS instance, which allows you to easily select an existing VPC.

Concept Review

Before you finish, review how these two services align with the AWS Certified Cloud Practitioner requirements:

FeatureAmazon RDS (Relational)Amazon DynamoDB (Non-Relational)
Data StructureTables with strict columns and rows (Schemas)Collections of key-value pairs or documents (Schemaless)
Use CaseComplex transactions, ERP, CRM, legacy applicationsHigh-traffic web apps, gaming, IoT, real-time bidding
ManagementFully managed underlying OS, but requires choosing instance types (Compute)Fully managed and serverless; scale based on read/write units
High AvailabilityAchieved by provisioning a Multi-AZ standby instanceNatively distributed and replicated across 3 AZs by default

Excellent work! You have successfully deployed and torn down core AWS database services using both the CLI and Console methodologies.

Ready to study AWS Certified Cloud Practitioner (CLF-C02)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free