Skip to content

docs: add documentation for migration runner and deployment process#73

Merged
tmokmss merged 1 commit intoaws-samples:mainfrom
konokenj:docs/add-migration-documentation-1765117311
Dec 8, 2025
Merged

docs: add documentation for migration runner and deployment process#73
tmokmss merged 1 commit intoaws-samples:mainfrom
konokenj:docs/add-migration-documentation-1765117311

Conversation

@konokenj
Copy link
Copy Markdown
Contributor

@konokenj konokenj commented Dec 7, 2025

Overview

This PR adds comprehensive documentation for the database migration runner and deployment process to improve developer experience and clarify how the system works.

Changes

1. Enhanced Migration Runner Documentation (webapp/src/jobs/migration-runner.ts)

  • Added detailed comments explaining the two invocation contexts:
    • CDK Trigger: Automatically invoked during cdk deploy with default payload
    • Manual Invocation: Using AWS CLI with custom commands
  • Included example AWS CLI command for manual execution
  • Referenced CloudFormation stack outputs for function name and command template

2. Improved CDK Infrastructure Comments (cdk/lib/constructs/webapp.ts)

  • Added comments to Trigger construct explaining automatic invocation with default payload
  • Added comments to CfnOutput section with available commands and execution examples
  • Clarified the relationship between CDK Trigger and manual Lambda invocation

3. Extended README.md Deploy Section

Added two new subsections under the Deploy section:

WebApp Deployment

  • Explains that Next.js webapp is built and deployed during CDK deployment using deploy-time-build
  • Links to implementation file for details

Database Migration

  • Explains that migrations are automatically executed during CDK deployment using CDK Trigger
  • Links to implementation files (webapp.ts and migration-runner.ts)
  • Provides AWS CLI command example for manual migration execution
  • Lists available commands: deploy (default), force (with --accept-data-loss)

Benefits

  • Developers can now easily understand how to manually run database migrations
  • Clear documentation of the deployment process and migration workflow
  • Improved code maintainability with inline comments
  • Better onboarding experience for new developers

Testing

  • Verified all links in README.md point to correct files
  • Confirmed code comments are accurate and helpful
  • No functional changes - documentation only

@tmokmss
Copy link
Copy Markdown
Contributor

tmokmss commented Dec 8, 2025

Thanks!

@tmokmss tmokmss merged commit dad0742 into aws-samples:main Dec 8, 2025
2 checks passed
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.

2 participants