Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions infra/cmd_poweron.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ module "telegram_bot_queue_cmd_poweron" {
module "telegram_bot_cmd_poweron" {
source = "./modules/handler"

function_name = "telegram-bot-cmd-poweron"
source_path = "${path.root}/../apps/poweron"
function_name = "telegram-bot-cmd-poweron"
reserved_concurrent_executions = 3
source_path = "${path.root}/../apps/poweron"

sqs_batch_size = 10
sqs_queue_arn = module.telegram_bot_queue_cmd_poweron.sqs_queue_arn
Expand Down
5 changes: 3 additions & 2 deletions infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ module "telegram_bot_api" {
module "telegram_bot_handler_mux" {
source = "./modules/handler"

function_name = "telegram-bot-mux"
source_path = "${path.root}/../apps/mux"
function_name = "telegram-bot-mux"
reserved_concurrent_executions = 3
source_path = "${path.root}/../apps/mux"

sqs_batch_size = 10
sqs_queue_arn = module.telegram_bot_queue_mux.sqs_queue_arn
Expand Down
2 changes: 1 addition & 1 deletion infra/modules/alerting/telegram.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "aws_lambda_function" "telegram" {
runtime = "provided.al2023"
timeout = 10
memory_size = 128
reserved_concurrent_executions = 10
reserved_concurrent_executions = var.reserved_concurrent_executions

environment {
variables = {
Expand Down
5 changes: 5 additions & 0 deletions infra/modules/alerting/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ variable "name" {
type = string
}

variable "reserved_concurrent_executions" {
description = "Reserved concurrent executions for the Lambda function"
type = number
}

variable "emails" {
description = "Emails to subscribe to the SNS topic"
type = list(string)
Expand Down
2 changes: 1 addition & 1 deletion infra/modules/handler/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "aws_lambda_function" "this" {
runtime = "provided.al2023"
timeout = var.timeout
memory_size = var.memory_size
reserved_concurrent_executions = 10
reserved_concurrent_executions = var.reserved_concurrent_executions

environment {
variables = var.environment_variables
Expand Down
5 changes: 5 additions & 0 deletions infra/modules/handler/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ variable "function_name" {
type = string
}

variable "reserved_concurrent_executions" {
description = "Reserved concurrent executions for the Lambda function"
type = number
}

variable "source_path" {
description = "Path to the directory containing main.go (the module will build the binary and create a ZIP)"
type = string
Expand Down
9 changes: 5 additions & 4 deletions infra/observability.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ resource "aws_cloudwatch_metric_alarm" "non_empty_dlq" {
module "telegram_bot_alerting" {
source = "./modules/alerting"

name = "telegram-bot-alerting"
emails = var.alerting_emails
telegram_chat_id = var.alerting_telegram_chat_id
ssm_param_telegram_api_token = module.telegram_bot_api_token.name
name = "telegram-bot-alerting"
reserved_concurrent_executions = 2
emails = var.alerting_emails
telegram_chat_id = var.alerting_telegram_chat_id
ssm_param_telegram_api_token = module.telegram_bot_api_token.name
role_policies = [
// policy 0
[
Expand Down
Loading