Skip to content

icssc/infra-staging-dbs

Repository files navigation

Staging Database Shared Infrastructure

This repository deploys a handler for provisioning and removing staging databases.

Usage

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.

Deploy

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"
}

Remove

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"
}

About

Shared infrastructure for managing staging databases for projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors