Skip to content

Instantly share code, notes, and snippets.

@5t33
Last active July 7, 2020 02:52
Show Gist options
  • Save 5t33/3df63e1157c013893e2e7127b2f6be9b to your computer and use it in GitHub Desktop.
Save 5t33/3df63e1157c013893e2e7127b2f6be9b to your computer and use it in GitHub Desktop.
functions:
DemoLambda:
role: DemoLambdaRole
handler: index.handler
integration: lambda
events:
- http:
path: /health_check
method: get
integration: lambda
- http:
path: /respond_400
method: post
integration: lambda
response:
statusCodes:
400:
pattern: '.*"statusCode":400,.*' # JSON response
template: $input.path("$.errorMessage") # JSON return object
- http:
path: /throw_error
method: get
integration: lambda
response:
statusCodes:
500:
pattern: '.*"statusCode":500,.*' # JSON response
template: $input.path("$.errorMessage") # JSON return object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment