Skip to content

Migrate web service from Serverless Framework to AWS SAM#559

Merged
IanButterworth merged 10 commits intomasterfrom
ib/use_sam
Apr 11, 2026
Merged

Migrate web service from Serverless Framework to AWS SAM#559
IanButterworth merged 10 commits intomasterfrom
ib/use_sam

Conversation

@IanButterworth
Copy link
Copy Markdown
Member

@IanButterworth IanButterworth commented Apr 11, 2026

Migrate web service from Serverless Framework to AWS SAM

Serverless Framework v4 requires a paid license/login, making CI validation impractical. We're currently stuck on v3 which is deprecated, and not getting all security updates.

AWS SAM is free, maintained by AWS, and needs no authentication for build/validate.

SAM migration

  • Replace serverless.yml with template.yaml (SAM) and samconfig.toml
  • Add tagbot/web/lambda_handler.py (WSGI-to-Lambda adapter, replaces serverless-wsgi plugin)
  • Add tests for the lambda handler
  • Update CI workflow to use sam validate --lint + sam build
  • Remove serverless.yml, package.json, package-lock.json, docs/TODO-serverless-v4.md
  • Upgrade Lambda runtime from Python 3.11 to 3.12

Dependency management

  • Export pinned requirements.txt from poetry.lock (with hashes)
  • CI check that requirements.txt stays in sync with poetry.lock

pyproject.toml modernization

  • Migrate metadata to PEP 621 [project] table
  • Move extras to [project.optional-dependencies]
  • Update build-system to poetry-core

Other

  • Show version and commit SHA on julia-tagbot.com index page
  • Update AGENTS.md with SAM deploy docs and migration notes
  • Custom domain (julia-tagbot.com) managed manually outside CloudFormation

IanButterworth and others added 7 commits April 10, 2026 23:18
Serverless Framework v4 requires a paid license/login, making CI
validation impractical. AWS SAM is free, maintained by AWS, and needs
no authentication for build/validate.

- Replace serverless.yml with template.yaml (SAM)
- Add samconfig.toml for dev/prod deploy config
- Add tagbot/web/lambda_handler.py (WSGI-to-Lambda adapter,
  replaces serverless-wsgi plugin)
- Update CI workflow to use sam validate + sam build
- Remove package.json, package-lock.json, serverless.yml
- Remove docs/TODO-serverless-v4.md (completed)
- Update AGENTS.md with SAM deploy docs and migration notes

Function names (TagBotWeb-{stage}-api, TagBotWeb-{stage}-reports)
are preserved for compatibility.

Co-Authored-By: Claude <claude@users.noreply.github.com>
- Migrate pyproject.toml metadata to PEP 621 [project] table
- Update build-system to use poetry-core
- Export fully pinned requirements.txt from poetry.lock
- Add CI check that requirements.txt matches poetry.lock
- Add pyproject.toml and poetry.lock to web.yml path triggers
- Show version (from pyproject.toml) and commit SHA on julia-tagbot.com
- Use stdlib tomllib instead of toml package (available in Lambda)
- Upgrade Lambda runtime from python3.11 to python3.12
- Add TagbotCommit parameter to SAM template
- Add resolve_s3 to samconfig.toml
- Remove explicit FunctionName (fixes dev/prod name mismatch)
- Remove unmanaged CustomDomain/CustomDomainMapping resources
- Remove unused Stage parameter and IsProd condition
- Add tests for lambda_handler WSGI adapter
@IanButterworth
Copy link
Copy Markdown
Member Author

This is deployed now, and I will redeploy after merge

@IanButterworth IanButterworth marked this pull request as ready for review April 11, 2026 14:47
The token is now stored as a SecureString in SSM at /tagbot/github-token
and fetched lazily at runtime by ReportsFunction only. ApiFunction has
no token access at all. This removes the plaintext token from Lambda
environment variables.
@IanButterworth IanButterworth merged commit 46f2703 into master Apr 11, 2026
3 checks passed
@IanButterworth IanButterworth deleted the ib/use_sam branch April 11, 2026 18:08
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