about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-06-07T09·35+0300
committertazjin <tazjin@tvl.su>2023-06-09T12·21+0000
commit1e70cd1c4fc029242eced15caa111cf47fd43484 (patch)
tree88256c2d0950cf3c6c2155224e7c893ebaf652db
parentb78a9b7fe117f84b8378ad105840b2cd5cc96868 (diff)
feat(corp/ops): initial resources for running rih container r/6246
Change-Id: Ie7276396bbfcff64d91ca8cc655cad6927fd6599
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8718
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
-rw-r--r--corp/ops/yandex/rih.tf36
1 files changed, 36 insertions, 0 deletions
diff --git a/corp/ops/yandex/rih.tf b/corp/ops/yandex/rih.tf
index de51ad738e80..f15c1432d247 100644
--- a/corp/ops/yandex/rih.tf
+++ b/corp/ops/yandex/rih.tf
@@ -67,3 +67,39 @@ resource "yandex_dns_recordset" "aname_russiaishiring_com" {
   data    = ["russiaishiring.com.website.yandexcloud.net"]
   ttl     = 600
 }
+
+resource "yandex_container_registry" "rih_registry" {
+  name      = "rih-registry"
+  folder_id = local.rih_folder_id
+}
+
+resource "yandex_iam_service_account" "rih_backend" {
+  name      = "rih-backend"
+  folder_id = local.rih_folder_id
+}
+
+resource "yandex_resourcemanager_folder_iam_member" "rih_backend_storage_editor" {
+  folder_id = local.rih_folder_id
+  role      = "storage.editor"
+  member    = "serviceAccount:${yandex_iam_service_account.rih_backend.id}"
+}
+
+resource "yandex_resourcemanager_folder_iam_member" "rih_backend_image_pull" {
+  folder_id = local.rih_folder_id
+  role      = "container-registry.images.puller"
+  member    = "serviceAccount:${yandex_iam_service_account.rih_backend.id}"
+}
+
+resource "yandex_serverless_container" "rih_backend" {
+  name               = "rih-backend"
+  folder_id          = local.rih_folder_id
+  memory             = 128
+  execution_timeout  = "10s"
+  cores              = 1
+  core_fraction      = 100
+  service_account_id = yandex_iam_service_account.rih_backend.id
+
+  image {
+    url = "cr.yandex/crpkcq65tn6bhq6puq2o/rih-backend:a4sdm3gn9l41xv3lyr5642mpd9m0fdhg"
+  }
+}