-
Notifications
You must be signed in to change notification settings - Fork 0
/
repo_telegram-speech-bot.tf
40 lines (33 loc) · 1.09 KB
/
repo_telegram-speech-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
# Using "bob" as a short internal ID for everything in here
module "bob_repo" {
source = "github.com/BlindfoldedSurgery/terraform-repo-module?ref=v8.0.3"
name = "telegram-speech-bot"
description = "TTS for all your annoyance needs"
}
resource "google_service_account" "bob_bot" {
account_id = "bob-bot"
display_name = "Bob Bot"
}
resource "google_project_iam_member" "bob_policies" {
for_each = toset([
"roles/cloudtranslate.user",
"roles/datastore.user",
])
project = google_service_account.bob_bot.project
role = each.key
member = google_service_account.bob_bot.member
}
resource "google_service_account_key" "bob" {
service_account_id = google_service_account.bob_bot.account_id
}
resource "github_actions_secret" "bob_gsa" {
repository = module.bob_repo.name
secret_name = "SERVICE_ACCOUNT_JSON_B64"
plaintext_value = google_service_account_key.bob.private_key
}
resource "doppler_secret" "bob_gsa_json" {
project = "prep"
config = "prd"
name = "BOB_GSA_JSON"
value = base64decode(google_service_account_key.bob.private_key)
}