Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat (SRM) add failed events slack notification #886

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

raylrui
Copy link
Contributor

@raylrui raylrui commented Mar 3, 2025

solve: #875

Subscribe to the 'SequenceRunStateChange' event, and send the slack notification topic when the failed event is triggered.
event rules as:

eventRule.addEventPattern({
      source: ['orcabus.sequencerunmanager'],
      detailType: ['SequenceRunStateChange'],
      detail: {
        status: ['FAILED'],
        id: [{ exists: true }],
        instrumentRunId: [{ exists: true }],
        sampleSheetName: [{ exists: true }],
        startTime: [{ exists: true }],
      },
    });

SNS topic issue for tracking:
Because we set up 'alerts' sns topic manually, CDK can't modify the resource policy as it is an "imported" resource in our stacks. So we need to add a resource policy to allow EventBridge to publish to this SNS topic.
example of manually added resource policy:

{
      "Sid": "AWSEvents_OrcaBusBeta-SequenceRunManagerStackSlackNotificationRule_Id85755e27-3dd5-408e-9091-9cbc7315db7e",
      "Effect": "Allow",
      "Principal": {
        "Service": "events.amazonaws.com"
      },
      "Action": "sns:Publish",
      "Resource": "arn:aws:sns:ap-southeast-2:843407916570:AwsChatBotTopic-alerts"
      }

@raylrui raylrui added the feature New feature label Mar 3, 2025
@raylrui raylrui self-assigned this Mar 3, 2025
@raylrui raylrui changed the title srm add failed event slack notification Feat (SRM) add failed events slack notification Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant