> ## Documentation Index
> Fetch the complete documentation index at: https://cloud-architect.ipoint-labs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS RDS MySQL Lab Challenge

> Hands-on lab · 45m

Launch this lab in the IP Lab Portal, then follow the steps below in the AWS console.

<a className="ip-lab-portal-btn" href="https://labs.intellectualpoint.com/labs/aws-rds-mysql-lab-challenge" target="_blank" rel="noreferrer">
  Open IP Lab Portal
</a>

## Overview

### Prerequisites

1. Good knowledge of AWS services

* RDS Database
* Security groups
* AWS Lambda

2. Laptop/Desktop
3. Internet Browser
4. Internet connection
5. For testing this lab, it is necessary to download the MySQL GUI Tool. To download it, go to the [Download MySQL Workbench page](https://dev.mysql.com/downloads/workbench/). Based on your OS, select the respective option under Generally Available (GA) Releases. Download and Install.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/qRudZfyc-Pm9Aad9/images/labs/aws-rds-mysql-lab-challenge/001.png?fit=max&auto=format&n=qRudZfyc-Pm9Aad9&q=85&s=5f5026d738531ce4c65e2eddb320731c" alt="" width="489" height="211" data-path="images/labs/aws-rds-mysql-lab-challenge/001.png" />

### Challenge Instructions

1. **Region**: Make sure to use **the us-east-1** region to create all the resources.
2. You will be provided with the requirements of the challenge. If you are new to AWS Cloud, we recommend you go through our hands-on Labs before taking this challenge.
3. **Challenge Duration: 60 minutes**

### How to submit the challenge

1. After building the infrastructure, click on the **Check my work** button, to validate if you have built the required infrastructure and completed the challenge successfully.
2. Validation status

   * **Success** - You have completed the challenge successfully.
   * **Failed** - You have failed to complete the challenge.
3. Once you have successfully validated the challenge, click on **End lab** button.

### Launching Challenge Environment

1. To launch the challenge environment, Click on the **Launch lab** button.
2. Please wait until the cloud environment is provisioned. It will take less than a minute to provision.
3. Once the challenge is started, you will be provided with **IAM user name**, **Password**, **Access** **Key**, and **Secret** **Access** **Key**.

<Note>
  You can only start one challenge at any given time
</Note>

## Files you need

Download these before you start — the lab cannot be completed without them.

* [Download Zip](/images/labs/downloads/aws-rds-mysql-lab-challenge/download-zip.zip)
* [Download Zip 2](/images/labs/downloads/aws-rds-mysql-lab-challenge/download-zip-2.py)

## Lab guide

### Sign in to the AWS Management Console

1. Click on the **Open console** button, and you will get redirected to AWS Console in a new browser tab.
2. On the AWS sign-in page,

* Leave the Account ID as default. Never edit/remove the 12 digit Account ID present in the AWS Console. otherwise, you cannot proceed with the lab.
* Now copy your **User Name** and **Password** in the Lab Console to the **IAM Username and Password** in AWS Console and click on the **Sign in** button.

3. Once Signed In to the AWS Management Console, Make the default AWS Region as **US East (N. Virginia) us-east-1.**

### Cloud Challenge Details

In this lab challenge, your Amazon RDS MySQL and AWS Lambda skills are put to the test. You'll be given a requirement and you have to reach it using your knowledge of AWS RDS and other AWS services relevant to working with MySQL Workbench. The Lab Challenge helps you understand real-time scenarios.

**A company XYZ is deploying a new web application. As a part of the infrastructure, they need a database for their testing environment. Now your challenge is to set up an AWS    RDS MySQL database to create a table and insert their data using MySQL Workbench.**

1. Create a VPC **security group** that allows MySQL port from the source **0.0.0.0/0**. Use this security group during DB instance creation.
2. One Lambda role i.e. **task-10035-lambda-role-XXXXX** is already created for you.
3. Create an **Amazon RDS DB instance** with **db.t3.micro**.
4. Connecting to **RDS** Database on a DB Instance using the **MySQL Workbench** and Use below MySQl Command in query tab:

CREATE DATABASE StudentDB;

Use StudentDB;

CREATE TABLE students (

studentId INT AUTO\_INCREMENT,

studentName VARCHAR(50) NOT NULL,

Course VARCHAR(55),

Semester VARCHAR(50) NOT NULL,

PRIMARY KEY (studentId)

);

INSERT INTO students(studentName, Course, Semester) VALUES ('Paul', 'MBA', 'Second');

INSERT INTO students(studentName, Course, Semester) VALUES ('John', 'IT', 'Third');

INSERT INTO students(studentName, Course, Semester) VALUES ('Sebastian', 'Medicine', 'fifth');

SELECT \* FROM students;

5. Create a **lambda Function** :

   * Select Runtime : **Python 3.8**.
   * Click on this link [**Function code**](/images/labs/downloads/aws-rds-mysql-lab-challenge/download-zip.zip)  to download the Lambda zip code and Upload the Zip file
   * Replace the endpoint, username & password
   * Test the Function
6. Replace the existing code with [**Lambda Code 2**](/images/labs/downloads/aws-rds-mysql-lab-challenge/download-zip-2.py) and Test it.
7. Navigate to the MySQL Workbench application and replace the existing query with the below:

Use StudentDB;

SELECT \* FROM students;

8. Click on Validate to complete the challenge.

### End lab

1. Sign out of the AWS Account
2. You have successfully completed the lab.
3. Once you have completed the steps, click on **End lab** in the IP Lab Portal.

## What gets checked

When you press **Check my work**, the platform verifies each of these:

* **Launch RDS instance** — Check whether an RDS Instance is created or not
* **Check whether RDS database Engine type is mysql** — Check whether allowed database type mysql is deployed or not
* **Create an AWS Lambda Function** — Check whether a Lambda Function is created or not

## Related help

* [FAQs and Troubleshooting](/aws-cp/support/faqs-and-troubleshooting)
