From e77ca09ba5052dc7d1bc939a6d8287a48516cc39 Mon Sep 17 00:00:00 2001 From: nutrina Date: Wed, 27 Sep 2023 19:47:02 +0300 Subject: [PATCH] feat(infra): downsizing review db & redis instances, enabling container insights to prod (#408) --- infra/prod/index.ts | 5 ++++- infra/review/index.ts | 2 +- infra/staging/index.ts | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/infra/prod/index.ts b/infra/prod/index.ts index 943708486..180034d96 100644 --- a/infra/prod/index.ts +++ b/infra/prod/index.ts @@ -221,7 +221,10 @@ export const redisCacheOpsConnectionUrl = pulumi.interpolate`redis://${redisPrim // Set up ALB and ECS cluster ////////////////////////////////////////////////////////////// -const cluster = new aws.ecs.Cluster("scorer"); +const cluster = new aws.ecs.Cluster("scorer", { + settings: [{ name: "containerInsights", value: "enabled" }], +}); + // export const clusterInstance = cluster; export const clusterId = cluster.id; diff --git a/infra/review/index.ts b/infra/review/index.ts index 47497b00d..02fbf323f 100644 --- a/infra/review/index.ts +++ b/infra/review/index.ts @@ -175,7 +175,7 @@ const secgrp_redis = new aws.ec2.SecurityGroup("scorer-redis-secgrp", { const redis = new aws.elasticache.Cluster("scorer-redis", { engine: "redis", engineVersion: "4.0.10", - nodeType: "cache.m5.large", + nodeType: "cache.t3.micro", numCacheNodes: 1, port: 6379, subnetGroupName: redisSubnetGroup.name, diff --git a/infra/staging/index.ts b/infra/staging/index.ts index abd81fc9d..199a7bf1b 100644 --- a/infra/staging/index.ts +++ b/infra/staging/index.ts @@ -130,7 +130,8 @@ const postgresql = new aws.rds.Instance( maxAllocatedStorage: 100, engine: "postgres", // engineVersion: "5.7", - instanceClass: "db.t3.2xlarge", + // instanceClass: "db.t3.2xlarge", + instanceClass: "db.t3.small", dbName: dbName, password: dbPassword, username: dbUsername, @@ -185,7 +186,8 @@ const secgrp_redis = new aws.ec2.SecurityGroup("scorer-redis-secgrp", { const redis = new aws.elasticache.Cluster("scorer-redis", { engine: "redis", engineVersion: "4.0.10", - nodeType: "cache.m5.large", + // nodeType: "cache.m5.large", + nodeType: "cache.t3.small", numCacheNodes: 1, port: 6379, subnetGroupName: redisSubnetGroup.name,