Let’s deploy this sample application.
In the terminal tab in Cloud9, run cd api
.
Run sam deploy --guided
.
For Stack name, enter api
.
For AWS Region, hit return key to select the default.
For Confirm changes before deploy, enter the return key to select the default.
For Allow SAM CLI IAM role creation, enter the return key to select the default.
For HelloWorldFunction may not have authorization defined, Is this okay?, enter Y.
For Save arguments to configuration file, enter the return key to select the default.
For SAM configuration file, enter the return key to select the default.
For SAM configuration environment, enter the return key to select the default.
This deploys the solution into your environment. Please note it will take ~ 2 minutes to deploy.
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”}.
You have just deployed a REST API. Great work!!
Now let’s update the function to send back something more interesting than Hello World.