Open JonLittleIT opened 4 years ago
Did you run the terraform to create the aws_cloudwatch_event_rule of type GuardDuty? Can you view it from the console?
I wanted to test just the lambda and I manually created the cloud watch rule which is set to trigger lambda on Guard Duty findings in Cloudwatch.
Without the filter for GuardDuty finding events you'll get CloudWatch events that the Lambda cannot process. It was only intended to process those of type GuardDuty.
hey can you help me look at this issue in the code?
{ "errorMessage": "json: cannot unmarshal array into Go struct field CloudWatchEvent.detail-type of type string", "errorType": "UnmarshalTypeError" }
which is related to this func
func handler(event events.CloudWatchEvent) error { var finding GuardDutyFinding err := json.Unmarshal(event.Detail, &finding) if err != nil { log.Fatalf("Cannot unmarshal finding: %v", err) }
type GuardDutyFinding struct { ID string
json:"id"
Title stringjson:"title"
Description stringjson:"description"
Severity float32json:"severity"
Type stringjson:"type"
AccountId stringjson:"accountId"
}any idea why I cant get this to run in Lambda?