Last active
December 5, 2019 21:40
-
-
Save AndrzejKomarnicki/d5b08b1815664c737c77537daa21d773 to your computer and use it in GitHub Desktop.
AWS SAM template.yaml with the new API Gateway V2 HTTP API support
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
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: > | |
sam-appapigw2 | |
Sample SAM Template for sam-appapigw2 | |
# API Gateway V2 with HTTP API | |
Globals: | |
Function: | |
Timeout: 3 | |
Resources: | |
HelloWorldFunction: | |
Type: AWS::Serverless::Function | |
Properties: | |
CodeUri: hello-world/ | |
Handler: app.lambdaHandler | |
Runtime: nodejs12.x | |
Events: | |
HelloWorld: | |
Type: HttpApi #changed from default Api type | |
Properties: | |
Path: /hello | |
Method: get | |
Outputs: | |
HelloWorldHttpApi: | |
Description: "This API defaults to a StageName called '$default' that cannot be configured" | |
Value: !Sub "https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com/hello" #SAM will use the $default stage from Api Gateway | |
HelloWorldFunction: | |
Description: "Hello World Lambda Function ARN" | |
Value: !GetAtt HelloWorldFunction.Arn | |
HelloWorldFunctionIamRole: | |
Description: "Implicit IAM Role created for Hello World function" | |
Value: !GetAtt HelloWorldFunctionRole.Arn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment