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

feat: provider construct and filemanager migration #213

Merged
merged 5 commits into from
Apr 10, 2024

Conversation

mmalenic
Copy link
Member

Closes #170

Changes

  • Implements a provider function which calls CustomResource during CloudFormation deployment in order to migrate the filemanager database.
    • This is implemented to allow migration during deployment using CloudFormation Create, Delete and Update events.
    • The CustomResource is updated whenever the handler function changes using the asset hash, so that the function gets called again when it changes.
    • If the migration fails, the CloudFormation stack fails to deploy.
    • This replaces the non-working CdkResourceInvoke, which used a SingletonLambda that only ran once.
    • Note, this is a general construct in the components directory, so it could also be used by other services.

Checksums

  • The filemanager database now tracks the SHA256 checksum if it is available (I mostly included this as a real-world test for the migration provider, as it changes the table).

Misc

  • The filemanager compilation behaves a lot more nicely now.
  • Removed unused code, structs and functions. For example, env.rs is removed, because sqlx already sources the DATABASE_URL automatically.

@mmalenic mmalenic self-assigned this Apr 10, 2024
@mmalenic mmalenic added filemanager an issue relating to the filemanager fix labels Apr 10, 2024
@mmalenic mmalenic requested a review from victorskl April 10, 2024 10:05
@brainstorm brainstorm merged commit d200046 into main Apr 10, 2024
2 checks passed
@brainstorm brainstorm deleted the fix/filemanager-migrate branch April 10, 2024 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filemanager an issue relating to the filemanager fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

filemanager: reconsider the CdkResourceInvoke for migration
2 participants