title: What is the simplest way to process WebSockets messages on AWS?
body: <p>What is a good way to deploy a WebSockets client on AWS?</p>
  
  <p>I'm building an app on AWS which needs to subscribe to several WebSockets and several REST sources and process incoming messages (WebSockets) or make periodic requests (REST). I'm trying to go server-less and maximize use of AWS platform services, to eliminate the need to manage VMs, OS patches, etc. (and hopefully reduce cost).</p>
  
  <p>My idea so far is to trigger a Lambda function every time a message arrives. The function can then transform/normalize the message and push it to an SQS queue for further processing by other subsystems.</p>
  
  <p>There would be two types of such Lambda clients, one that subscribes to WebSockets messages and another that makes HTTP request periodically when invoked by a CloudWatch schedule. It would look something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/MNQgh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MNQgh.png" alt="http://i.imgur.com/8M7YGif.png"></a></p>
  
  <p>This approach seems reasonable for my REST clients, but I haven't been able to determine if it's possible to subscribe to WebSockets messages using Lambda. Lambdas can be triggered by IoT, and apparently IoT supports WebSockets now, but apparently only as a transport for the MQTT protocol:</p>
  
  <p><a href="https://aws.amazon.com/about-aws/whats-new/2016/01/aws-iot-now-supports-websockets-custom-keepalive-intervals-and-enhanced-console/" rel="nofollow noreferrer">AWS IoT Now Supports WebSockets, Custom Keepalive Intervals, and Enhanced Console</a></p>
  
  <p>What is the best/easiest/cheapest way to deploy a WebSockets client without deploying an entire EC2 or Docker instance?</p>