# Step 3: Create an RDS Database (Optional)

{% hint style="info" %}
Creating an RDS database is not essential to running a DuploCloud Service. However, as most services also incorporate an RDS, this step is included to demonstrate the ease of creating a database in DuploCloud. To skip this step, proceed to creating an EKS or ECS Service.
{% endhint %}

An [AWS RDS](https://aws.amazon.com/free/database/?trk=83add82a-8e52-4837-bc73-c323da62d78c\&sc_channel=ps\&ef_id=CjwKCAjwp6CkBhB_EiwAlQVyxYi50yWfBj5SSxs6-gaDSqftnxbBO6Plfy0pYWyyxrZ3zI0goU6bLRoCGkQQAvD_BwE:G:s\&s_kwcid=AL!4422!3!610000101516!e!!g!!amazon%20database%20hosting!11086562318!108339552363) is a managed Relational Database Service that is easy to set up and maintain in DuploCloud for AWS public cloud environments. RDSs support many databases including MySQL, PostgreSQL, MariaDB, Oracle BYOL, or SQL Server.

See the [DuploCloud AWS Database documentation](https://docs.duplocloud.com/docs/automation-platform/overview/aws-services/database) for more information.

*Estimated time to complete Step 3: 5 minutes.*

## Prerequisites <a href="#id-0-toc-title" id="id-0-toc-title"></a>

Before creating an RDS, verify that you accomplished the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:

* An [Infrastructure and Plan](https://docs.duplocloud.com/docs/automation-platform/overview/quick-start/step-1-infrastructure) exist, both with the name **NONPROD**.
* The **NONPROD** infrastructure has [Kubernetes (EKS or ECS) **Enabled**](https://docs.duplocloud.com/docs/automation-platform/overview/step-1-infrastructure#check-your-work).
* A Tenant with the name [**dev01** has been created](https://docs.duplocloud.com/docs/automation-platform/overview/quick-start/step-2-tenant).

## Creating an RDS Database <a href="#id-0-toc-title" id="id-0-toc-title"></a>

1. In the **Tenant** list box, select the **dev01** Tenant that you created.
2. Navigate to **Cloud Services** -> **Database**.
3. Select the **RDS** tab, and click **Add**. The **Create a RDS** page displays.<br>

   <figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FjlZXnAOTJiT66iIo01SI%2FScreenshot%20(173).png?alt=media&#x26;token=cb208447-2db6-44f6-b718-a29837744a8a" alt=""><figcaption><p>The <strong>Create a RDS</strong> page</p></figcaption></figure>
4. From the table below, enter the values that correspond to the fields on the **Create a RDS** page. Accept default values for fields not specified.
5. Click **Create**. The database displays with a status of **Submitted** in the **RDS** tab. Database creation takes approximately ten (10) minutes.

{% hint style="info" %}
DuploCloud prepends **DUPLO** to the name of your RDS database instance.
{% endhint %}

| Create a RDS page field | Value                               |
| ----------------------- | ----------------------------------- |
| **RDS Name**            | `docs`                              |
| **User Name**           | *`YOUR_DUPLOCLOUD_ADMIN_USER_NAME`* |
| **User password**       | *`YOUR_DUPLOCLOUD_ADMIN_PASSWORD`*  |
| **RDS Engine**          | `MySQL`                             |
| **RDS Engine Version**  | *`LATEST_AVAILABLE_VERSION`*        |
| **RDS Instance Size**   | `db.t3.medium`                      |
| **Storage size in GB**  | `30`                                |

## Validating RDS Database Creation <a href="#id-1-toc-title" id="id-1-toc-title"></a>

You can monitor the status of database creation using the **RDS** tab and the **Status** column.

When the database status reads **Available** on the **RDS** tab on the **Database** page, the database's endpoint is ready for connection to a DuploCloud Service, which you create and start in the [next step](#checking-your-work).

### Troubleshooting Database Creation Failures

Faults can be viewed in the DuploCloud Portal by clicking the Fault/Alert ( <img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FytEMMSsYfZF7tfLxKepK%2Falert_exclamation_point_circle_fault_icon.png?alt=media&#x26;token=6e7087a2-392d-4f21-9ebc-48b6acf7bd61" alt="" data-size="line"> ) Icon. Common database faults that may cause database creation to fail include:

* Invalid passwords - Passwords cannot have special characters like quotes, @, commas, etc. Use a combination of uppercase and lowercase letters and numbers.
* Invalid encryption - Encryption is not supported for small database instances (micro, small, or medium).

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fzd0hblXFNKq5ISu0opCD%2FScreenshot%20(175).png?alt=media&#x26;token=dad4383e-8877-4166-be37-5ea326176759" alt=""><figcaption><p>The <strong>RDS</strong> tab with <strong>the</strong> Fault/Alert Icon highlighted</p></figcaption></figure>

## Verifying Database Endpoints <a href="#id-1-toc-title" id="id-1-toc-title"></a>

1. In the **RDS** tab, select the **DUPLODOCS** database you created.
2. Note the database endpoint, the name, and credentials. For security, the database is automatically placed in a private subnet to prevent access from the internet. Access to the database is automatically set up for all resources (EC2 instances, containers, Lambdas, etc.) in the DuploCloud **dev01** Tenant. You need the endpoint to connect to the database from an application running in the EC2 instance.

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FadLfTC7SdCrtojLJDBgU%2FScreenshot%20(176).png?alt=media&#x26;token=40fa48b0-fdda-4dca-bb96-cb546e02222a" alt=""><figcaption><p>RDS Database details page with the endpoint highlighted</p></figcaption></figure>

{% hint style="info" %}
When you place a DuploCloud Service in a live production environment, consider passing the database endpoint, name, and credentials to a DuploCloud Service using [AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html), or [Kubernetes Configs and Secrets](https://docs.duplocloud.com/docs/automation-platform/kubernetes-overview/configs-and-secrets).
{% endhint %}

## Checking your work

When your [database is available](#1-toc-title) and you have [verified the endpoint](#1-toc-title-1), choose one of these three paths to create a DuploCloud Service and continue this tutorial.

* [Creating an AWS EKS Service](https://docs.duplocloud.com/docs/automation-platform/overview/quick-start/quick-start-eks-services) in DuploCloud running Docker containers
* [Creating an AWS ECS Service](https://docs.duplocloud.com/docs/automation-platform/overview/quick-start/quick-start-ecs-services) in DuploCloud running Docker containers
* [Creating a DuploCloud native Docker Service](https://docs.duplocloud.com/docs/automation-platform/overview/quick-start/quick-start-duplocloud-docker-services)

{% hint style="success" %}
Not sure what kind of DuploCloud Service you want to create? Consider the following:

* AWS EKS is a managed [Kubernetes ](https://kubernetes.io/)service. AWS ECS is a fully managed container orchestration service using AWS technology. For a full discussion of the benefits of EKS vs. ECS, consult this [AWS blog](https://aws.amazon.com/blogs/containers/amazon-ecs-vs-amazon-eks-making-sense-of-aws-container-services/).
* [Docker Containers](https://docs.docker.com/get-started/) are ideal for lightweight deployments and run on any platform, using GitHub and other open-source tools.
  {% endhint %}
