> ## 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.

# Export Amazon RDS DB Snapshot to S3

> 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/export-amazon-rds-db-snapshot-to-s3" target="_blank" rel="noreferrer">
  Open IP Lab Portal
</a>

## Overview

### Lab Details

1. This lab walks you through the steps to export the RDS DB snapshot to S3.
2. In this lab, you will practice creating an Amazon RDS DB Instance, Amazon S3 Bucket, AWS KMS Key.
3. Duration: **2 hours**
4. AWS Region: **US East (N. Virginia) us-east-1**

### Introduction

1. All types of RDS Backups can be exported to S3 whether they are Automated Backups, Manual Backups or those created by AWS Backup service.
2. Steps to export to s3:

   * We have to create an Amazon S3 Bucket with the required IAM permissions and create a KMS key for server-side encryption (SSE).
   * The Snapshot can be exported either via Console or CLI commands.
3. The Export runs in the background. It does not affect any kind of database performance.
4. The data which is exported to S3 is always in the Apache Parquet format. Parquet format is 2 times faster to export and consumes up to 6 times less storage in Amazon S3 compared to test formats.
5. The exported data can be analyzed by other AWS services like Amazon Sagemaker, Amazon EMR, and Amazon Athena.

### Architecture Diagram

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/001.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=223cfa60e6489b18bcb5ea03d36f4916" alt="" width="1769" height="1181" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/001.png" />

### Use cases

1. Disaster Recovery
2. Data migration
3. Perform queries on the exported snapshot using AWS services like Amazon Sagemaker, Amazon EMR, and Amazon Athena.

### Task Details

1. Sign in to AWS Management Console.
2. Create an Amazon S3 Bucket.
3. Create an AWS KMS Key.
4. Create a Security group for RDS DB Instance.
5. Create an Amazon RDS DB Instance.
6. Take a snapshot from an existing DB Instance.
7. Create a sample database and a table.
8. Export the Snapshot to S3.
9. Deleting AWS resources

### Pre-requisites

1. 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/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/002.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=ec4d545d3ff04ff25e8abcda076b3a8c" alt="" width="489" height="211" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/002.png" />

### Launching Lab Environment

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

> **Note** : You can only start one lab at any given time

## Lab guide

### Lab Steps

#### Task 1: Sign in to 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.**

#### Task 2: Create an Amazon S3 Bucket

1. Navigate to the **Services** menu at the top. Click on **S3** under the **Storage** section.

2. On the S3 Page, click on **Create bucket** and fill in the bucket details.

   * Bucket type : **General purpose**
   * Bucket name: Enter ***export-snapshot-demo***

     * **Note:** S3 bucket name is globally unique, choose a name that is available.

3. Object ownership: Select **ACLs disabled (recommended)** option.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/003.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=5376656a42fe5bda7b2ff8a30f42864c" alt="" width="1852" height="730" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/003.png" />

4. Leave all the other settings as default.

5. Click **Create bucket** button.

#### Task 3: Create an KMS Key

1. Navigate to the **Services** menu on the top. Click on **Key Management Service** under the **Security, Identity, & Compliance** section.
2. In the KMS console, navigate to **Customer managed keys** and click on **Create Key**.

**Note:** Ignore, if any other customer managed keys present in the account. It will take some time to delete the keys.

3. Select the **Key Type** as **Symmetric** and click on **Next**.
4. Under the **Add Labels**, give the following details:

   * Alias: Enter ***kmskey\_1*** (Change the name, if there is a key present with the same name)
   * Description: Enter ***Used for RDS Snapshot exports to S3 of the "database-demo" DB Instance***
   * Click on **Next**.

     > **Note :** Ignore if any error message appear like below.

     <img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/004.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=0e2c31bd41bc8019d725151376d9788e" alt="" width="3008" height="1052" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/004.png" />
5. Leave **Define key administrative permissions** as default and click on **Next**.
6. Leave **Define key usage permissions** as default and click on **Next**.
7. Leave **Edit key policy** as default and click on **Next**.
8. Click on the **Finish** button.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/005.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=f85d4df706045539c1aa177c1f47e05e" alt="" width="1530" height="346" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/005.png" />

   > **Note :** Ignore if any error message appear like below.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/006.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=fda8fc8fb56b660ac2caf7c46a816684" alt="" width="2926" height="406" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/006.png" />

   Click on the created KMS key. Copy the ARN and keep it for future reference.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/007.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=c6ea5a0c2723f09c3cce033fa957d159" alt="" width="1502" height="451" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/007.png" />

#### Task 4: Create a Security group for RDS DB Instance

