The immediate issue I am trying to overcome is that my aws-lambda function is not connecting to my broke using the js MQTT library. I am able to use this library in a local node environment to connect, just not in the aws-lambda function.
I have created a zip file from this repo: https://github.com/JordanKlaers/AlexaMQTT
That I uploaded to my lambda function. I am using the exported function from index.js.
Everything works well except for the part where it does not connect to the broker/client (line 83 in index.js) When I run oldIndex.js from the repo I linked (which is just the promise function that connects, from the aws-lambda function) in my local node environment it connects and things run correctly.
I dont know how to create a minimum reproducible sketch because its success is based on interacting with hardware. I did create the "oldIndex.js" as a minimum sketch to show that at least the function to connect works. I have included logs of the lambda function to show that it works as expected up to the attempt to connect.
The only thing I can speculate would be some issue with my permissions for the role used with the lambda function but I have researched and added different policies to my role but that hasnt helped.
Here are the logs from the function when called (which shows that it gets to the promise and attempts to connect but doesnt succeed)
I had done almost everything myself, but got some final clarification on my approach from this tutorial so I not sure what else Im not considering/missing.