无法通过 CLI 创建 FIFO SQS

Cannot create a FIFO SQS through CLI

我正在尝试使用 CLI 创建 FIFO,但出现错误

aws sqs create-queue --queue-name my-queue.fifo --attributes FifoQueue=true --region us-east-1

An error occurred (InvalidAttributeName) when calling the CreateQueue operation: Unknown Attribute FifoQueue.

The doc page 表示这是一个有效的属性。我错过了什么?

SQS FIFO 队列是少数在北弗吉尼亚州推出时不可用的服务之一。

参见:https://aws.amazon.com/about-aws/whats-new/2016/11/amazon-sqs-introduces-fifo-queues-with-exactly-once-processing-and-lower-prices-for-standard-queues/

FIFO queues are now available in the US East (Ohio) and US West (Oregon) regions, with more regions to follow.

在受支持的区域之一中尝试 运行 命令。

俄亥俄州:

aws sqs create-queue --queue-name my-queue.fifo --attributes FifoQueue=true --region us-east-2

俄勒冈州:

aws sqs create-queue --queue-name my-queue.fifo --attributes FifoQueue=true --region us-west-2

更新:现在,北弗吉尼亚已经支持 FIFO SQS 队列。

SQS 队列有两种不同的类型。 1)标准队列 2) 先进先出队列

如果您使用的是标准队列,请尝试 运行 创建队列的命令。

aws sqs create-queue --queue-name <<queue-name>> --attributes VisibilityTimeout=900

如果您使用的是 Fifo 队列,请尝试 运行 创建队列的命令。

  • FIFO 队列的名称必须以 .fifo 后缀结尾。后缀计入 80 个字符的队列名称配额。判断队列是否FIFO,可以看队列名是否以后缀结尾
  • 将队列指定为 FIFO。有效值:真​​、假。如果您不指定 FifoQueue 属性,Amazon SQS 会创建一个标准队列。您只能在队列创建期间提供此属性。您不能为现有队列更改它。当您设置此属性时,您还必须明确地为您的消息提供 MessageGroupId。
  • 属性必须在字符串中。

aws sqs create-queue --queue-name queue-name.fifo --region us-east-1 --attributes "{\"FifoQueue\":\"true\", \"VisibilityTimeout\":\"900\"}"