1. In this task, you  are going to create a Security group for RDS with a 3306 port number enabled
2. Navigate to **EC2** by clicking on the **Services** menu, under the **Compute** section.
3. On the left panel menu, select the **security group** under the Network **& Security** section.
4. Click on the  **Create Security group** button.
5. In the security group page,

   * **Security group name**: Enter ***RDS\_sg***
   * **Description**: Enter ***Security group for RDS***
   * **VPC**: Select **Default VPC**

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/008.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=7a4ebe3255338eaf36081befc46a6589" alt="" width="761" height="402" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/008.png" />

* Click on the **Add Rule** button under **Inbound rules.**

  * Type: Select **MYSQL/Aurora**
  * Source: Select **Anywhere-IPv4**
  * In the textbox add **0.0.0.0/0**
* **Leave the outbound rules as it is.**

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/009.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=eb7f4012ccc201d219196c2924009094" alt="" width="1248" height="502" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/009.png" />

6.Leave everything as default and click on the **Create security group** button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/010.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=0eeec57e1f1dc58023344a5d17612a3f" alt="" width="1575" height="657" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/010.png" />

#### Task 5: Create an Amazon RDS DB Instance

1. Navigate to the **Services** menu at the top left corner and click on **Aurora and RDS** present under the **Database** section.

2. RDS dashboard is displayed.

3. Click on the **Create database** button and you are navigated to the page where you will provide all the required details to create a MySQL database.

4. On the page, click on the option **Standard create** a method for our lab requirement.

5. In the **Engine options**, select **MySQL** engine type.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/011.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=7c07166930cc6211e0b5eaaa1165e626" alt="" width="1857" height="711" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/011.png" />

6. **Edition**: Leave it as default

7. Under **Templates**, select **Sandbox** option.

8. Under **Settings**, provide the following details.

* DB instance identifier: Enter ***demo-db***
* Master username: Enter ***whizlabs***
* Master password: Enter ***Whizlabs123***
* Confirm password: Enter ***Whizlabs123***

**Note** - Make sure the master and confirm passwords should be the same. **Make a note of the username and password for later use**.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/012.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=b10f31a9ecfdaeeed495d66be7603c65" alt="" width="1806" height="737" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/012.png" />

9. Under **DB instance class**, select **Burstable classes (including t classes)** and select **db.t3.micro**

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/013.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=eec5a487439123c8553d06811de2bfd0" alt="" width="1205" height="430" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/013.png" />

10. Under **Storage**,

    * Storage type: **General Purpose (SSD)**
    * Allocated storage: **20**
    * Uncheck **Enable storage autoscaling**.

      <img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/014.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=797db5f0a55fb0103781dac798e82497" alt="" width="1256" height="451" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/014.png" />

11. Leave the **Availability and durability** as default.

12. Under **Connectivity**:

    * **Network & Security**

      * Virtual Private Cloud (VPC): **default VPC**
      * Subnet group: **default**
      * Public accessibility: Choose **Yes** (Important)
      * VPC security groups: Select **Choose existing**
        **Remove the default one and select** ***RDS\_sg*** **instead.**

* Availability zone: default **No Preference.**

  <img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/015.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=0138a937c4ba2755923b8b3c347e1e68" alt="" width="1271" height="515" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/015.png" />

13. Leave **Database Authentication** as default.
14. Expand the **Additional configuration**.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/016.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=503c90af186e7ffa3f75069f202bfc2e" alt="" width="685" height="82" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/016.png" />

15. In the displayed layout provide the following values under **Database options**.

* Initial database name: Enter ***demodb***
* Leave **DB parameter group** and **Option group** as default.
* Under **Backup**, uncheck **Enable automated backups.**
* Leave other settings as **default**.
* Uncheck **Deletion protection**.

16. Click on **Create database** button to create the database.  This process does take time between 5-10 minutes.
17. Once the database is created the status changes to **Available**.

    <img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/017.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=38178965fdc3d46b82d8d9ea44453de0" alt="" width="1034" height="211" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/017.png" />
18. Click on the database identifier demo-db and **copy the database endpoint**.

#### Task 6: Connect to RDS Database using the MySQL Workbench

In this example, we will connect to a database on a MySQL DB instance using MySQL monitor commands. One GUI-based application you can use to connect is MySQL workbench, which you have already downloaded and installed based on instructions in the prerequisite section.

1. To connect to a database on a DB instance using MySQL monitor, find the endpoint (DNS name) and port number for your DB Instance.

   * Navigate to **Databases** and click on the created **demo-db.**
   * Under **Connectivity & security** section, copy and note the **endpoint** and **port**.

     * Endpoint: demo-db.c7owzvjtjkvz.us-east-1.rds.amazonaws.com
     * Port: **3306**
     * You need both the endpoint and the port number to connect to the DB instance.
