Zyten:
Use Serverless Dashboard instead of directly using AWS credentials. See Deployment section. `
Please note - this is part of an open source project written by me, Joe Gilmore - you can read the full details of this project here joemore.com/photo-uploader-with-aws-serverless-nextjs-and-tailwind/
This works in conjunction with the NextJS Front end website - you can find the backend code here Frontend Repo
- Run
npm install -g serverless
to install the serverless framework - Run
yarn install
to install the dependencies
This Repo: github.com/joemore/aws-serverless-photo-uploader
First, copy .env.example
to .env
and fill in the values
YOUR_AWS_IAM_PROFILE=XXXXXXXXXXX
REGION=sa-east-1n
PREFIX=pinkmonkey-
SERVICE_NAME=photo-uploader
DYNAMO_DB_TABLE=photos
COGNITO_POOL=users
S3_BUCKET=photos-bucket
Note about the PREFIX - this is optional, but if like me you have many AWS resources then by prefixing your resources like this you can locate them easier, and they may make more sense to you when you come back to them after a long time.
Run the following commands to deploy the backend using Serverless Dashboard
serverless login
- Go through the Serverless Dashboard onboarding to create an org and add the AWS Provider
serverless --verbose
- Provide org and application when prompted then select deploy now
- Keep the CLI tab open and open new tab for prepping the frontend
Once your service has deployed, you need to copy the USER_POOL_ID, USER_POOL_CLIENT_ID and API Endpoint values. You will need these for the frontend.
Repo: github.com/joemore/aws-serverless-photo-uploader-frontend-nextjs