【发布时间】:2017-04-27 02:49:17
【问题描述】:
就像标题一样。我尝试使用云形成将 API 网关方法与 SQS 集成。我缺少的是 SQS 的正确 URI。如果你们中的任何人已经这样做了,那么 URI 应该是什么样的?
我想出了类似的东西,但不知道将 SQS ARN 放在哪里
"arn:aws:apigateway:${AWS::Region}:sqs:action/SendMessage"
这是该方法的完整配置:
PostMethod:
Type: "AWS::ApiGateway::Method"
Properties:
ApiKeyRequired: "true"
HttpMethod: "POST"
ResourceId: !Ref "SomeResource"
RestApiId: !Ref "SomeRestApi"
Integration:
IntegrationHttpMethod: "POST"
IntegrationResponses:
- StatusCode: 200
Type: "AWS"
Uri: "arn:aws:apigateway:${AWS::Region}:sqs:action/SendMessage"
如果您与 lambda 函数集成,这里是一个 URI 示例:
arn:aws:apigateway:us-west-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:function_name/invocations
-
【问题讨论】:
-
为了进一步参考,我也发现这篇文章非常有用:dzone.com/articles/creating-aws-service-proxy-for-amazon-sqs
-
这里调用的替代方法是 SQS 的路径 uri:
arn:aws:apigateway:AWS_REGION:sqs:path/YOUR_AWS_ID/YOUR_SQS_QUEUE_NAME
标签: amazon-web-services aws-api-gateway amazon-cloudformation