> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/aws-rds.md).

# AWS RDS

Connect to AWS RDS managed relational databases. Choose IAM authentication (PostgreSQL/MySQL) for enhanced security, or password authentication for all engines including SQL Server.

### Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector               | Authentication |
| ----------------------- | -------------- |
| AWS RDS (IAM Auth)      | Credentials    |
| AWS RDS (Password Auth) | Credentials    |

#### AWS RDS (IAM Auth)

Connect to Amazon RDS using IAM authentication. Supports PostgreSQL and MySQL engines. More secure - uses temporary tokens instead of passwords.

**Set up in AWS RDS**

1. In the AWS RDS console, open your database instance and enable IAM database authentication (supported for PostgreSQL and MySQL).
2. Create a database user mapped to IAM authentication, and attach an IAM policy that grants rds-db:connect to the principal that will connect.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **AWS RDS (IAM Auth)**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field         | Required                 | What to enter                                                                                                                                                                                                                                                                                        |
| --------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Database Engine       | Yes                      | PostgreSQL or MySQL (eg. postgresql or mysql). IAM authentication is not supported for SQL Server.                                                                                                                                                                                                   |
| Host                  | Yes                      | RDS endpoint (e.g., mydb.abc123.us-east-1.rds.amazonaws.com).                                                                                                                                                                                                                                        |
| Database Name         | Yes                      | The name of the database to connect to.                                                                                                                                                                                                                                                              |
| Database Username     | Yes                      | Database user configured for IAM authentication. Use a read-only role with SELECT-only privileges on the target schemas — PostgreSQL: GRANT USAGE ON SCHEMA public TO stackai\_ro; GRANT SELECT ON ALL TABLES IN SCHEMA public TO stackai\_ro; MySQL: GRANT SELECT ON mydb.\* TO 'stackai\_ro'@'%';. |
| AWS Region            | Yes                      | AWS region (e.g., us-east-1).                                                                                                                                                                                                                                                                        |
| AWS Access Key ID     | Yes                      | IAM access key with rds-db:connect permission.                                                                                                                                                                                                                                                       |
| AWS Secret Access Key | Yes                      | The secret key paired with your Access Key ID.                                                                                                                                                                                                                                                       |
| Port                  | Optional / as applicable | Port number.                                                                                                                                                                                                                                                                                         |

**Provider documentation:** [Setup reference](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html).

#### AWS RDS (Password Auth)

Connect to Amazon RDS using username/password authentication. Supports PostgreSQL, MySQL, and SQL Server engines.

**Set up in AWS RDS**

1. In the AWS RDS console, open your database instance and note the endpoint (host), port, and database name.
2. Create or identify a database user with a username and password that can run the queries you need.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **AWS RDS (Password Auth)**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field     | Required                 | What to enter                                                                                                                                                                                                                                                                                                                                         |
| ----------------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Database Engine   | Yes                      | PostgreSQL, MySQL, or SQL Server (e.g., postgresql, mysql, or sqlserver).                                                                                                                                                                                                                                                                             |
| Host              | Yes                      | RDS endpoint (e.g., mydb.abc123.us-east-1.rds.amazonaws.com).                                                                                                                                                                                                                                                                                         |
| Database Name     | Yes                      | The name of the database to connect to.                                                                                                                                                                                                                                                                                                               |
| Database Username | Yes                      | Database user for this integration. Use a read-only role with SELECT-only privileges on the target schemas — PostgreSQL: GRANT USAGE ON SCHEMA public TO stackai\_ro; GRANT SELECT ON ALL TABLES IN SCHEMA public TO stackai\_ro; MySQL: GRANT SELECT ON mydb.\* TO 'stackai\_ro'@'%'; SQL Server: ALTER ROLE db\_datareader ADD MEMBER stackai\_ro;. |
| Database Password | Yes                      | Password for the read-only database user above. Credentials should belong to a SELECT-only role.                                                                                                                                                                                                                                                      |
| Port              | Optional / as applicable | Port number.                                                                                                                                                                                                                                                                                                                                          |

**Provider documentation:** [Setup reference](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html).

#### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

### Use an action

1. Add the required **AWS RDS** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

### Actions

#### Query RDS

Query an AWS RDS database with SQL

**Inputs**

| Field | Type   | Required | Description                                    |
| ----- | ------ | -------- | ---------------------------------------------- |
| Query | string | Yes      | SQL query to execute against the RDS database. |

**Outputs**

| Field     | Type        | Description                                          |
| --------- | ----------- | ---------------------------------------------------- |
| SQL Query | string      | The SQL query that was executed.                     |
| Results   | dict\_array | Query results.                                       |
| Truncated | boolean     | True if the result set was truncated by the row cap. |

#### Insert Row to RDS

Insert a row into an AWS RDS database table

**Inputs**

| Field      | Type            | Required | Description                                                                |
| ---------- | --------------- | -------- | -------------------------------------------------------------------------- |
| Table Name | select (string) | Yes      | The target table for insertion. Options load from the selected connection. |
| Data       | string          | Yes      | JSON data to insert (keys are column names).                               |

**Outputs**

| Field         | Type    | Description                             |
| ------------- | ------- | --------------------------------------- |
| SQL Query     | string  | The INSERT SQL query that was executed. |
| Rows Affected | integer | Number of rows inserted.                |
| Success       | boolean | Whether the insert was successful.      |

#### Update Row in RDS

Update a row in an AWS RDS database table

**Inputs**

| Field             | Type            | Required | Description                                                             |
| ----------------- | --------------- | -------- | ----------------------------------------------------------------------- |
| Table Name        | select (string) | Yes      | The target table for update. Options load from the selected connection. |
| Identifier Column | string          | Yes      | The column to use for identifying rows to update (e.g., 'id', 'email'). |
| Identifier Value  | string          | Yes      | The value to match in the identifier column.                            |
| Fields to Update  | object          | Yes      | Key-value pairs of columns and values to update.                        |

**Outputs**

| Field         | Type    | Description                             |
| ------------- | ------- | --------------------------------------- |
| SQL Query     | string  | The UPDATE SQL query that was executed. |
| Rows Affected | integer | Number of rows updated.                 |
| Success       | boolean | Whether the update was successful.      |

### Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# 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.stackai.com/integrations/catalog/aws-rds.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.
