From 1e70cd1c4fc029242eced15caa111cf47fd43484 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 7 Jun 2023 12:35:57 +0300 Subject: feat(corp/ops): initial resources for running rih container Change-Id: Ie7276396bbfcff64d91ca8cc655cad6927fd6599 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8718 Tested-by: BuildkiteCI Reviewed-by: tazjin --- corp/ops/yandex/rih.tf | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'corp/ops/yandex') 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" + } +} -- cgit 1.4.1