2. Open MySQL Workbench. Click on the **MYSQL Connection** plus icon.

   * Connection Name    : Enter a sample name ***MyDBConnection***.
   * Host Name: Enter the endpoint: **demo-db.c03iqoooef9u.us-east-1.rds.amazonaws.com**
   * Port: **3306**
   * Username: Enter ***whizlabs***
   * Password: Click on Store in Vault option and enter a password - ***Whizlabs123***. Click on **Ok**.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/018.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=1d29aa4e9afa9b1f03a2b8a1663cce29" alt="" width="802" height="500" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/018.png" />

* Click on **Test Connection** to make sure that you are able to connect to the database properly.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/019.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=588c3666f19e86c5669a5364b431cb1d" alt="" width="255" height="385" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/019.png" />

* Click on **OK** and **OK** again to save the connection.

3. A database connection will be created in MySQL Workbench.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/020.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=14066bd774330066871c00a3104d66f0" alt="" width="241" height="88" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/020.png" />

4. Double-click on it to open the database. Enter the database password if prompted.
5. After successfully connecting and opening the database, you can create tables and perform various queries over the connected database.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/021.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=efc6fc8eb10f3741030f814a36da9978" alt="" width="1021" height="695" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/021.png" />

6. Navigate to the **Schemas** tab to see databases available to start doing database operations.

#### Task 7: Create a sample database and a table

1. In the SQL Editor, let us create a sample database and a table for demo purposes.

> **Note: After executing every command, it is necessary to clear the editor and proceed to the next command.**

2. For executing the command press the icon as shown below in the image.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/022.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=83d5532d94dc183ba4f04c94462f01fc" alt="" width="668" height="53" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/022.png" />

3. To see the changes after every execution, click on the Refresh button, right to the **SCHEMAS**.

   > **Note: Please copy-paste the SQL queries carefully, double-check, and remove extra whitespaces.**
4. Create a database:

CREATE DATABASE SchoolDB;

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/023.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=4242cc7b1241302b82ced61af8dbba83" alt="" width="962" height="623" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/023.png" />

6.You can see the created database with the following command:

show databases;

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/024.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=0fa5fab3951d78d311821fe50ab89e05" alt="" width="698" height="533" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/024.png" />

7.Switch to the database named **SchoolDB.**

use SchoolDB;

8.Create a sample table consisting of **Subjects.**

CREATE TABLE IF NOT EXISTS subjects (

subject\_id INT AUTO\_INCREMENT,

subject\_name VARCHAR(255) NOT NULL,

teacher VARCHAR(255),

lesson TEXT,

PRIMARY KEY (subject\_id)

) ENGINE=INNODB;

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/025.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=d27a4a05914dea75330489e4488a03d8" alt="" width="733" height="576" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/025.png" />

* Enter

show tables;

* to see the table you just created.
* Insert some details into the table executing one after the other:

INSERT INTO subjects(subject\_name, teacher, lesson) VALUES ('English', 'John Taylor', 'Chapter one');

INSERT INTO subjects(subject\_name, teacher, lesson) VALUES ('Science', 'Mary Smith', 'Chapter four');

INSERT INTO subjects(subject\_name, teacher, lesson) VALUES ('Maths', 'Ted Miller', 'Chapter ten');

INSERT INTO subjects(subject\_name, teacher, lesson) VALUES ('Arts', 'Suzan Carpenter', 'Chapter seven');

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/026.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=e220853702d75a62c3d099c38912584e" alt="" width="796" height="620" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/026.png" />

* Let's check the items we added to the table:

select \* from subjects;

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/027.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=d7d899a9b3bb2e5be44e94fa77785278" alt="" width="375" height="201" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/027.png" />

9.We have created a sample database and table.

10.Close the database connection by clicking on the **x** symbol.

#### Task 8: Take a Snapshot from the existing DB Instance

1. Let us take a snapshot of the database.
2. Select the created DB Instance and click on **Actions.**
3. Click **Take snapshot** from the options.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/028.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=4cb336494142f9cb17b42c4df2cbfd91" alt="" width="1047" height="271" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/028.png" />

4. Give a name to the snapshot, **demo-db-snapshot**  (give a unique name for validation report purposes) and click on the **Take snapshot** button.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/029.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=c1c521bd14d7ecc461768355d1094764" alt="" width="1868" height="641" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/029.png" />
5. The snapshot creation takes 3-5 minutes. Refresh after some time, the snapshot creation status will be **Available**.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/030.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=12894540af54564b0574564b47a09856" alt="" width="1492" height="330" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/030.png" />

#### Task 9: Export the DB snapshot to S3

1. Let us export the snapshot to S3.

2. Select the created snapshot and click on the **Actions**.

3. Click on **Export to Amazon S3** from the options.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/031.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=5ac8eea72d8d64f66464335e34afd2d3" alt="" width="1531" height="494" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/031.png" />

