Reputation: 2027
I have a Cognito User Pool and corresponding a Identity pool.
I want to call a specific version of my Lambda function on Post authentication
or some other trigger like that.
I don't see an option to specify a version code in the Console although the examples all have a version number.
{
"version": number,
"triggerSource": "string",
"region": AWSRegion,
"userPoolId": "string",
...
}
How do I specify the version of the lambda function?
Upvotes: 2
Views: 1700
Reputation: 189
Actually it is possible updating user pool trigger configuration with AWS CLI using Lambda arn that includes alias, like
aws cognito-idp update-user-pool --user-pool-id _awsregion_id_ --lambda-config PostAuthentication=arn:aws:lambda:_awsregion_:_awsid_:function:_functionname_:_alias_
Upvotes: 1
Reputation: 5572
Cognito, always uses the latest version or whatever is the default version provided by lambda.
The version that you are referring in the documentation is the event version number. In case in the future Cognito introduces a breaking change to the format of the request you can protect your code from breaking by checking this version number.
Upvotes: 2