- Newest
- Most votes
- Most comments
Hello,
The "DefaultConfiguration" topic should not be included when merging config changes in your deployment since the MERGE update will update the "DefaultConfiguration" directly. More information about Merge updates can be found here.
Only including the "accessControl" topic in the Merge update should fix the authorization errors that you are experiencing.
Hope this helps!
answered 2 years ago
After checking multiple times i'm still having this issue and giving up on using IPC V2 on Greengrass Lambda.
It seems that mqttproxy.MqttProxyIPCAgent doesn't recognize the config policy associated with the service.
I've used the console debug Module : https://docs.aws.amazon.com/greengrass/v2/developerguide/local-debug-console-component.html
And my policy is correct.
answered 2 years ago
The issue you're experiencing is related to authorization for your Greengrass component to publish messages to IoT Core. Based on the error message and your configuration, there are a few things we can check and adjust:
-
Component Name Mismatch: In your deployment configuration, you're using "com.example.MyIoTCorePubSubComponent" as the component name. However, in the error message, it shows "Principal com.example.MyIoTCorePubSubComponent". Make sure the component name in your deployment configuration exactly matches the name of your component.
-
Authorization Policy: Your current policy for the MQTT proxy looks like this:
"com.example.MyIoTCorePubSubComponent:mqttproxy:1": { "policyDescription": "Allows access to publish to IoT Core", "operations": [ "aws.greengrass#PublishToIoTCore", "aws.greengrass#SubscribeToIoTCore" ], "resources": [ "aws/test/events" ] }Try modifying it to use a wildcard for resources:
"com.example.MyIoTCorePubSubComponent:mqttproxy:1": { "policyDescription": "Allows access to publish to IoT Core", "operations": [ "aws.greengrass#PublishToIoTCore", "aws.greengrass#SubscribeToIoTCore" ], "resources": [ "*" ] } -
IPC Service Name: Ensure you're using the correct IPC service name. For MQTT operations, it should be "aws.greengrass.ipc.mqttproxy".
-
Component Version: Make sure the component version in your deployment matches the version you're trying to run. Your deployment shows version 1.0.7, so ensure this is correct.
-
Deployment Status: Verify that your latest deployment with the correct permissions has been successfully applied to the Greengrass core device.
-
Restart the Greengrass core: After making these changes and deploying, try restarting the Greengrass core to ensure all changes take effect.
If you've verified all these points and are still experiencing issues, you may want to check the Greengrass logs for more detailed error messages. The logs might provide additional context about why the authorization is failing.
Remember that changes to component configurations require a new deployment, and it may take a short time for the changes to propagate and take effect on the core device.
Sources
Troubleshooting AWS IoT Greengrass V2 - AWS IoT Greengrass
Configure the Lambda function for AWS IoT Greengrass - AWS IoT Greengrass
Device authentication and authorization for AWS IoT Greengrass - AWS IoT Greengrass
answered 2 years ago
Relevant content
asked 4 years ago
asked 5 years ago

The response provided is correct and addresses the core issue, but I wanted to try and offer some additional insights and clarifications:
Configuration structure: The error stems from how the configuration is structured in the deployment. As Robert suggests, the "DefaultConfiguration" layer is unnecessary and can cause issues.
Suggested modification to configuration: Here's how the configuration could be structured:
Review the Gen AI stuff below. Good insight there as well.