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/a215841725223e2838fdc4c726722774 to your computer and use it in GitHub Desktop.
Save metaskills/a215841725223e2838fdc4c726722774 to your computer and use it in GitHub Desktop.
ConnectWSLambda:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
CodeUri: "/var/task/src/ws/connect"
ConnectWSRoute:
Type: AWS::ApiGatewayV2::Route
Properties:
ApiId:
Ref: WS
RouteKey: "$connect"
OperationName: ConnectWSRoute
Target:
Fn::Join:
- "/"
- - integrations
- Ref: ConnectWSIntegration
ConnectWSIntegration:
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/${ConnectWSLambda.Arn}/invocations
- {}
ConnectWSPermission:
Type: AWS::Lambda::Permission
DependsOn:
- WS
- ConnectWSLambda
Properties:
Action: lambda:InvokeFunction
FunctionName:
Ref: ConnectWSLambda
Principal: apigateway.amazonaws.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment