跳至内容

creating role for api to sqs integration

0

I'm trying to set up an integration between an API Gateway endpoint and an SQS queue. Doing so seems to require (please tell me if this is wrong) my API Gateway http to assume an IAM role that has permissions to send messages to my SQS queue.

When I go to create the required role in the AWS console, the console requires that the role be assign a "use case". The only use case for API Gateway offered in the console seems to be to "push logs to cloudwatch". In other words, a use case that involves API Gateway sending messages in an SQS queue is not offered.

Does this mean that I cannot create the required role using the AWS console?

2 回答
1

Hi

Please try this solution.

To integrate an API Gateway endpoint with an SQS queue, you need to create an IAM role that allows API Gateway to send messages to the SQS queue. Start by navigating to the IAM Console, create a new role, and select API Gateway as the trusted entity. Attach the AmazonSQSFullAccess policy or create a custom policy that grants the sqs:SendMessage permission to your specific SQS queue. After creating the role, go to the API Gateway Console, configure your API's integration request to use AWS Service, select Simple Queue Service (SQS), and provide the necessary details such as the queue URL. Finally, in the integration settings, specify the ARN of the IAM role you created, and deploy your API. This setup allows API Gateway to assume the role and send messages to the SQS queue.

please look at Repost link

https://repost.aws/knowledge-center/api-gateway-rest-api-sqs-errors

专家
已回答 2 年前
专家
已审核 2 年前
专家
已审核 2 年前
0

Hi, Please follow below document very helpful to you

https://repost.aws/knowledge-center/api-gateway-rest-api-sqs-errors

专家
已回答 2 年前
专家
已审核 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。