IMAP-Science-Operations-Center / sds-data-manager

MIT License
0 stars 9 forks source link

BUG - Dependency manager database creator lambda running on destroy #299

Open maxinelasp opened 2 weeks ago

maxinelasp commented 2 weeks ago

Description of the issue

When the destroy step to remove the CreateSchemaStack runs, it triggers the lambda to create the database tables. This results in duplicate entries into the database.

Workaround: Destroy the stack and then drop the tables, this way you won't end up with duplicates.

Steps to reproduce the issue

It's not always consistent.

  1. Drop the tables in datagrip
  2. Run CDK destroy on CreateSchemaStack
  3. See that the tables have been recreated

Expected behavior (What should happen)

The destroy should either destroy the tables or leave them deleted

Actual behavior (What does happen)

The destroy runs the create tables lambda

Code Snippet:

No response

Additional notes, affected areas, and suggested fixes

Suggested fixes:

More info in this slack thread