-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection failure when using SDKv2 within API Gateway Lambda from SAM #315
Comments
To clarify when I say the lambda works locally I mean:
The function runs as intended with no network connectivity issues locally. If I deploy:
and then swap the endpoint from my localhost to the prod endpoint provided by AWS and send the request. I get network issues when I look at the cloudwatch logs for the lambda invocation through the API GW logs. |
Would indicate that it's an IAM permissions issue. |
I'm not following? The connection is established with these:
If it was a IAM permission issue wouldn't it not work when I do an invocation locally when I run the Same credentials across the board. |
I don't have any experience with sam and/or the relationship (if any) between local deployments/services and associated real AWS services. You're getting a CONNACK packet from IoT Core that is explicitly stating that there's no permission to send a CONNECT packet in the policy associated with the authentication context (cert/key pair). |
Circled in the SAM folks. |
Can you make sure that you have set up your IAM policy correctly with the correct permissions? Your IAM policy can be set up to only allow certain things. You can test with a fully permissive IoT thing policy and then restrict it to only things that you need later: {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"*"
],
"Resource": [
"*"
]
}
]
} You can read more about IoT Core policies here |
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one. |
Describe the bug
I've developed a serverless api function that uses the iot SDK to connect to mqtt and publish a message. During development the functionality works as it's suppose to, but once it's deployed into AWS there seems to be some network issues with the SDK. The MQTT is not able to establish a connection when deployed within AWS.
Expected Behavior
It should be able to connect to the MQTT client and publish a message to a topic.
Current Behavior
Reproduction Steps
Create a SAM api lambda function with no auth to hit the API. In the lambda try to connect to MQTT in greengrass and publish a topic.
SAM
MQTT client
lambda handler
Possible Solution
Not sure, I think there's networking issues in the SDK
Additional Information/Context
No response
SDK version used
"aws-iot-device-sdk-v2": "^1.9.0"
Environment details (OS name and version, etc.)
Linux Ubuntu 22.04
The text was updated successfully, but these errors were encountered: