From 276a66870bb0d4c69d27bf0a0bb524b3fbebfbbf Mon Sep 17 00:00:00 2001 From: Cassandra <145622947+cass-moz@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:24:47 -0700 Subject: [PATCH] fix(tf): Clean up pagerduty. --- .aws/src/main.ts | 2 -- .aws/src/pocketAlbApplication.ts | 36 ++------------------------------ 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/.aws/src/main.ts b/.aws/src/main.ts index cff30043..aa2aea2a 100644 --- a/.aws/src/main.ts +++ b/.aws/src/main.ts @@ -2,7 +2,6 @@ import { Construct } from 'constructs'; import { App, S3Backend, TerraformStack } from 'cdktf'; import { AwsProvider } from '@cdktf/provider-aws'; import { config } from './config'; -import { PagerdutyProvider } from '@cdktf/provider-pagerduty'; import { createApplicationCodePipeline, createPocketAlbApplication, @@ -19,7 +18,6 @@ class CurationAdminTools extends TerraformStack { defaultTags: { tags: config.tags }, }); - new PagerdutyProvider(this, 'pagerduty_provider', { token: undefined }); new LocalProvider(this, 'local_provider'); new NullProvider(this, 'null_provider'); diff --git a/.aws/src/pocketAlbApplication.ts b/.aws/src/pocketAlbApplication.ts index 82486e72..99e7702d 100644 --- a/.aws/src/pocketAlbApplication.ts +++ b/.aws/src/pocketAlbApplication.ts @@ -1,11 +1,9 @@ import { PocketALBApplication, PocketECSCodePipeline, - PocketPagerDuty, } from '@pocket-tools/terraform-modules'; -import { config, isDev } from './config'; +import { config } from './config'; import { Construct } from 'constructs'; -import { DataTerraformRemoteState } from 'cdktf'; import { DataAwsCallerIdentity, DataAwsRegion, @@ -13,34 +11,6 @@ import { import { DataAwsSnsTopic } from '@cdktf/provider-aws/lib/sns'; import { DataAwsKmsAlias } from '@cdktf/provider-aws/lib/kms'; -/** - * @param scope - */ -function createPagerDuty(scope: Construct) { - const incidentManagement = new DataTerraformRemoteState( - scope, - 'incident_management', - { - organization: 'Pocket', - workspaces: { - name: 'incident-management', - }, - }, - ); - - return new PocketPagerDuty(scope, 'pagerduty_policies', { - prefix: config.prefix, - service: { - criticalEscalationPolicyId: incidentManagement - .get('policy_default_critical_id') - .toString(), - nonCriticalEscalationPolicyId: incidentManagement - .get('policy_default_non_critical_id') - .toString(), - }, - }); -} - /** * Create CodePipeline to build and deploy terraform and ecs * @param app @@ -66,8 +36,6 @@ export function createApplicationCodePipeline( export function createPocketAlbApplication( scope: Construct, ): PocketALBApplication { - const pagerDuty = createPagerDuty(scope); - const region = new DataAwsRegion(scope, 'region'); const caller = new DataAwsCallerIdentity(scope, 'caller'); const secretsManager = new DataAwsKmsAlias(scope, 'kms_alias', { @@ -217,7 +185,7 @@ export function createPocketAlbApplication( threshold: 25, // 25% evaluationPeriods: 4, period: 300, // 5 minutes - actions: isDev ? [] : [pagerDuty.snsCriticalAlarmTopic.arn], + actions: [], }, }, });