Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(iac): decrease deprovisioning time to improve deployment speed (#492)

Will Hutchinsond6378c388897
diff --git a/infra/packages/resources/src/resources/datadog.ts b/infra/packages/resources/src/resources/datadog.ts
index 241691a57a..32e24482ab 100644
--- a/infra/packages/resources/src/resources/datadog.ts
+++ b/infra/packages/resources/src/resources/datadog.ts
@@ -72,6 +72,7 @@ export class DatadogServiceEntity extends ComponentResource {
export const fargateLogRouterSidecarContainer = {
essential: true,
image: 'amazon/aws-for-fluent-bit:latest',
+ stopTimeout: 10, // 10 seconds to force kill the task
name: 'log_router',
firelensConfiguration: {
type: 'fluentbit',
@@ -101,6 +102,7 @@ export const fargateLogRouterSidecarContainer = {
export const datadogAgentContainer = {
name: 'datadog-agent',
image: 'public.ecr.aws/datadog/agent:latest',
+ stopTimeout: 10, // 10 seconds to force kill the task
environment: [
{
name: 'ECS_FARGATE',
diff --git a/infra/packages/resources/src/resources/load_balancer.ts b/infra/packages/resources/src/resources/load_balancer.ts
index 341fe41ea6..184b4018a1 100644
--- a/infra/packages/resources/src/resources/load_balancer.ts
+++ b/infra/packages/resources/src/resources/load_balancer.ts
@@ -33,8 +33,7 @@ export function serviceLoadBalancer(
`${serviceName}-tg-${stack}`,
{
name: `${serviceName}-tg-${stack}`,
- // TODO: might want to make this smaller?
- deregistrationDelay: 120,
+ deregistrationDelay: 30, // let any active calls finish within 30 seconds
port: serviceContainerPort,
protocol: 'HTTP',
targetType: 'ip',
diff --git a/infra/stacks/authentication-service/service.ts b/infra/stacks/authentication-service/service.ts
index bd2855a9e3..c6ac2562c6 100644
--- a/infra/stacks/authentication-service/service.ts
+++ b/infra/stacks/authentication-service/service.ts
@@ -218,6 +218,7 @@ export class AuthenticationService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: 256,
memory: 512,
environment: [
diff --git a/infra/stacks/cloud-storage-service/cloud-storage-service.ts b/infra/stacks/cloud-storage-service/cloud-storage-service.ts
index 9e619f14a9..5781ea4161 100644
--- a/infra/stacks/cloud-storage-service/cloud-storage-service.ts
+++ b/infra/stacks/cloud-storage-service/cloud-storage-service.ts
@@ -278,6 +278,7 @@ export class CloudStorageService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: stack === 'prod' ? 1024 : 512,
memory: stack === 'prod' ? 4096 : 2048,
environment: containerEnvVars,
diff --git a/infra/stacks/comms-service/comms-service.ts b/infra/stacks/comms-service/comms-service.ts
index 83eddecedf..9405492fde 100644
--- a/infra/stacks/comms-service/comms-service.ts
+++ b/infra/stacks/comms-service/comms-service.ts
@@ -207,6 +207,7 @@ export class CommsService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: 4096,
memory: 8192,
environment: containerEnvVars,
diff --git a/infra/stacks/connection-gateway/connection_gateway.ts b/infra/stacks/connection-gateway/connection_gateway.ts
index 708485ffac..fabb85ec63 100644
--- a/infra/stacks/connection-gateway/connection_gateway.ts
+++ b/infra/stacks/connection-gateway/connection_gateway.ts
@@ -188,6 +188,7 @@ export class ConnectionGateway extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: 4096,
memory: 8192,
environment: containerEnvVars,
diff --git a/infra/stacks/contacts-service/service.ts b/infra/stacks/contacts-service/service.ts
index 836e7aa0ee..0af62b940f 100644
--- a/infra/stacks/contacts-service/service.ts
+++ b/infra/stacks/contacts-service/service.ts
@@ -195,6 +195,7 @@ export class ContactsService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: stack === 'prod' ? 512 : 256,
memory: stack === 'prod' ? 1024 : 512,
environment: [
diff --git a/infra/stacks/convert-service/service.ts b/infra/stacks/convert-service/service.ts
index d812654b8b..5231738a56 100644
--- a/infra/stacks/convert-service/service.ts
+++ b/infra/stacks/convert-service/service.ts
@@ -216,6 +216,7 @@ export class ConvertService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: 4096,
memory: 8192,
environment: [
diff --git a/infra/stacks/delete-document-worker/worker.ts b/infra/stacks/delete-document-worker/worker.ts
index a90dd13061..4e2ba925ad 100644
--- a/infra/stacks/delete-document-worker/worker.ts
+++ b/infra/stacks/delete-document-worker/worker.ts
@@ -225,6 +225,7 @@ export class Worker extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: 256,
memory: 512,
environment: containerEnvVars,
diff --git a/infra/stacks/document-cognition-service/document-cognition-service.ts b/infra/stacks/document-cognition-service/document-cognition-service.ts
index d5b03fe611..820344b2b5 100644
--- a/infra/stacks/document-cognition-service/document-cognition-service.ts
+++ b/infra/stacks/document-cognition-service/document-cognition-service.ts
@@ -200,6 +200,7 @@ export class DocumentCognitionService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: 4096,
memory: 8192,
environment: containerEnvVars,
diff --git a/infra/stacks/email-service/service.ts b/infra/stacks/email-service/service.ts
index 0aeeede98c..1360028c3f 100644
--- a/infra/stacks/email-service/service.ts
+++ b/infra/stacks/email-service/service.ts
@@ -247,6 +247,7 @@ export class EmailService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: stack === 'prod' ? 2048 : 1024,
memory: stack === 'prod' ? 3742 : 1742, // 2048 minimum - 256 for datadog - 50 for log_router
environment: [...containerEnvVars],
diff --git a/infra/stacks/experiment-service/service.ts b/infra/stacks/experiment-service/service.ts
index 0282d4dad2..5de8ffaa3f 100644
--- a/infra/stacks/experiment-service/service.ts
+++ b/infra/stacks/experiment-service/service.ts
@@ -173,6 +173,7 @@ export class ExperimentService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: 256,
memory: 512,
environment: [
diff --git a/infra/stacks/insight-service/service.ts b/infra/stacks/insight-service/service.ts
index 8e532276a4..0b59c8aef2 100644
--- a/infra/stacks/insight-service/service.ts
+++ b/infra/stacks/insight-service/service.ts
@@ -251,6 +251,7 @@ export class InsightService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: 256,
memory: 512,
environment: envVars,
diff --git a/infra/stacks/metering-service/service.ts b/infra/stacks/metering-service/service.ts
index f3175d2596..fe27fe062f 100644
--- a/infra/stacks/metering-service/service.ts
+++ b/infra/stacks/metering-service/service.ts
@@ -158,6 +158,7 @@ export class Service extends pulumi.ComponentResource {
service: {
name: SERVICE_DIR_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: stack === 'prod' ? 512 : 256,
memory: stack === 'prod' ? 1024 : 512,
environment: [
diff --git a/infra/stacks/notification-email-poller/notification-email-poller.ts b/infra/stacks/notification-email-poller/notification-email-poller.ts
index 61d0a7940d..d52eb66051 100644
--- a/infra/stacks/notification-email-poller/notification-email-poller.ts
+++ b/infra/stacks/notification-email-poller/notification-email-poller.ts
@@ -111,6 +111,7 @@ export class Worker extends pulumi.ComponentResource {
container: {
name: WORKER_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: 256, // Specify CPU units
memory: 512, // Specify memory in MB
environment: [...containerEnvVars],
diff --git a/infra/stacks/notification-service/service.ts b/infra/stacks/notification-service/service.ts
index 5cb3af8900..876a44f8ac 100644
--- a/infra/stacks/notification-service/service.ts
+++ b/infra/stacks/notification-service/service.ts
@@ -254,6 +254,7 @@ export class NotificationService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: stack === 'prod' ? 1024 : 256,
memory: stack === 'prod' ? 2048 : 512,
environment: [
diff --git a/infra/stacks/organization-service/organization-service.ts b/infra/stacks/organization-service/organization-service.ts
index ed35bf63b5..13c86c5d8a 100644
--- a/infra/stacks/organization-service/organization-service.ts
+++ b/infra/stacks/organization-service/organization-service.ts
@@ -204,6 +204,7 @@ export class OrganizationService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: stack === 'prod' ? 1024 : 256,
memory: stack === 'prod' ? 2048 : 512,
environment: containerEnvVars,
diff --git a/infra/stacks/properties-service/properties-service.ts b/infra/stacks/properties-service/properties-service.ts
index ecc5c87c4a..893b488c56 100644
--- a/infra/stacks/properties-service/properties-service.ts
+++ b/infra/stacks/properties-service/properties-service.ts
@@ -175,6 +175,7 @@ export class PropertiesService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: 1024,
memory: 2048,
environment: containerEnvVars,
diff --git a/infra/stacks/search-processing-service/service.ts b/infra/stacks/search-processing-service/service.ts
index 6fce0c9765..3b28061e62 100644
--- a/infra/stacks/search-processing-service/service.ts
+++ b/infra/stacks/search-processing-service/service.ts
@@ -215,6 +215,7 @@ export class SearchProcessingService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: stack === 'prod' ? 1024 : 512,
memory: stack === 'prod' ? 4096 : 1024,
environment: containerEnvVars ?? [],
diff --git a/infra/stacks/search-service/service.ts b/infra/stacks/search-service/service.ts
index 8c2088123d..e5bd74f98f 100644
--- a/infra/stacks/search-service/service.ts
+++ b/infra/stacks/search-service/service.ts
@@ -171,6 +171,7 @@ export class SearchService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: stack === 'prod' ? 512 : 256,
memory: stack === 'prod' ? 1024 : 512,
environment: containerEnvVars ?? [],
diff --git a/infra/stacks/static-file-service/static-file-service.ts b/infra/stacks/static-file-service/static-file-service.ts
index 79ec95e28a..fc3d7d75a0 100644
--- a/infra/stacks/static-file-service/static-file-service.ts
+++ b/infra/stacks/static-file-service/static-file-service.ts
@@ -429,6 +429,7 @@ export class StaticFileService extends pulumi.ComponentResource {
service: {
name: SERVICE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: 256,
memory: 512,
environment: [
diff --git a/infra/stacks/unfurl-service/unfurl-service.ts b/infra/stacks/unfurl-service/unfurl-service.ts
index 36c16fed64..414fe123af 100644
--- a/infra/stacks/unfurl-service/unfurl-service.ts
+++ b/infra/stacks/unfurl-service/unfurl-service.ts
@@ -151,6 +151,7 @@ export class UnfurlService extends pulumi.ComponentResource {
service: {
name: BASE_NAME,
image: image.image.imageUri,
+ stopTimeout: 10, // 10 seconds to force kill the task
cpu: 256,
memory: 512,
environment: containerEnvVars,