Which AWS service to use for receiving REST messages from IOT device

0

if an IOT device sends REST messages (in JSON format) to an endpoint using HTTPS. Which particular AWS service should I use to create and test the endpoint. Also, what kind of security and authentication can I implement?

Are there any tutorials available to implement this endpoint on AWS?

2개 답변
2

AWS IoT Core allows for messages to be published over MQTT, Websockets, and HTTP. This would allow your devices to publish to the managed endpoint meaning you wouldn't have to configure any servers or services, you could just get started with using it right away. See the following for reference: https://docs.aws.amazon.com/iot/latest/developerguide/http.html

From there, testing to see if the message comes through is made very simple; the AWS IoT Console contains a test console that allows you to view incoming messages. This is very helpful when building and testing IoT applications. See the following, short video that demonstrates how to use the test console: https://youtu.be/6w9a6y_-T2o?t=299

profile pictureAWS
전문가
답변함 2년 전
0

Take a look at AWS API Gateway - https://aws.amazon.com/api-gateway/

Is your backend already implemented in AWS as an HTTPS end-point. If that's the case, API Gateway can use that backend as its integration.

If you need to implement the backend application to process the REST API calls coming from your IoT devices, you can use AWS Lambda functions (https://aws.amazon.com/lambda/). API Gateway can also directly integrate with a number of other AWS services directly as well

You can find tutorials for API Gateway here - https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-rest-tutorials.html

For authentication in API Gateway, there are multiple options available. Those are discussed at a high level - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-to-api.html

Most commonly used mechanisms are

  1. Lambda Authorizers - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html
  2. Cognito User Pools - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-integrate-with-cognito.html
  3. AWS IAM - https://docs.aws.amazon.com/apigateway/latest/developerguide/permissions.html
  4. Cognito Identity Pools - https://aws.amazon.com/blogs/compute/secure-api-access-with-amazon-cognito-federated-identities-amazon-cognito-user-pools-and-amazon-api-gateway/

You can use this workshop - https://auth.serverlessworkshops.io/ if you want to get a good handle on authentication with AWS API Gateway

profile pictureAWS
전문가
답변함 2년 전
  • Hi Indranil,

    Really appreciate your detailed response. Currently, I don't have any integrations on AWS. I'm pretty much new to AWS and Basically I'm gathering an information about the following situation:

    If an IOT device sends REST messages to an endpoint using HTTPS. In order to confirm that the messages are being properly sent or can be received, how would I set a testing endpoint in AWS?

  • API Gateway does not have to use Lambdas or AWS Services or HTTP(S) endpoints running inside AWS as the integration. API Gateway can invoke any public HTTP(S) endpoint even if it is not running inside AWS.

    Having said that, if your backend service is running outside of AWS and you just want to set up a mock inside AWS for testing purposes, you can use a mock integration to generate a hard-coded response that matches your response from the actual backend but with dummy values - https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-mock-integration.html

  • You can export your API swagger definition from your actual backend service and import the swagger into API Gateway to create your API definitions in API Gateway - https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html

    You can then swap the backends with mock implementations using the AWS API Gateway console

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인