Using Token Exchange Service with aws-iot-device-sdk-js-v2 and greengrass
I would like to run a node js app that uses the aws-iot-device-sdk-js-v2 as a greengrass component. I am unsure if this sdk will accept the credentials automatically from the TES?
Would it then be possible to send data to AWS IOT Core Topics?
The aws-iot-device-sdk-js-v2 SDK is used for IoT operations which does not require TokenExchangeService component or its IAM role, but requires appropriate IoT permissions on the IoT Policy that is attached to the certificate that your IoT device has, please see https://docs.aws.amazon.com/greengrass/v2/developerguide/device-auth.html .
From Greengrass Core devices, our recommended method to send data to IoT Core topics is through Greengrass IPC APIs we provide for that https://docs.aws.amazon.com/greengrass/v2/developerguide/ipc-iot-core-mqtt.html . But Greengrass IPC is not available with the JS SDK at the moment aws-iot-device-sdk-js-v2, the current supported languages are Java, Python and C++. You could either switch to one of these or if you need to keep using the JS SDK, you can still connect to IoT Core directly using it (not via Greengrass IPC) and the certificate on the device that you can find in the Greengrass root directory.
The TES component and role are needed for any non IoT services e.g. S3 and to use that, you can declare a dependency on the aws.greeengrass.TokenExchangeService component inside your own component's recipe and provide relevant permissions on your Token Exchange IAM role policy.
Restarting a Greengrass component with a container creates two instances of that containerAccepted Answer
Greengrass Install Script Re-installs pip3 components every time
Greengrass Deployment configuration use environment variablesAccepted Answerasked 5 months ago
Deploying greengrass v2 public components using CDK (e.g. ShadowManager)?asked 3 months ago
Using Token Exchange Service with aws-iot-device-sdk-js-v2 and greengrassasked 7 months ago
Greengrass v2 add componentAccepted Answerasked 9 months ago
How to implement authentication in AWs IoT Greengrass Component deployed to the Greengrass Core Device?asked 2 months ago
GreenGrass is not authorized to assume the Service RoleAccepted Answerasked 2 years ago
Greengrass v2 interact with shadows from a nodejs lambdaAccepted Answerasked 20 days ago
Greengrass v2 component dependenciesasked 2 months ago