Deploy sample

Let’s deploy this sample application.

  1. In the terminal tab in Cloud9, run cd api.

  2. Run sam deploy --guided.

  3. For Stack name, enter api.

  4. For AWS Region, hit return key to select the default.

  5. For Confirm changes before deploy, enter the return key to select the default.

  6. For Allow SAM CLI IAM role creation, enter the return key to select the default.

  7. For HelloWorldFunction may not have authorization defined, Is this okay?, enter Y.

  8. For Save arguments to configuration file, enter the return key to select the default.

  9. For SAM configuration file, enter the return key to select the default.

  10. For SAM configuration environment, enter the return key to select the default.

    SAM deploy

    This deploys the solution into your environment. Please note it will take ~ 2 minutes to deploy.

  11. Click the link in the output section and select Open from the dropdown menu. This will open a browser with the body {“message”:“hello world”}.

SAM deploy

You have just deployed a REST API. Great work!!

Now let’s update the function to send back something more interesting than Hello World.