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.

chore: remove properties infra (#1253)

Will Hutchinson3c9b71ccf8fd
diff --git a/infra/bun.lock b/infra/bun.lock
index 015a5902db..b1ceb4234c 100644
--- a/infra/bun.lock
+++ b/infra/bun.lock
@@ -142,10 +142,6 @@
"name": "organization-retention-stack",
"version": "0.0.0",
},
- "stacks/properties-service": {
- "name": "properties-service-stack",
- "version": "0.0.0",
- },
"stacks/search-event-queue": {
"name": "search-event-queue-stack",
"version": "0.0.0",
@@ -862,8 +858,6 @@
"promise-retry": ["[email protected]", "", { "dependencies": { "err-code": "^2.0.2", "retry": "^0.12.0" } }, "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g=="],
- "properties-service-stack": ["properties-service-stack@workspace:stacks/properties-service"],
-
"protobufjs": ["[email protected]", "", { "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", "@protobufjs/codegen": "^2.0.4", "@protobufjs/eventemitter": "^1.1.0", "@protobufjs/fetch": "^1.1.0", "@protobufjs/float": "^1.0.2", "@protobufjs/inquire": "^1.1.0", "@protobufjs/path": "^1.1.2", "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.0", "@types/node": ">=13.7.0", "long": "^5.0.0" } }, "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw=="],
"pulumi-fusionauth": ["[email protected]", "", { "dependencies": { "@pulumi/pulumi": "^3.0.0" } }, "sha512-9By39HUEnap5kCasy7a1ELXEDDeWvBqBY4h7rS/knWUWemoMuaVYaF4YH/qGOR85Gw6AdLRzP6WFqfU7m6j/kw=="],
diff --git a/infra/stacks/properties-service/Pulumi.dev.yaml b/infra/stacks/properties-service/Pulumi.dev.yaml
deleted file mode 100644
index 848a36396b..0000000000
--- a/infra/stacks/properties-service/Pulumi.dev.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-config:
- aws-native:region: us-east-1
- aws:region: us-east-1
- properties-service:macro_db_secret_key: macro-db-dev
- properties-service:fusionauth_client_id: fusionauth-client-id-key-dev
- properties-service:fusionauth_issuer: fusionauth-dev.macro.com
- properties-service:internal_auth_key: document-storage-service-auth-key-dev
- properties-service:jwt_secret_key: fusionauth-jwt-secret-dev
diff --git a/infra/stacks/properties-service/Pulumi.prod.yaml b/infra/stacks/properties-service/Pulumi.prod.yaml
deleted file mode 100644
index 69b10e5e96..0000000000
--- a/infra/stacks/properties-service/Pulumi.prod.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-config:
- aws-native:region: us-east-1
- aws:region: us-east-1
- properties-service:macro_db_secret_key: macro-db-prod
- properties-service:fusionauth_client_id: fusionauth-client-id-key-prod
- properties-service:fusionauth_issuer: auth.macro.com
- properties-service:internal_auth_key: document-storage-service-auth-key-prod
- properties-service:jwt_secret_key: fusionauth-jwt-secret-prod
diff --git a/infra/stacks/properties-service/Pulumi.yaml b/infra/stacks/properties-service/Pulumi.yaml
deleted file mode 100644
index d5c5bca69f..0000000000
--- a/infra/stacks/properties-service/Pulumi.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-name: properties-service
-runtime: nodejs
-description: Properties Service
diff --git a/infra/stacks/properties-service/index.ts b/infra/stacks/properties-service/index.ts
deleted file mode 100644
index ca8ea0fd9f..0000000000
--- a/infra/stacks/properties-service/index.ts
+++ /dev/null
@@ -1,156 +0,0 @@
-import * as aws from '@pulumi/aws';
-import * as pulumi from '@pulumi/pulumi';
-import {
- config,
- getMacroApiToken,
- getMacroNotify,
- stack,
-} from '../../packages/shared';
-import { get_coparse_api_vpc } from '../../packages/vpc';
-import { PropertiesService } from './properties-service';
-
-const tags = {
- environment: stack,
- tech_lead: 'daniel',
- project: 'properties-service',
-};
-
-export const coparse_api_vpc = get_coparse_api_vpc();
-
-// Properties tables have been migrated to macrodb
-const DATABASE_URL = aws.secretsmanager
- .getSecretVersionOutput({
- secretId: config.require(`macro_db_secret_key`),
- })
- .apply((secret) => secret.secretString);
-
-const macroDatabaseSecretArn: pulumi.Output<string> = aws.secretsmanager
- .getSecretVersionOutput({
- secretId: config.require(`macro_db_secret_key`),
- })
- .apply((secret) => secret.arn);
-
-const JWT_SECRET_KEY = config.require(`jwt_secret_key`);
-const jwtSecretKeyArn: pulumi.Output<string> = aws.secretsmanager
- .getSecretVersionOutput({ secretId: JWT_SECRET_KEY })
- .apply((secret) => secret.arn);
-
-const fusionauthClientIdSecretKey = config.require(`fusionauth_client_id`);
-
-const FUSIONAUTH_CLIENT_ID = aws.secretsmanager
- .getSecretVersionOutput({
- secretId: fusionauthClientIdSecretKey,
- })
- .apply((secret) => secret.secretString);
-const FUSIONAUTH_ISSUER = config.require(`fusionauth_issuer`);
-
-const INTERNAL_AUTH_KEY = aws.secretsmanager
- .getSecretVersionOutput({
- secretId: config.get(`internal_auth_key`) ?? '',
- })
- .apply((secret) => secret.secretString);
-
-const internalAuthKeyArn: pulumi.Output<string> = aws.secretsmanager
- .getSecretVersionOutput({
- secretId: config.get(`internal_auth_key`) ?? '',
- })
- .apply((secret) => secret.arn);
-
-const MACRO_API_TOKENS = getMacroApiToken();
-
-const { notificationQueueName, notificationQueueArn } = getMacroNotify();
-
-const DOCUMENT_STORAGE_SERVICE_URL = `https://cloud-storage${stack === 'prod' ? '' : `-${stack}`}.macro.com`;
-
-const COMMS_SERVICE_URL = `https://comms-service${stack === 'prod' ? '' : `-${stack}`}.macro.com`;
-
-const cloudStorageStack = new pulumi.StackReference('cloud-storage-stack', {
- name: `macro-inc/document-storage/${stack}`,
-});
-
-const cloudStorageClusterArn: pulumi.Output<string> = cloudStorageStack
- .getOutput('cloudStorageClusterArn')
- .apply((arn) => arn as string);
-
-const cloudStorageClusterName: pulumi.Output<string> = cloudStorageStack
- .getOutput('cloudStorageClusterName')
- .apply((arn) => arn as string);
-
-const secretKeyArns = [
- pulumi.interpolate`${macroDatabaseSecretArn}`,
- pulumi.interpolate`${jwtSecretKeyArn}`,
- pulumi.interpolate`${internalAuthKeyArn}`,
- MACRO_API_TOKENS.macroApiTokenPublicKeyArn,
-];
-
-const propertiesService = new PropertiesService(`properties-service-${stack}`, {
- ecsClusterArn: cloudStorageClusterArn,
- cloudStorageClusterName: cloudStorageClusterName,
- vpc: coparse_api_vpc,
- platform: {
- family: 'linux',
- architecture: 'amd64',
- },
- serviceContainerPort: 8080,
- healthCheckPath: '/health',
- notificationQueueArn,
- containerEnvVars: [
- {
- name: 'DATABASE_URL',
- value: pulumi.interpolate`${DATABASE_URL}`,
- },
- {
- name: 'ENVIRONMENT',
- value: stack,
- },
- {
- name: 'RUST_LOG',
- value: `properties_service=${
- stack === 'prod' ? 'info' : 'trace'
- },tower_http=debug,document_storage_service_client=trace`,
- },
-
- {
- name: 'INTERNAL_API_SECRET_KEY',
- value: pulumi.interpolate`${INTERNAL_AUTH_KEY}`,
- },
- {
- name: 'COMMS_SERVICE_URL',
- value: COMMS_SERVICE_URL,
- },
- { name: 'ISSUER', value: pulumi.interpolate`${FUSIONAUTH_ISSUER}` },
- {
- name: 'JWT_SECRET_KEY',
- value: pulumi.interpolate`${JWT_SECRET_KEY}`,
- },
- {
- name: 'AUDIENCE',
- value: pulumi.interpolate`${FUSIONAUTH_CLIENT_ID}`,
- },
- {
- name: 'MACRO_API_TOKEN_ISSUER',
- value: pulumi.interpolate`${MACRO_API_TOKENS.macroApiTokenIssuer}`,
- },
- {
- name: 'MACRO_API_TOKEN_PUBLIC_KEY',
- value: pulumi.interpolate`${MACRO_API_TOKENS.macroApiTokenPublicKey}`,
- },
- {
- name: 'DOCUMENT_STORAGE_SERVICE_URL',
- value: DOCUMENT_STORAGE_SERVICE_URL,
- },
- {
- name: 'DOCUMENT_STORAGE_SERVICE_AUTH_KEY',
- value: pulumi.interpolate`${INTERNAL_AUTH_KEY}`,
- },
- {
- name: 'NOTIFICATION_QUEUE',
- value: pulumi.interpolate`${notificationQueueName}`,
- },
- ],
- isPrivate: false,
- tags,
- secretKeyArns,
-});
-
-export const propertiesServiceUrl = pulumi.interpolate`${propertiesService.domain}`;
diff --git a/infra/stacks/properties-service/package.json b/infra/stacks/properties-service/package.json
deleted file mode 100644
index b5b01200bf..0000000000
--- a/infra/stacks/properties-service/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "properties-service-stack",
- "version": "0.0.0",
- "private": true,
- "license": "MIT"
-}
diff --git a/infra/stacks/properties-service/properties-service.ts b/infra/stacks/properties-service/properties-service.ts
deleted file mode 100644
index 0b597c6627..0000000000
--- a/infra/stacks/properties-service/properties-service.ts
+++ /dev/null
@@ -1,534 +0,0 @@
-import * as aws from '@pulumi/aws';
-import * as awsx from '@pulumi/awsx';
-import * as pulumi from '@pulumi/pulumi';
-import {
- DATADOG_API_KEY,
- datadogAgentContainer,
- fargateLogRouterSidecarContainer,
- serviceLoadBalancer,
-} from '../../packages/resources';
-import { EcrImage } from '../../packages/service';
-import {
- BASE_DOMAIN,
- CLOUD_TRAIL_SNS_TOPIC_ARN,
- stack,
-} from '../../packages/shared';
-
-const BASE_NAME = 'properties-service';
-const BASE_PATH = '../../../rust/cloud-storage';
-
-export const SERVICE_DOMAIN_NAME = `properties-service${
- stack === 'prod' ? '' : `-${stack}`
-}.${BASE_DOMAIN}`;
-
-type CreatePropertiesServiceArgs = {
- cloudStorageClusterName: pulumi.Output<string> | string;
- ecsClusterArn: pulumi.Output<string> | string;
- vpc: {
- vpcId: pulumi.Output<string> | string;
- publicSubnetIds: pulumi.Output<string[]> | string[];
- privateSubnetIds: pulumi.Output<string[]> | string[];
- };
- platform: { family: string; architecture: 'amd64' | 'arm64' };
- serviceContainerPort: number;
- isPrivate?: boolean;
- containerEnvVars?: { name: string; value: pulumi.Output<string> | string }[];
- healthCheckPath: string;
- tags: { [key: string]: string };
- secretKeyArns: (pulumi.Output<string> | string)[];
- notificationQueueArn: pulumi.Output<string> | string;
-};
-
-export class PropertiesService extends pulumi.ComponentResource {
- public ecr: awsx.ecr.Repository;
- public serviceAlbSg: aws.ec2.SecurityGroup;
- public serviceSg: aws.ec2.SecurityGroup;
- public targetGroup: aws.lb.TargetGroup;
- public lb: aws.lb.LoadBalancer;
- public listener: aws.lb.Listener;
- public service: awsx.ecs.FargateService;
- public domain: string;
- public cloudStorageClusterName: pulumi.Output<string> | string;
- public tags: { [key: string]: string };
- public role: aws.iam.Role;
-
- constructor(
- name: string,
- {
- ecsClusterArn,
- vpc,
- platform,
- serviceContainerPort,
- healthCheckPath,
- isPrivate,
- containerEnvVars,
- cloudStorageClusterName,
- tags,
- secretKeyArns,
- notificationQueueArn,
- }: CreatePropertiesServiceArgs,
- opts?: pulumi.ComponentResourceOptions
- ) {
- super('my:components:PropertiesService', name, {}, opts);
- this.tags = tags;
-
- this.cloudStorageClusterName = cloudStorageClusterName;
-
- // ecr image
- const image = new EcrImage(
- `${BASE_NAME}-ecr-image-${stack}`,
- {
- repositoryId: `${BASE_NAME}-ecr-${stack}`,
- repositoryName: `${BASE_NAME}-${stack}`,
- imageId: `${BASE_NAME}-image-${stack}`,
- imagePath: BASE_PATH,
- dockerfile: 'Dockerfile',
- platform,
- buildArgs: {
- SERVICE_NAME: 'properties_service',
- },
- tags: this.tags,
- },
- { parent: this }
- );
- this.ecr = image.ecr;
-
- // sg
- const sg = this.initializeSecurityGroups({
- vpcId: vpc.vpcId,
- serviceContainerPort,
- });
- this.serviceAlbSg = sg.serviceAlbSg;
- this.serviceSg = sg.serviceSg;
-
- // lb
- const { targetGroup, lb, listener } = serviceLoadBalancer(this, {
- serviceName: BASE_NAME, // service name
- serviceContainerPort,
- healthCheckPath,
- vpc,
- albSecurityGroupId: this.serviceAlbSg.id,
- isPrivate,
- tags,
- idleTimeout: 3600,
- });
- this.targetGroup = targetGroup;
- this.lb = lb;
- this.listener = listener;
-
- const secretsManagerPolicy = new aws.iam.Policy(
- `${BASE_NAME}-secrets-manager-policy`,
- {
- name: `${BASE_NAME}-secrets-manager-policy-${stack}`,
- policy: {
- Version: '2012-10-17',
- Statement: [
- {
- Action: [
- 'secretsmanager:GetSecretValue',
- 'secretsmanager:DescribeSecret',
- ],
- Resource: [...secretKeyArns],
- Effect: 'Allow',
- },
- ],
- },
- tags: this.tags,
- },
- { parent: this }
- );
-
- const queuePolicy = new aws.iam.Policy(
- `${BASE_NAME}-queue-policy`,
- {
- name: `${BASE_NAME}-queue-policy-${stack}`,
- policy: {
- Version: '2012-10-17',
- Statement: [
- {
- Action: ['sqs:SendMessage'],
- Resource: [pulumi.interpolate`${notificationQueueArn}`],
- Effect: 'Allow',
- },
- ],
- },
- tags: this.tags,
- },
- { parent: this }
- );
-
- this.role = new aws.iam.Role(
- `${BASE_NAME}-role`,
- {
- name: `${BASE_NAME}-role-${stack}`,
- assumeRolePolicy: {
- Version: '2012-10-17',
- Statement: [
- {
- Action: 'sts:AssumeRole',
- Principal: {
- Service: 'ecs-tasks.amazonaws.com',
- },
- Effect: 'Allow',
- Sid: '',
- },
- ],
- },
- managedPolicyArns: [secretsManagerPolicy.arn, queuePolicy.arn],
- tags: this.tags,
- },
- { parent: this }
- );
-
- // service
- const service = new awsx.ecs.FargateService(
- `${BASE_NAME}`,
- {
- tags,
- cluster: ecsClusterArn,
- networkConfiguration: {
- subnets: vpc.privateSubnetIds,
- securityGroups: [this.serviceSg.id],
- },
- taskDefinitionArgs: {
- taskRole: {
- roleArn: this.role.arn,
- },
- containers: {
- log_router: fargateLogRouterSidecarContainer,
- datadog_agent: datadogAgentContainer,
- service: {
- name: BASE_NAME,
- image: image.image.imageUri,
- stopTimeout: 10, // 10 seconds to force kill the task
- cpu: 1024,
- memory: 2048,
- environment: containerEnvVars,
- logConfiguration: {
- logDriver: 'awsfirelens',
- options: {
- Name: 'datadog',
- Host: 'http-intake.logs.us5.datadoghq.com',
- apikey: DATADOG_API_KEY,
- dd_service: `properties-service`,
- dd_source: 'fargate',
- dd_tags: `project:properties-service, env:${stack}`,
- provider: 'ecs',
- },
- },
- portMappings: [
- {
- appProtocol: 'http',
- name: `${BASE_NAME}-tcp-${stack}`,
- hostPort: serviceContainerPort,
- containerPort: serviceContainerPort,
- targetGroup,
- },
- ],
- },
- },
- runtimePlatform: {
- operatingSystemFamily: `${platform.family.toUpperCase()}`,
- cpuArchitecture: `${
- platform.architecture === 'amd64'
- ? 'X86_64'
- : platform.architecture.toUpperCase()
- }`,
- },
- },
- desiredCount: 1,
- },
- { parent: this }
- );
-
- this.service = service;
-
- this.setupAutoScaling();
-
- this.setupServiceAlarms();
-
- // domain record
- const zone = aws.route53.getZoneOutput({ name: BASE_DOMAIN });
-
- new aws.route53.Record(
- `${BASE_NAME}-domain-record`,
- {
- name: `${SERVICE_DOMAIN_NAME}`,
- type: 'A',
- zoneId: zone.zoneId,
- aliases: [
- {
- evaluateTargetHealth: false,
- name: this.lb.dnsName,
- zoneId: this.lb.zoneId,
- },
- ],
- },
- { parent: this }
- );
-
- this.domain = `https://${SERVICE_DOMAIN_NAME}`;
- }
-
- initializeSecurityGroups({
- vpcId,
- serviceContainerPort,
- }: {
- vpcId: pulumi.Output<string> | string;
- serviceContainerPort: number;
- }) {
- const serviceAlbSg = new aws.ec2.SecurityGroup(
- `${BASE_NAME}-alb-sg-${stack}`,
- {
- name: `${BASE_NAME}-alb-sg-${stack}`,
- description: `${BASE_NAME} application load balancer security group`,
- vpcId,
- tags: this.tags,
- },
- { parent: this }
- );
-
- const serviceSg = new aws.ec2.SecurityGroup(
- `${BASE_NAME}-sg-${stack}`,
- {
- name: `${BASE_NAME}-sg-${stack}`,
- vpcId,
- description: `${BASE_NAME} security group that is attached directly to the service`,
- tags: this.tags,
- },
- { parent: this }
- );
-
- new aws.vpc.SecurityGroupIngressRule(
- `${BASE_NAME}-alb-in`,
- {
- securityGroupId: serviceSg.id,
- description: 'Allow inbound traffic from the services ALB',
- referencedSecurityGroupId: serviceAlbSg.id,
- fromPort: serviceContainerPort,
- toPort: serviceContainerPort,
- ipProtocol: 'tcp',
- tags: this.tags,
- },
- { parent: this }
- );
-
- new aws.vpc.SecurityGroupEgressRule(
- `${BASE_NAME}-all-out`,
- {
- securityGroupId: serviceSg.id,
- description: 'Allow all outbound',
- cidrIpv4: '0.0.0.0/0',
- ipProtocol: '-1',
- tags: this.tags,
- },
- { parent: this }
- );
-
- // ALB SG rules
- new aws.vpc.SecurityGroupIngressRule(
- `${BASE_NAME}-http`,
- {
- securityGroupId: serviceAlbSg.id,
- description: 'Allow inbound HTTP traffic',
- cidrIpv4: '0.0.0.0/0',
- fromPort: 80,
- ipProtocol: 'tcp',
- toPort: 80,
- tags: this.tags,
- },
- { parent: this }
- );
-
- new aws.vpc.SecurityGroupIngressRule(
- `${BASE_NAME}-https`,
- {
- securityGroupId: serviceAlbSg.id,
- description: 'Allow inbound HTTPS traffic',
- cidrIpv4: '0.0.0.0/0',
- fromPort: 443,
- ipProtocol: 'tcp',
- toPort: 443,
- tags: this.tags,
- },
- { parent: this }
- );
-
- new aws.vpc.SecurityGroupEgressRule(
- `${BASE_NAME}-out-service`,
- {
- description: 'Allow traffic to the service security group',
- securityGroupId: serviceAlbSg.id,
- referencedSecurityGroupId: serviceSg.id,
- fromPort: serviceContainerPort,
- ipProtocol: 'tcp',
- toPort: serviceContainerPort,
- tags: this.tags,
- },
- { parent: this }
- );
-
- return { serviceAlbSg, serviceSg };
- }
-
- setupAutoScaling() {
- if (!this.service) return;
-
- const serviceScalableTarget = new aws.appautoscaling.Target(
- `${BASE_NAME}-service-scalable-target-${stack}`,
- {
- maxCapacity: stack === 'prod' ? 15 : 3,
- minCapacity: 1,
- resourceId: pulumi.interpolate`service/${this.cloudStorageClusterName}/${this.service.service.name}`,
- scalableDimension: 'ecs:service:DesiredCount',
- serviceNamespace: 'ecs',
- tags: this.tags,
- },
- { parent: this }
- );
-
- const lbPortion: pulumi.Output<string> = this.lb.arn.apply((arn) => {
- const parts = arn.split(':loadbalancer/');
- return parts[1];
- });
-
- const tgPortion: pulumi.Output<string> = this.targetGroup.arn.apply(
- (arn) => {
- const parts = arn.split(':');
- return parts[parts.length - 1];
- }
- );
-
- const resourceLabel = pulumi.interpolate`${lbPortion}/${tgPortion}`;
-
- // Create an Auto Scaling policy for request count.
- new aws.appautoscaling.Policy(
- `${BASE_NAME}-scaling-policy-request-count-${stack}`,
- {
- policyType: 'TargetTrackingScaling',
- resourceId: serviceScalableTarget.resourceId,
- scalableDimension: serviceScalableTarget.scalableDimension,
- serviceNamespace: serviceScalableTarget.serviceNamespace,
- targetTrackingScalingPolicyConfiguration: {
- targetValue: 1000, // TODO: play with this
- predefinedMetricSpecification: {
- predefinedMetricType: 'ALBRequestCountPerTarget',
- resourceLabel,
- },
- scaleInCooldown: 60,
- scaleOutCooldown: 120,
- },
- },
- { parent: this }
- );
-
- // Create an Auto Scaling policy for CPU utilization.
- new aws.appautoscaling.Policy(
- `${BASE_NAME}-scaling-policy-cpu-${stack}`,
- {
- policyType: 'TargetTrackingScaling',
- resourceId: serviceScalableTarget.resourceId,
- scalableDimension: serviceScalableTarget.scalableDimension,
- serviceNamespace: serviceScalableTarget.serviceNamespace,
- targetTrackingScalingPolicyConfiguration: {
- targetValue: 70.0,
- predefinedMetricSpecification: {
- predefinedMetricType: 'ECSServiceAverageCPUUtilization',
- },
- scaleInCooldown: 100,
- scaleOutCooldown: 300,
- },
- },
- { parent: this }
- );
-
- new aws.appautoscaling.Policy(
- `${BASE_NAME}-scaling-policy-memory-${stack}`,
- {
- policyType: 'TargetTrackingScaling',
- resourceId: serviceScalableTarget.resourceId,
- scalableDimension: serviceScalableTarget.scalableDimension,
- serviceNamespace: serviceScalableTarget.serviceNamespace,
- targetTrackingScalingPolicyConfiguration: {
- targetValue: 70.0,
- predefinedMetricSpecification: {
- predefinedMetricType: 'ECSServiceAverageMemoryUtilization',
- },
- scaleInCooldown: 100,
- scaleOutCooldown: 300,
- },
- },
- { parent: this }
- );
- }
-
- setupServiceAlarms() {
- new aws.cloudwatch.MetricAlarm(
- `${BASE_NAME}-high-cpu-alarm`,
- {
- name: `${BASE_NAME}-high-cpu-alarm-${stack}`,
- metricName: 'CPUUtilization',
- namespace: 'AWS/ECS',
- statistic: 'Average',
- period: 180,
- evaluationPeriods: 1,
- threshold: 80,
- comparisonOperator: 'GreaterThanThreshold',
- dimensions: {
- ClusterName: this.cloudStorageClusterName,
- ServiceName: this.service.service.name,
- },
- alarmDescription: `High CPU usage alarm for ${BASE_NAME} service.`,
- actionsEnabled: true,
- alarmActions: [CLOUD_TRAIL_SNS_TOPIC_ARN],
- tags: this.tags,
- },
- { parent: this }
- );
-
- new aws.cloudwatch.MetricAlarm(
- `${BASE_NAME}-high-mem-alarm`,
- {
- name: `${BASE_NAME}-high-mem-alarm-${stack}`,
- metricName: 'MemoryUtilization',
- namespace: 'AWS/ECS',
- statistic: 'Average',
- period: 180,
- evaluationPeriods: 1,
- threshold: 80,
- comparisonOperator: 'GreaterThanThreshold',
- dimensions: {
- ClusterName: this.cloudStorageClusterName,
- ServiceName: this.service.service.name,
- },
- alarmDescription: `High Memory usage alarm for ${BASE_NAME} service.`,
- actionsEnabled: true,
- alarmActions: [CLOUD_TRAIL_SNS_TOPIC_ARN],
- tags: this.tags,
- },
- { parent: this }
- );
-
- new aws.cloudwatch.MetricAlarm(
- `${BASE_NAME}-http-5xx-alarm`,
- {
- name: `${BASE_NAME}-http-5xx-${stack}`,
- metricName: 'HTTPCode_ELB_5XX_Count',
- namespace: 'AWS/ApplicationELB',
- statistic: 'Sum',
- period: 180,
- evaluationPeriods: 1,
- threshold: 25,
- comparisonOperator: 'GreaterThanOrEqualToThreshold',
- dimensions: {
- LoadBalancer: this.lb.arn,
- },
- alarmDescription: `High HTTP 5XX count alarm for ${BASE_NAME} Load Balancer.`,
- actionsEnabled: true,
- alarmActions: [CLOUD_TRAIL_SNS_TOPIC_ARN],
- tags: this.tags,
- },
- { parent: this }
- );
- }
-}
diff --git a/infra/stacks/properties-service/tsconfig.json b/infra/stacks/properties-service/tsconfig.json
deleted file mode 100644
index 4082f16a5d..0000000000
--- a/infra/stacks/properties-service/tsconfig.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "extends": "../../tsconfig.json"
-}