Skip to content

Conversation

mishraomp
Copy link
Collaborator

No description provided.

@Copilot Copilot AI review requested due to automatic review settings June 19, 2025 18:51
@mishraomp mishraomp self-assigned this Jun 19, 2025
@mishraomp mishraomp added the chore regular house keeping, and improvements label Jun 19, 2025
@mishraomp mishraomp moved this from New to Active in NRIDS - Architecture Jun 19, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR lowers RDS resource usage and surfaces a new pool-size setting for the application’s database connections.

  • Adjust Aurora Serverless v2 minimum capacity to 0 for cost savings
  • Add POSTGRES_POOL_SIZE environment variable to ECS task definition
  • Wire POSTGRES_POOL_SIZE into Prisma’s connection_limit at runtime

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
infrastructure/database/vars.tf Lower default Aurora min_capacity from 0.5 to 0
infrastructure/api/ecs.tf Inject POSTGRES_POOL_SIZE env var with hardcoded value “1”
backend/src/prisma.service.ts Parse POSTGRES_POOL_SIZE and apply it to Prisma’s pool size
Comments suppressed due to low confidence (3)

backend/src/prisma.service.ts:10

  • [nitpick] Add a comment or update README/docs to explain the new POSTGRES_POOL_SIZE variable and its effect on the Prisma connection pool, ensuring team members know how to override it.
const DB_POOL_SIZE = parseInt(process.env.POSTGRES_POOL_SIZE || "5", 10);

infrastructure/database/vars.tf:41

  • Aurora Serverless v2 requires min_capacity to be at least 0.5 ACU; setting it to 0 will cause Terraform apply failures. Consider reverting to 0.5 or confirming that 0 is a valid value in your target AWS region.
  default     = 0

infrastructure/api/ecs.tf:204

  • [nitpick] Hardcoding the pool size in the task definition makes tuning across environments harder. Consider defining postgres_pool_size as a Terraform variable and referencing it here for configurability.
          name = "POSTGRES_POOL_SIZE"

@mishraomp mishraomp merged commit 30bbe85 into main Jun 19, 2025
21 checks passed
@mishraomp mishraomp deleted the chore/lower-rds-resources branch June 19, 2025 19:04
@github-project-automation github-project-automation bot moved this from Active to Done in NRIDS - Architecture Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore regular house keeping, and improvements
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants