The following is the SAM YAML template for the Weather Service example. It broadly consists of three components:
- An API Gateway definition that points to the Swagger file for detailed configuration.
- An AWS Lambda function configuration with a link to code the .zip file, handler name, and runtime environment. In order to link this Lambda function with the API gateway instance, it also has details on the REST API methods and the URI paths, which will be used as triggers to the Lambda function.
- The final section is around output, which is basically the URI of the API endpoint once the entire stack has been created by SAM:
AWSTemplateFormatVersion: '2010-09-09'Transform: AWS::Serverless-2016-10-31Description: A simple cloud-native ...