Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate bootstrapper from DB #90

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

emileten
Copy link
Contributor

The way the pgstac database is defined is the following :

  1. deploy an RDS instance
  2. deploy a lambda that 'bootstraps' pgstac in that RDS instance (i.e create the table, the user...) and trigger that lambda with a custom resource.

In its initial state, this repository was doing (1) and (2) within the same construct, while defining (2) separately. In this PR, I combined the definitions because of JSII problems (see the PR for details).

However, this is not a good set up for users who want to separate their 'stateful' (DB, VPC) and 'stateless' (all lambdas, including bootstrapper) components in different stacks.

The main reason someone wants to keep these things separate is that deploying an RDS instance takes ages. When it's deployed with the bootstrapper lambda (i.e, as part of the same construct), and the bootstrapper lambda fails for some reasons, Cloudformation is going to start a ROLLBACK, and try to delete the RDS instance. This significantly slows down development.

Right now it's impossible to keep the bootstrapper and the RDS instance in separate stacks because the bootstrapper lambda deployment is hard coded within the database construct deployment.

This PR aims at separating the boostrapper lambda creation (and trigger) and the DB creation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant