-
Notifications
You must be signed in to change notification settings - Fork 3
Serverless Deployment Manual
Jordan Seow edited this page Nov 15, 2019
·
6 revisions
- Fork https://github.com/jordseow/CodeTranslate.git
- Open UnitOne.vue and UnitTwo.vue, and change
firebaseUrlindatato your own Firebase URLfirebaseUrl = "<your-firebase-url>"
- Edit any other changes you want to the app
- Run
npm run build - Commit your changes to your forked repository
- Create Cloud9 environment on AWS
- Use bash window to clone repository into the new environment and change directory into the project folder
git clone <your-repository>cd CodeTranslate
- Update SAM CLI version on Cloud9
chmod +x c9-setup.sh./c9-setup.sh
- Change to new terminal for changes to take effect
- Run
sam --versionto check your version (v0.22.0)
- Run
- Build app for your region (e.g. North Virginia us-east-1 or Singapore ap-southeast-1)
sam build --region ap-southeast-1
- Locally invoke lambda function
echo '{"httpMethod":"GET"}' | sam local invoke "<function-name>"
- Start the API locally
sam local start-api
- Make new S3 bucket with unique name
aws s3 mb s3://<s3-bucket-name> --region ap-southeast-1
- Run the package command to generate packaged.yaml file
sam package --output-template packaged.yaml --s3-bucket <s3-bucket-name>
- Deploy CloudFormation stack
sam deploy --template-file packaged.yaml --region ap-southeast-1 --capabilities CAPABILITY_IAM--stack-name <cloudformation-stack-name-to-be-created>
- Run
npm install --save serverless-finch - Run
npx serverless config credentials -o --provider aws --key AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY - Run
npm run deploy - Access your serverless app from your browser