简体   繁体   中英

CloudWatch event for Cognito Identity

I have been trying to trigger a lambda function using CloudWatch event for Cognito-Identity for any read/write event but the problem is the lambda function is not getting triggered for any login/logout/update attribute etc. I read the documentation(which is not sufficient) and had also talked to AWS Support but didn't get any satisfactory answer although they assured me to get back to me after consulting peers. The Rule I created had the following main components:

Event pattern:

{
   "source": [
     "aws.cognito-identity"
   ]
}

Status: Enabled

Targets:

  • Type: Lambda function
  • Resource Name: recipeDefaults
  • Input: Matched event

The question I have is: when does it get triggered? What are the list of activities which is performed on Cognito-Identity to trigger the lambda function.

TL;DR : It seems your use case would require the aws.cognito-idp event source, but unfortunately Amazon Cognito User Pools does not yet support Events Delivered Via CloudTrail (note that the supported services list includes 'Cognito Identity', but not 'Cognito User Pools').

Background

I'm afraid this boils down to the utterly confusing service naming and abbreviations related to the two main Amazon Cognito components:

Now, you seem to be primarily interested in the Amazon Cognito User Pools API actions like AdminUpdateUserAttributes . Accordingly, your rule would need to target the aws.cognito-idp rather than the aws.cognito-identity event source, but unfortunately Amazon Cognito User Pools does not yet support Events Delivered Via CloudTrail (note that the supported services list includes 'Cognito Identity', but not 'Cognito User Pools').

Since @steffen-opel's answer, cognito-idp has been added as an event source to CloudTrail . It's registered under the event source cognito-idp.amazonaws.com , and all Cognito User Pool Actions are supported.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM