A simple task management CRUD application built with Laravel 13, deployed on AWS Elastic Beanstalk.
eb init -p "PHP 8.4" task-manager --region us-east-1eb create task-manager-env \
--database.engine mysql \
--database.username admin \
--database.password <your-db-password> \
--envvars APP_KEY=<your-app-key>Generate an APP_KEY locally if needed:
php artisan key:generate --showeb setenv \
APP_ENV=production \
APP_DEBUG=false \
APP_KEY=base64:yourkey \
LOG_CHANNEL=stderrThe RDS variables (RDS_HOSTNAME, RDS_PORT, RDS_DB_NAME, RDS_USERNAME, RDS_PASSWORD) are injected automatically when you attach an RDS instance to your environment.
eb deployeb openPushing to main automatically runs tests and deploys to Elastic Beanstalk.
Add these in Settings > Secrets and variables > Actions:
| Secret | Description |
|---|---|
AWS_ACCESS_KEY_ID |
IAM user access key |
AWS_SECRET_ACCESS_KEY |
IAM user secret key |
The IAM user needs permissions for elasticbeanstalk:* and s3:* (for uploading deployment artifacts).
- Test -- Installs dependencies, spins up a MySQL service container, runs
php artisan test - Deploy -- Zips the app (production deps only), deploys to EB via
beanstalk-deploy
.ebextensions/
01-laravel.config # PHP settings, document root, env vars
02-permissions.config # storage/cache directory permissions
.github/workflows/
deploy.yml # CI/CD: test + deploy on push to main
.platform/
hooks/postdeploy/
01_migrate.sh # Runs migrations + caches config after deploy
nginx/conf.d/
elasticbeanstalk/
laravel.conf # Nginx rewrite rules for Laravel
- Create, read, update, and delete tasks
- Task status tracking (Pending, In Progress, Completed)
- MySQL database via RDS with automatic migrations on deploy
eb status # Check environment health
eb logs # View application logs
eb ssh # SSH into the instance
eb terminate # Tear down the environment