This document describes setting up a system to capture IoT data streams using both AWS IoT and Kinesis. Rules are configured to activate a Direct-To-Kinesis stream during certain events to capture real-time data. Lambda functions are created to handle logging, process Kinesis stream data, and publish updates to device shadows to control the streaming state. The code sample connects a device, sends test messages, and demonstrates switching between AWS IoT and Kinesis streaming based on the device shadow state.