1

I am working for a solution to monitor events the below, whenever this event occurs, send an email to a few users:-

  1. Start / Stop / Terminate Instances

=> **I was able to get this done using EventBridge by providing the predefined event pattern **

{
  "source": ["aws.ec2"],
  "detail-type": ["EC2 Instance State-change Notification"],
  "detail": {
    "state": ["running", "stopped"],
    "instance-id": ["i-xxxxxxxxxxxx"]
  }
}

Similarly, I was trying out the below items using EventBridge, which is not working - whenever the event occurs it did not work.

  1. Get secret value from the Secrets manager. I tried to get GetSecretValue alone since that didn't work, tried for all events for Secret Manager, that too did not work.
    {
      "source": ["aws.secretsmanager"],
      "detail-type": ["AWS API Call via CloudTrail"],
      "detail": {
        "eventSource": ["secretsmanager.amazonaws.com"]
      }
    }
  1. Start session
    {
      "source": ["aws.ssm"],
      "detail-type": ["AWS API Call via CloudTrail"],
      "detail": {
        "eventSource": ["ssm.amazonaws.com"],
        "eventName": ["StartSession"],
        "requestParameters": {
          "target": ["i-0XXXXXXXXXX"],
          "documentName": ["AWS-StartPortForwardingSession"],
          "parameters": {
            "localPortNumber": [
              "55555"
            ],
            "portNumber": [
              "3389"
            ]
          }
        }
      }
    }
  1. Terminate session
{
  "source": ["aws.ssm"],
  "detail-type": ["AWS API Call via CloudTrail"],
  "detail": {
    "eventSource": ["ssm.amazonaws.com"],
    "eventName": ["TerminateSession"],
    "requestParameters": {
      "sessionId": ["********"]
    }
  }
}
  1. Get session token and a few more

Am I missing anything or having an incorrect pattern?

Also please let me know if these can be monitored (email alert) using a different way instead of EventBridge.

Thanks!

Shankar
  • 626
  • 7
  • 19
  • Did you ever work out the issue? I'm running into this now, doesn't seem to matter what I do I can't get any Secrets Manager events to trigger even the broadest Eventbridge rules I create. – Endophage Jul 25 '22 at 22:37

0 Answers0