Last active
March 17, 2021 18:45
-
-
Save colindjk/25b030c05e795fa5b3deee3d8b8c9b84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example config where two `Function`s use the same underlying function | |
# but will have different results based on parameters. | |
# `function handler(event, context)` | |
Globals: | |
# Definitions used by all `AWS::Serverless::Function`s. | |
Function: | |
Runtime: nodejs12.x | |
Timeout: 180 | |
# Directory where the callable function is stored. | |
CodeUri: src/ | |
# The callback function which takes two parameters (event, context). | |
Handler: index.handler | |
Environment: | |
Variables: | |
TABLE_NAME: data-table | |
# Resources can be anything (Functions, Api, HttpApi, LayerVersion etc.) | |
Resources: | |
HelloWorldFunction: | |
# This will by default use `index.handler` as it's calling function. | |
Type: AWS::Serverless::Function | |
Properties: | |
Environment: | |
Variables: | |
MESSAGE: "Hello From SAM" | |
# Handles the "Thumbnail" event. | |
ThumbnailFunction: | |
# This will by default use `index.handler` as it's calling function. | |
Type: AWS::Serverless::Function | |
Properties: | |
Events: | |
Thumbnail: # Arbitrary name for event. Useful for code-gen. | |
Type: Api | |
Properties: | |
Path: /thumbnail | |
Method: POST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment