deploy-aws
Skill1 starsChanged 5 months agoMITView on GitHub
Deploy runbook for this stack's Django/DRF backend on AWS Elastic Beanstalk (Gunicorn for WSGI, Uvicorn for the Channels ASGI app via Procfile, .ebextensions, leader_only migrate) and the Next.js frontend on Amplify (amplify.yml, pinned pnpm, env vars). Use when shipping a release, writing a Procfile or amplify.yml, running eb deploy, wiring container_commands, rolling back to a prior version label, or checking GET /health after a deploy. Not for provisioning RDS/ElastiCache/S3 (see aws-services) or the GitHub Actions pipeline (see ci-cd).
- Reads credentials
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- ambroselittle/agent-skillstheir own version, first seen Sep 23, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- ambroselittle/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository49 other files it gives its agents.
- accessibilitySkill
- ai-evalsSkill
- ai-integrationSkill
- architecture-decisionsSkill
- audit-loggingSkill
- aws-servicesSkill
- browser-e2e-testingSkill
- celery-tasksSkill
- changelogSkill
- ci-cdSkill
- codebase-guideSkill
- code-reviewSkill
- commit-messageSkill
- cookie-auth-csrfSkill
- dashboard-data-designSkill
- db-concurrencySkill
- debugSkill
- dependency-auditSkill
- design-systemSkill
- drf-apiSkill
- drf-zod-contractSkill
- frontend-perfSkill
- git-workflowSkill
- i18n-rtlSkill
- incident-responseSkill
- migrationsSkill
- money-decimalSkill
- multi-tenancySkill
- nextjs-moduleSkill
- observabilitySkill
- perf-reviewSkill
- production-readinessSkill
- product-ux-designSkill
- rbac-permissionsSkill
- react-querySkill
- security-reviewSkill
- skill-authoringSkill
- tailwind-shadcnSkill
- tenant-session-switchSkill
- threat-modelingSkill
- verifySkill
- version-checkSkill
- visual-ui-designSkill
- webhook-handlerSkill
- websockets-channelsSkill
- write-testsSkill
- zod-formsSkill
- zustand-stateSkill
- example-skillSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 86
Quiesce background workers before
migrate: Add a leader_only, ignore-errors container command that stops the workers on the leader right …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Deploy to AWS (Elastic Beanstalk + Amplify)
When to use
Shipping a backend release to Elastic Beanstalk or a frontend release to Amplify,
or debugging a deploy — Procfile process wiring, migrations on deploy, env vars,
rollback, and the post-deploy health check. Deploys are gated: never run
eb deploy or trigger a prod build without asking the user first.
Pattern
The EB instance runs two processes from one Procfile: Gunicorn serves the
WSGI app, Uvicorn serves the Channels ASGI app (websockets). Schema changes
run once per deploy via a leader_only container command, never at import
time. Secrets live in the EB/Amplify environment, never in git. After every
deploy, prove it with GET /health and roll back by redeploying the previous
version label if it is red.
Steps / idioms
The one thing to get right is the Procfile (repo root): two processes, one WSGI (Gunicorn) and one ASGI (Uvicorn pointed at the Channels application). Daphne is the local dev server — don't ship it here:
# --max-requests recycles each worker after N requests to cap memory growth;
# --max-requests-jitter staggers the recycles so they don't all restart at once
# (values illustrative — tune to your traffic and memory budget).
web: gunicorn myproject.wsgi:application --bind :8000 --workers 3 --max-requests 2000 --max-requests-jitter 200 --timeout 60 --graceful-timeout 30
asgi: uvicorn myproject.asgi:application --host 0.0.0.0 --port 5000 --workers 2Everything else is standard EB/Amplify wiring in prose:
- Migrate once, on the leader only — in
.ebextensions/01_migrate.config, acontainer_commandsentry runningsource /var/app/venv/*/bin/activate && python manage.py migrate --noinputwithleader_only: trueso a multi-instance fleet doesn't race on locks. Add a second command forcollectstatic --noinput(noleader_onlyneeded). - Env vars via the EB environment, never committed —
eb setenv DJANGO_SETTINGS_MODULE=myproject.settings.prod SECRET_KEY=... DATABASE_URL=... REDIS_URL=..., theneb deploy. - Amplify frontend —
amplify.ymlwith a pinned pnpm inpreBuild(corepack enable, thencorepack prepare pnpm@9.12.0 --activate, thenpnpm install --frozen-lockfile) andpnpm run build. Neverpnpm@latest. Build-timeNEXT_PUBLIC_*vars come from the Amplify console environment. - Verify, then decide — hit the health endpoint and read the body, don't
assume:
curl -sS -w '%{http_code}\n' https://<your-api-domain>/health. - Rollback = redeploy the last-known-good version label with no rebuild:
eb appversion --listto find the prior good label, theneb deploy --version app-20260715-1.
Adapt to your repo
Rename myproject (wsgi/asgi module paths), the settings module, and the health
URL. Match the pnpm version to your packageManager field in package.json.
Confirm .ebextensions uses your actual venv activation path and that
ALLOWED_HOSTS/CSRF_TRUSTED_ORIGINS include the EB and Amplify domains. If you
run websockets, ensure the load balancer forwards the asgi port and upgrades.
Gotchas
- Ask before deploying. A deploy is a side-effecting, prod-facing action —
confirm the target env and the release with the user first. This skill carries
disable-model-invocation: true, so it is manual-only: you load it by running/nanolama:deploy-aws, and Claude cannot pull it in and decide to deploy because the code looks ready. Keep that field if you copy this runbook. - Without
leader_only: true, every instance runsmigratesimultaneously and they race on locks — one leader only (seemigrations). - Uvicorn is a production ASGI server but is not bundled with Channels; wire
the ASGI application explicitly (
uvicorn myproject.asgi:application). Daphne is the dev server; don't ship it as your prod ASGI process. pnpm@lateston Amplify makes builds non-reproducible — pin the exact version and commit the lockfile; use--frozen-lockfile.- Secrets in
.ebextensionsoramplify.ymlland in git history — keep them in the environment (eb setenv/ Amplify console) only. - Websockets connect then drop after ~60s? That's the load balancer idle
timeout, not your code. Raise the ALB idle timeout (e.g.
3600) via an.ebextensionsoption_settingsentry underaws:elbv2:loadbalancer, and confirm the LB forwards/upgrades to the ASGI port. - Make
/healthactually probe its dependencies — a cheap DB query plus a cache/broker ping, returning non-200 if either is down. A static200hides real breakage. On EB a failing health check auto-rolls-back the deploy; that's an intentional gate — don't disable it (seeverify). - Quiesce background workers before
migrate. Add aleader_only,ignore-errorscontainer command that stops the workers on the leader right before the migrate command, so they release DB connections/locks and don't race the schema change. They restart with the new release (seemigrations). - Backend-only commit still rebuilds the frontend? A push-triggered build host (Amplify) rebuilds the whole frontend on every push, even backend-only commits. Suppress non-frontend commits with a commit skip marker or a path filter so you don't burn build minutes on changes that can't affect the frontend.
- A green build is not a green deploy — the health check is the proof (see
verify).
See also
aws-servicesci-cdmigrations
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