4. Under **Settings**, give a name to identify the export:

   * Export Identifier: Enter **snap-export-s3**
   * Leave the **Exported data** as default.
   * Under the **S3 destination**, select the created S3 from the drop-down.
   * Under **IAM Role**, choose to **Select an existing role** from the drop-down named as **WhizRole**.

     > **Note: Do not select any other IAM role present instead of WhizRole.**

<img src="https://mintcdn.com/ip-cloud-architect-pathway/4J_NjyMeVcLG0gf_/images/labs/export-amazon-rds-db-snapshot-to-s3/032.png?fit=max&auto=format&n=4J_NjyMeVcLG0gf_&q=85&s=afe7d4eee08165b3ea6813eda1497368" alt="" width="873" height="149" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/032.png" />

5. Select the **created KMS key from the drop-down** or enter the ARN that we noted while creating the key.

> **Note: There may be other keys present, select the one you created in previous steps.**

6. Review all the settings and click on **Export to Amazon S3**.
7. This may take **upto 20-25 minutes** as it is exporting the whole database. You can see a **Complete** status once the export is done.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/m1eiflSdu4MAgXTP/images/labs/export-amazon-rds-db-snapshot-to-s3/033.png?fit=max&auto=format&n=m1eiflSdu4MAgXTP&q=85&s=576efbf83ddcee1367e1211f801195c2" alt="" width="1500" height="415" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/033.png" />

> **Note:** You will be seeing other exports also in the Export to Amazon S3 tab. The reason is, we cannot delete them. Ignore the other exports done, if you see them.

#### Task 10: Check the exported data in Amazon S3

1. Once the export is completed, navigate to the created S3 Bucket.

2. You will be able to see a folder with the name of the export identifier.

3. When clicked on that, you can see 2 JSON files.

   * The **First JSON file** is the **final report of the export task**.
   * The **Second JSON file** gives us information about the **individual table including overall size and the data type mappings**.

4. You can see the **SchoolDB** database we created earlier.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/m1eiflSdu4MAgXTP/images/labs/export-amazon-rds-db-snapshot-to-s3/034.png?fit=max&auto=format&n=m1eiflSdu4MAgXTP&q=85&s=00a78237014149244bb99d27a88bdd71" alt="" width="1596" height="631" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/034.png" />

5. In this way, we can export the snapshots to S3.

> ##### Do you know?
>
> Cross-Region Snapshot Exports: By default, you can export an RDS DB snapshot to an S3 bucket in the same AWS Region. However, if you need to export the snapshot to an S3 bucket in a different AWS Region, you can leverage the AWS Data Pipeline service. It allows you to create a pipeline that copies the snapshot to a different region.

#### Task 11: Delete AWS Resources

##### Deleting the DB Instance

1. Click on **Databases** present to the left of the screen.
2. Select the DB Instance and click on **Actions**.
3. Click on the **Delete** option.
4. Uncheck the Create final snapshot option.
5. Check the Acknowledge box.
6. Confirm the deletion by entering **delete me** and click on **delete**.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/m1eiflSdu4MAgXTP/images/labs/export-amazon-rds-db-snapshot-to-s3/036.png?fit=max&auto=format&n=m1eiflSdu4MAgXTP&q=85&s=b2100cd3bbcbb65cf5a3348cec0e6212" alt="" width="652" height="525" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/036.png" />

7. The status changes to **deleting** and the DB Instance gets deleted.
8. You can proceed to further steps even if it is in a **deleting** state.

##### Deleting the Snapshot

1. Click on the **Snapshots** on the left of your screen. Under **Manual snapshots**, select the unencrypted snapshot and click on **Actions**.
2. Click on the **Delete snapshot** option.
3. Confirm by clicking on the **Delete** button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/m1eiflSdu4MAgXTP/images/labs/export-amazon-rds-db-snapshot-to-s3/037.png?fit=max&auto=format&n=m1eiflSdu4MAgXTP&q=85&s=06637b414a869eb7756902c0f60353cd" alt="" width="599" height="211" data-path="images/labs/export-amazon-rds-db-snapshot-to-s3/037.png" />

### Completion and Conclusion

1. You have created an S3 Bucket to store the backup of exports.
2. You have created a Customer managed KMS key.
3. You have created an Amazon RDS DB Instance.
4. You have taken the snapshot of the DB Instance.
5. You have exported the snapshot to Amazon S3.
6. You have checked the exported data in the S3 Bucket.

### End Lab

1. Sign out of AWS Management Console.
2. You have successfully completed the lab.
3. Once you have completed the steps, click on **End Lab** from your IP Lab Portal and wait till the process gets completed.

## What gets checked

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

* **Create Private S3 bucket** — Check whether a private S3 bucket is created or not
* **Launch RDS instance** — Check whether an RDS Instance is created or not
* **Create RDS Snapshot** — Check whether an RDS Snapshot is created or not.
* **check s3 object** — Check whether an object is uploaded to the S3 bucket.

## Related help

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.