AWS Cloudwatch not triggering on API calls

安稳与你 提交于 2019-12-11 01:48:33

问题


I am trying to make a rule trigger on any API call for creation, but I haven't had any success.

I have another rule that triggers whenever and ec2 instance is running which works, but this rule does not trigger for RunInstances although I see the cloudtrail logs with RunInstances in the API log.

I have made a CloudWatch log from the cloudtrail and see the events that should be triggering it, but they don't. Is there a step I am missing? What are the necessary components to have CloudWatch properly trigger on API calls?

The rule mentioned:

 {
      "source": [
        "aws.cloudtrail"
      ],
      "detail-type": [
        "AWS API Call via CloudTrail"
      ],
      "detail": {
        "eventSource": [
          "cloudtrail.amazonaws.com"
        ],
        "eventName": [
          "CreateUserPool",
          "CreateImage",
          "CreateCacheCluster",
          "RunInstances",
          "CreateActivation",
          "RunJobFlow ",
          "CreateVault",
          "CreateDeliveryStream",
          "CreateStream",
          "CreateCluster",
          "CreateDBInstance",
          "CreateHostedZone",
          "CreateBucket",
          "CreateLaunchConfiguration",
          "CreateStack",
          "CreateEnvironment",
          "CreateWorkspaces"
        ]
      }
    }

To add more detail here is the other rule I used to test CloudWatch

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

This is the log of the startInstances and the following Lambda function running.

Cloudtrail of the the lambda function specifically which functions normally.

Here is the API call which should also initiate it according to the rule, but it does not.

Hopefully these images make it clearer as to what I am having trouble with.

P.S. I didn't know how much info I should consider confidential, so I over censored


回答1:


I misunderstood the rule I created. I thought "AWS API calls from Cloudtrail" when using the cloudtrail Service meant all the information stored in Cloudtrail. That does not seem to be the case.

As I mention in my comment, I am looking for other solutions for my problem, but I will make a separate question for that. Thanks!



来源:https://stackoverflow.com/questions/44889808/aws-cloudwatch-not-triggering-on-api-calls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!