Relational Database Service (RDS)

    LocalStack supports a basic version of the for testing.

    Currently, it is possible to spin up PostgreSQL, MySQL, and MSSQL (SQL Server) databases on the local machine.

    Note

    When creating an RDS DB cluster or instance with postgres/aurora-postgresql DB engine, by default Postgres version 11 is used. In order to use custom versions, make sure to configure the environment variable RDS_PG_CUSTOM_VERSIONS=1, which then causes LocalStack to install and start up the respective Postgres version on demand. Currently, versions 11/12/13 can be installed - when selecting a major version outside of this range, the default version 11 is used as fallback.

    The local RDS service also supports the , which allows executing data queries against RDS clusters over a JSON/REST interface. Below is a simple example that illustrates (1) creation of an RDS cluster, (2) creation of a SecretsManager secret with the DB password, and (3) running a simple query via the RDS Data API.

    1. $ psql -d test -U test -p 4513 -h localhost -W

    Please consider the following notes regarding default usernames/passwords and database names:

    • You can use any , except “postgres”, for creating a new RDS instance. The user will automatically be created.
    • The user “postgres” is special, and it is not possible to create a new RDS instance with this user name.
    • Do not use db-name “postgres” as it is already in use by LocalStack.