Skip to content

Instantly share code, notes, and snippets.

@metaskills
Created March 2, 2023 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metaskills/c461763cad8e055cdde175fea76bbbfd to your computer and use it in GitHub Desktop.
Save metaskills/c461763cad8e055cdde175fea76bbbfd to your computer and use it in GitHub Desktop.
DefaultWSLambda:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
CodeUri: "/var/task/src/ws/default"
Runtime: nodejs16.x
DefaultWSRoute:
Type: AWS::ApiGatewayV2::Route
Properties:
ApiId:
Ref: WS
RouteKey: "$default"
OperationName: DefaultWSRoute
Target:
Fn::Join:
- "/"
- - integrations
- Ref: DefaultWSIntegration
DefaultWSIntegration:
Type: AWS::ApiGatewayV2::Integration
Properties:
ApiId:
Ref: WS
IntegrationType: AWS_PROXY
IntegrationUri:
Fn::Sub:
- arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${DefaultWSLambda.Arn}/invocations
- {}
DefaultWSPermission:
Type: AWS::Lambda::Permission
DependsOn:
- WS
- DefaultWSLambda
Properties:
Action: lambda:InvokeFunction
FunctionName:
Ref: DefaultWSLambda
Principal: apigateway.amazonaws.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment