Yandex Cloud
Поиск
Связаться с намиПопробовать бесплатно
  • Истории успеха
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
  • Marketplace
    • Популярные
    • Инфраструктура и сеть
    • Платформа данных
    • Искусственный интеллект
    • Безопасность
    • Инструменты DevOps
    • Бессерверные вычисления
    • Управление ресурсами
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Облако для интеграторов
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Контент-программа
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Калькулятор цен
    • Тарифы
    • Акции и free tier
  • Истории успеха
  • Документация
  • Блог
Создавайте контент и получайте гранты!Готовы написать своё руководство? Участвуйте в контент-программе и получайте гранты на работу с облачными сервисами!
Подробнее о программе
Проект Яндекса
© 2026 ООО «Яндекс.Облако»
Terraform в Yandex Cloud
  • Начало работы
  • Библиотека решений
    • Обзор
    • История изменений (англ.)
          • message_queue

В этой статье:

  • Example usage
  • Arguments & Attributes Reference
  • Import
  1. Справочник Terraform
  2. Ресурсы (англ.)
  3. Message Queue
  4. Resources
  5. message_queue

yandex_message_queue (Resource)

Статья создана
Yandex Cloud
Обновлена 9 февраля 2026 г.
  • Example usage
  • Arguments & Attributes Reference
  • Import

Allows management of Yandex Cloud Message Queue.

Example usageExample usage

//
// Create a new Message Queue.
//
resource "yandex_message_queue" "my_queue" {
  name                       = "ymq_terraform_example"
  visibility_timeout_seconds = 600
  receive_wait_time_seconds  = 20
  message_retention_seconds  = 1209600
  redrive_policy = jsonencode({
    deadLetterTargetArn = yandex_message_queue.example_deadletter_queue.arn
    maxReceiveCount     = 3
  })
}

resource "yandex_message_queue" "my_deadletter_queue" {
  name = "ymq_terraform_deadletter_example"
}
//
// Create a new Message Queue with FIFO.
//
resource "yandex_message_queue" "example_fifo_queue" {
  name                        = "ymq_terraform_fifo_example.fifo"
  fifo_queue                  = true
  content_based_deduplication = true
}

Arguments & Attributes ReferenceArguments & Attributes Reference

  • access_key (String). The access key to use when applying changes. If omitted, ymq_access_key specified in provider config is used. For more information see documentation.
  • arn (Read-Only) (String). ARN of the Yandex Message Queue. It is used for setting up a redrive policy. See documentation.
  • content_based_deduplication (Bool). Enables content-based deduplication. Can be used only if queue is FIFO.
  • delay_seconds (Number). Number of seconds to delay the message from being available for processing. Valid values: from 0 to 900 seconds (15 minutes). Default: 0.
  • fifo_queue (Bool). Is this queue FIFO. If this parameter is not used, a standard queue is created. You cannot change the parameter value for a created queue.
  • id (String).
  • max_message_size (Number). Maximum message size in bytes. Valid values: from 1024 bytes (1 KB) to 262144 bytes (256 KB). Default: 262144 (256 KB). For more information see documentation.
  • message_retention_seconds (Number). The length of time in seconds to retain a message. Valid values: from 60 seconds (1 minute) to 1209600 seconds (14 days). Default: 345600 (4 days). For more information see documentation.
  • name (String). Queue name. The maximum length is 80 characters. You can use numbers, letters, underscores, and hyphens in the name. The name of a FIFO queue must end with the .fifo suffix. If not specified, random name will be generated. Conflicts with name_prefix. For more information see documentation.
  • name_prefix (String). Generates random name with the specified prefix. Conflicts with name.
  • receive_wait_time_seconds (Number). Wait time for the ReceiveMessage method (for long polling), in seconds. Valid values: from 0 to 20 seconds. Default: 0. For more information about long polling see documentation.
  • redrive_policy (String). Message redrive policy in Dead Letter Queue. The source queue and DLQ must be the same type: for FIFO queues, the DLQ must also be a FIFO queue. For more information about redrive policy see documentation. Also you can use example in this page.
  • region_id (String). ID of the region where the message queue is located at. The default is 'ru-central1'.
  • secret_key (String). The secret key to use when applying changes. If omitted, ymq_secret_key specified in provider config is used. For more information see documentation.
  • tags (Map Of String). SQS tags
  • visibility_timeout_seconds (Number). Visibility timeout for messages in a queue, specified in seconds. Valid values: from 0 to 43200 seconds (12 hours). Default: 30.

ImportImport

The resource can be imported by using their resource ID. For getting it you can use Yandex Cloud Web Console or Yandex Cloud CLI.

# terraform import yandex_message_queue.<resource Name> <queue URL>
terraform import yandex_message_queue.my_queue https://message-queue.api.cloud.yandex.net/abcdefghijklmn123456/opqrstuvwxyz87654321/ymq_terraform_import_example

Была ли статья полезна?

Предыдущая
message_queue
Следующая
monitoring_dashboard
Создавайте контент и получайте гранты!Готовы написать своё руководство? Участвуйте в контент-программе и получайте гранты на работу с облачными сервисами!
Подробнее о программе
Проект Яндекса
© 2026 ООО «Яндекс.Облако»