So far we’ve created our Serverless Framework app. Now we are going to deploy it to AWS. Make sure you’ve configured your AWS account and AWS CLI.

A big advantage with serverless is that there isn’t any infrastructure or servers to provision. You can simply deploy your app directly and it’s ready to serve (millions of) users right away.

Let’s do a quick deploy to see how this works.

Change indicator In your project root, run the following.

$ serverless deploy

The first time your serverless app is deployed, it creates a S3 bucket (to store your Lambda function code), Lambda, API Gateway, and a few other resources. This can take a minute or two.

Once complete, you should see something like this:

Service Information
service: notes-api
stage: prod
region: us-east-1
stack: notes-api-prod
resources: 11
api keys:
  None
endpoints:
  GET - https://0f7jby961h.execute-api.us-east-1.amazonaws.com/prod/hello
functions:
  hello: notes-api-prod-hello
layers:
  None

Notice that we have a new GET endpoint created. In our case it points to — https://0f7jby961h.execute-api.us-east-1.amazonaws.com/prod/hello

If you head over to that URL, you should see something like this:

{"message":"Go Serverless v2.0! Your function executed successfully! (with a delay)"}

You’ll recall that this is the same output that we received when we invoked our Lambda function locally in the last chapter. In this case we are invoking that function through the /hello API endpoint.

We now have a serverless API endpoint. You only pay per request to this endpoint and it scales automatically. That’s a great first step!

Now we are ready to create our infrastructure. Starting with our database.