This repository deploys a handler for provisioning and removing staging databases.
Usage of this handler should follow the flow of:
On PR open, invoke handler with action: deploy, which returns db credentials that can be used in the app.
On PR close, invoke handler with action: remove to remove the database.
The handler deploys a new database within an existing RDS instance, and returns the connection details.
Handler event body:
{
"action": "deploy",
"repository": "antalmanac",
"prNumber": 67
}Handler response:
{
"ok": true,
"action": "deploy",
"url": "postgresql://antalmanac_staging_67_user:<password>@<host>:5432/antalmanac_staging_67",
"host": "<host>",
"username": "antalmanac_staging_67_user",
"password": "<password>",
"database": "antalmanac_staging_67"
}The handler removes the database that was provisioned for the staging environment.
Handler event body:
{
"action": "remove",
"repository": "antalmanac",
"prNumber": 67
}Handler response:
{
"ok": true,
"action": "remove",
"database": "antalmanac_staging_67"
}