Skip to content

Commit

Permalink
Enable monitoring for media download task
Browse files Browse the repository at this point in the history
  • Loading branch information
philmcmahon committed Oct 29, 2024
1 parent 2d19531 commit 8863a16
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions packages/cdk/lib/transcription-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,15 @@ export class TranscriptionService extends GuStack {
secretName: `media-download-ssh-key-${this.stage}`,
});

const alarmTopicArn = new GuStringParameter(
this,
'InvestigationsAlarmTopicArn',
{
fromSSM: true,
default: `/${props.stage}/investigations/alarmTopicArn`,
},
).valueAsString;

const mediaDownloadTask = new GuEcsTask(this, 'media-download-task', {
app: mediaDownloadApp,
vpc,
Expand All @@ -543,9 +552,13 @@ export class TranscriptionService extends GuStack {
version: 'pm-media-download-infra', // should be 'main' once we merge to main!
},
taskTimeoutInMinutes: 120,
monitoringConfiguration: {
noMonitoring: true,
},
monitoringConfiguration:
this.stage === 'PROD'
? {
noMonitoring: false,
snsTopicArn: alarmTopicArn,
}
: { noMonitoring: true },
cpuArchitecture: CpuArchitecture.ARM64,
securityGroups: [
new GuSecurityGroup(this, 'media-download-sg', {
Expand Down Expand Up @@ -752,14 +765,6 @@ export class TranscriptionService extends GuStack {

// alarms

const alarmTopicArn = new GuStringParameter(
this,
'InvestigationsAlarmTopicArn',
{
fromSSM: true,
default: `/${props.stage}/investigations/alarmTopicArn`,
},
).valueAsString;
if (isProd) {
const alarms = [
// alarm when a message is added to the dead letter queue
Expand Down

0 comments on commit 8863a16

Please sign in to comment.