diff --git a/terraform/main.tf b/terraform/main.tf index 7f2b5cb..7ddaa5a 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -84,8 +84,8 @@ resource "aws_ecs_task_definition" "statisticsbot_service" { { name = local.name image = "${data.terraform_remote_state.discord_bots_cluster.outputs.discord_bots_repo.repository_url}:${local.name}-latest-arm64" - cpu = 256 - memory = 400 + cpu = 150 + memory = 100 essential = true portMappings = [ @@ -117,6 +117,32 @@ resource "aws_ecs_task_definition" "statisticsbot_service" { value = "/mongodb/statsuser/username" }, ] + }, + { + name = "sqspoller" + image = "${data.terraform_remote_state.discord_bots_cluster.outputs.discord_bots_repo.repository_url}:sqspoller-latest-arm64" + cpu = 50 + memory = 100 + essential = true + + environment = [ + { + name = "AWS_REGION" + value = data.aws_region.current.name + }, + { + name = "SQS_REQUEST" + value = aws_sqs_queue.markov_user_request.name + }, + { + name = "SQS_RESPONSE" + value = aws_sqs_queue.markov_user_response.name + }, + { + name = "STATSBOT_URL" + value = "localhost" + }, + ] } ]) } diff --git a/terraform/outputs.tf b/terraform/outputs.tf index ae8de59..37ead0e 100644 --- a/terraform/outputs.tf +++ b/terraform/outputs.tf @@ -3,4 +3,5 @@ output "sqs" { request = aws_sqs_queue.markov_user_request, response = aws_sqs_queue.markov_user_response, } + sensitive = true }