Serverless Programming Cookbook
上QQ阅读APP看书,第一时间看更新

How it works...

In this recipe, we created our first REST API using Amazon CloudFormation. In the previous recipe, Building your first API using the AWS CLI, we created a similar API, but with the AWS CLI. Since the properties related to API Gateway API creation were already discussed in that recipe, I will not repeat them here.

We introduced a new CloudFormation template component: Outputs. We also used a sub-function in its value field, in order to derive a sample API endpoint. The maximum output that you can define in a template is 60. Its export parameter (not used here) can be used to specify an export name for the Outputs and reference it from another stack (a cross-stack reference).