> For the complete documentation index, see [llms.txt](https://docs.nuvens.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nuvens.cloud/install/alternate-deployment-options/deploy-an-rds-database-via-terraform.md).

# Deploy an RDS Database via Terraform

Amazon Relational Database Service (Amazon RDS) is an easy-to-manage relational database service optimized for total cost of ownership.

In scenarios where the **MS-SQL Database** is decoupled from the Portal Application, it's recommended to run the database using the **AWS RDS** managed service for better scalability, availability, and management. The database must use an **MS-SQL engine**, which can be deployed in any of its supported versions.

There are multiple ways to deploy the MS-SQL database on AWS RDS, but to streamline the process, we provide an example of how to deploy it using **Terraform** in our Git repository. This example includes all the necessary configurations for setting up an RDS instance with MS-SQL, ensuring it integrates seamlessly with the WorkSpaces Manager environment.

{% embed url="<https://gitlab.com/nuvens-public/wsm-rds-sql>" %}

Once the database has been deployed —whether via **Terraform**, **CloudFormation**, or manually on an EC2 instance— you need to configure the database to allow connections from the **WorkSpaces Manager Appliance**. At a minimum, this configuration should include:

1. **Database Access**: Set up a username and password for the WSM Appliance to connect to the database.
2. **Security Group Configuration**: Ensure that the database's security group allows inbound traffic on **TCP/1433** (MS-SQL) from the IP address or VPC of the WSM Appliance.
3. **Secrets Manager**: Store the database credentials (username and password) in **AWS Secrets Manager** for secure access by the WSM Appliance.

By storing the credentials in **Secrets Manager**, the WSM Appliance can securely retrieve and use them during operations, reducing the need for hardcoded credentials and improving security.

The retrieval of credentials is done in real-time by calling the **AWS Secrets Manager API**, ensuring that no sensitive information is stored or cached elsewhere. This process enhances security, as the credentials are only accessed when needed and are not exposed in any configuration files or logs, reducing the risk of unauthorized access.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.nuvens.cloud/install/alternate-deployment-options/deploy-an-rds-database-via-terraform.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
