Running

If you have downloaded the sources of the project for this chapter from GitHub, you can use the deploy.sh script to call the function we implemented previously. Provide the name of the deploy function to call it:

./deploy.sh deploy

It will start the building and deployment process with the Serverless Framework and will print something like this:

ASSETS DOWNLOADING
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 65.7M 0 65.7M 0 0 7647k 0 --:--:-- 0:00:08 --:--:-- 9968k
LAMBDAS BUILDING
Serverless: Building native Rust lambda_1 func...
Finished release [optimized] target(s) in 0.56s
adding: bootstrap (deflated 60%)
Serverless: Building native Rust lambda_2 func...
Finished release [optimized] target(s) in 0.32s
adding: bootstrap (deflated 61%)
Serverless: Packaging service...
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
.....
Serverless: Stack create finished...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service .zip file to S3 (2.75 MB)...
Serverless: Uploading service .zip file to S3 (1.12 MB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
........................................................................
Serverless: Stack update finished...
Service Information
service: rust-sls
stage: dev
region: us-east-1
stack: rust-sls-dev
api keys:
None
endpoints:
POST - https://48eggoi698.execute-api.us-east-1.amazonaws.com/dev/ride
GET - https://48eggoi698.execute-api.us-east-1.amazonaws.com/dev/check
functions:
lambda_1: rust-sls-dev-lambda_1
lambda_2: rust-sls-dev-lambda_2
layers:
None

The deployment takes time, and when it is finished the second command, sls client deploy, will be called to upload the assets folder with the serverless-finch plugin, and it prints the following:


ASSETS UPLOADING
Serverless: This deployment will:
Serverless: - Upload all files from 'assets' to bucket 'rust-sls-aws'
Serverless: - Set (and overwrite) bucket 'rust-sls-aws' configuration
Serverless: - Set (and overwrite) bucket 'rust-sls-aws' bucket policy
Serverless: - Set (and overwrite) bucket 'rust-sls-aws' CORS policy
? Do you want to proceed? true
Serverless: Looking for bucket...
Serverless: Bucket found...
Serverless: Deleting all objects from bucket...
Serverless: Configuring bucket...
Serverless: Configuring policy for bucket...
Serverless: Configuring CORS for bucket...
Serverless: Uploading client files to bucket...
Serverless: Success! Your site should be available at http://rust-sls-aws.s3-website-us-east-1.amazonaws.com/
CONFIGURATION UPLOADING
INDEX: http://rust-sls-aws.s3-website-us-east-1.amazonaws.com

The script printed the link that we can use to connect to and test the application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.116.51