1 Answer
- Newest
- Most votes
- Most comments
0
You should be able to get a thing name from an env variable AWS_IOT_THING_NAME
inside a GGv2 component and construct a topic which looks something like this AWS_IOT_THING_NAME/message/response
where you can send the back the info to.
You will also have the info from which topic the message got received into in a lambda function payload, thus you can know where to send it back.
answered a year ago
Relevant content
- asked 3 years ago
- asked 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 7 months ago
Do I have to specify anything in recipe.json to get AWS_IOT_THING_NAME ?? I am using AWS Java SDK. In component what am I suppose to write to fetch the AWS_IOT_THING_NAME. Is it something like system.getEnvironment(AWS_IOT_THING_NAME) ??
https://docs.aws.amazon.com/greengrass/v2/developerguide/component-environment-variables.html
You don't need to do anything special.
AWS_IOT_THING_NAME
is provided as a regular environment variable.