Skip to content

IoTJobsDataPlaneClient

0

I'm implementing a job dispatcher in my iot client. I'd lke to call GetPendingJobExecutionsCommand() using AWS SDK for Javascript V3. When I make the call I'm getting an 'Invalid URL' error. I've looked in lots of places for the answers below. Please forgive me if I've missed published answers to these questions.

Iot has four endpoints according to 'aws iot describe-endpoints':

  • iot:Data - Returns a VeriSign signed data endpoint.
  • iot:Data-ATS - Returns an ATS signed data endpoint.
  • iot:CredentialProvider - Returns an AWS IoT credentials provider API endpoint.
  • iot:Jobs - Returns an AWS IoT device management Jobs API endpoint.

Which of these should be used with calling GetPendingJobExecutionsCommand()? Do I pass the endpoint to the IoTJobsDataPlaneClient constructor or do I pass it in somewhere else? Do I need to prepend the protocol, 'https://' to it or does the constructor do that for me?

Can you show me an example of how to make the call?

Thanks, John

asked 2 years ago356 views

1 Answer
4
Accepted Answer

For those interested I figured this out through trial and error: The correct endpoint is the iot:Jobs endpoint. 'https://' must be prepended to the 'iot:Jobs' endpoint returned by 'describe-endpoint'. The endpoint must be passed into the IoTJobsDataPlaneClient constructor, along with temporary aws credentials.

This is an iam (not iot) method, so the assumed role for 'credentials.iot.amazonaws.com' that is associated with the certificate attached to the thing must have the ''iotjobsdata:GetPendingJobExecutions' permission for the thing resource. I hope this makes sense and helps others.

answered 2 years ago

EXPERT

reviewed 2 years ago

AWS
EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.