-
Notifications
You must be signed in to change notification settings - Fork 0
/
repo_telegram-moderator-bot.tf
45 lines (36 loc) · 1.22 KB
/
repo_telegram-moderator-bot.tf
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
34
35
36
37
38
39
40
41
42
43
44
45
# Using "moderator" as a short internal ID for everything in here
module "moderator_repo" {
source = "github.com/BlindfoldedSurgery/terraform-repo-module?ref=v8.0.3"
name = "telegram-moderator-bot"
description = "Jack of all trades, master of none"
}
resource "google_service_account" "moderator_bot" {
account_id = "moderator-bot"
display_name = "Moderator Bot"
}
resource "google_project_iam_member" "moderator_consumer" {
project = google_service_account.moderator_bot.project
role = google_project_iam_custom_role.consumer.id
member = google_service_account.moderator_bot.member
}
resource "google_pubsub_subscription" "horoscopes_moderator" {
name = "moderator-horoscopes"
topic = google_pubsub_topic.horoscopes.id
enable_exactly_once_delivery = true
expiration_policy {
ttl = ""
}
retry_policy {
minimum_backoff = "30s"
maximum_backoff = "600s"
}
}
resource "google_service_account_key" "moderator" {
service_account_id = google_service_account.moderator_bot.account_id
}
resource "doppler_secret" "moderator_gsa_json" {
project = "prep"
config = "prd"
name = "MODERATOR_GSA_JSON"
value = base64decode(google_service_account_key.moderator.private_key)
}