AWS Step Functions
开发人员指南
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

使用 Step Functions 调用 Amazon SQS

Step Functions can control some AWS services directly from the Amazon 状态语言. For more information, see:

支持的 API:

注意

There is a limit on the maximum input or result data size for a task in Step Functions. This limits you to 32,768 characters of data when you send to, or receive data from, another service. See 与状态机执行相关的限制.

下面是一个发送 Amazon SQS 消息的 Task 状态。

{ "StartAt": "Send to SQS", "States": { "Send to SQS": { "Type": "Task", "Resource": "arn:aws-cn:states:::sqs:sendMessage", "Parameters": { "QueueUrl": "https://sqs.us-east-1.amazonaws.com/123456789012/myQueue", "MessageBody.$": "$.input.message", "MessageAttributes": { "my attribute no 1": { "DataType": "String", "StringValue": "value of my attribute no 1" }, "my attribute no 2": { "DataType": "String", "StringValue": "value of my attribute no 2" } } }, "End": true } } }

要了解有关在 Amazon SQS 中接收消息的更多信息,请参阅 Amazon Simple Queue Service 开发人员指南中的接收和删除消息

For information on how to configure IAM when using Step Functions with other AWS services, see 集成服务的 IAM 策略.