-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage-queue.tf
More file actions
33 lines (32 loc) · 994 Bytes
/
Copy pathmessage-queue.tf
File metadata and controls
33 lines (32 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// Создать очередь
//
resource "yandex_message_queue" "tg-bot-message-queue" {
name = "tg-bot-message-queue"
message_retention_seconds = 3600
access_key = yandex_iam_service_account_static_access_key.sa-editor-static-key.access_key
secret_key = yandex_iam_service_account_static_access_key.sa-editor-static-key.secret_key
}
//
// Создать шлюз
//
resource "yandex_api_gateway" "tg-bot-api-gateway" {
name = "tg-bot-api-gateway"
description = "шлюз для телеграм-бота"
spec = <<-EOT
openapi: 3.0.0
info:
title: Sample API
version: 1.0.0
paths:
/tg-bot:
post:
x-yc-apigateway-integration:
queue_url: ${yandex_message_queue.tg-bot-message-queue.id}
action: SendMessage
type: cloud_ymq
payload_format_type: body
folder_id: ${var.folder_id}
service_account_id: ${yandex_iam_service_account.sa-editor.id}
EOT
}