This template creates an API resource called MyApi with the following properties: Name: MyApi, ProtocolType: WEBSOCKET, RouteSelectionExpression: $request.body.action, ApiKeySelectionExpression: $request.header.x-api-key

CloudFormation Template