Best way to push IoT sensor data into Terraform-managed infrastructure?

Hi everyone, I’m trying to understand whether there’s a practical workflow for routing small IoT sensor events into infrastructure that’s managed with Terraform or Vault policies. For example, I’m experimenting with an ESP32 motion-detection setup https://www.theengineeringprojects.com/2022/03/iot-based-motion-detection-with-email-alert-using-esp32.html, and I’d like to trigger specific infra actions (or update secrets/metadata) based on these events.

I’ve seen some Arduino forum threads discussing MQTT → server pipelines and even Raspberry Pi users forwarding sensor alerts into lightweight APIs, plus a few IoT community discussions about using Nomad jobs as listeners. But I’m not sure what the cleanest approach is for integrating this kind of external event stream with Terraform or Vault without breaking best practices. Any suggestions or examples would be appreciated.