AWS:为Cognito触发器指定Lambda版本 [英] AWS: specify Lambda version for Cognito trigger

查看:97
本文介绍了AWS:为Cognito触发器指定Lambda版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Cognito用户池和一个相应的身份池。

I have a Cognito User Pool and corresponding a Identity pool.

我想在 Post身份验证中调用Lambda函数的特定版本。 或类似的其他触发器。

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.

http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws- lambda-triggers.html

{
    "version": number,
    "triggerSource": "string",
    "region": AWSRegion,
    "userPoolId": "string",
    ...
}

如何指定lambda函数的版本?

How do I specify the version of the lambda function?

推荐答案

Cognito,始终使用最新版本或任何其他版本是lambda提供的默认版本。

Cognito, always uses the latest version or whatever is the default version provided by lambda.

您在文档中引用的版本是事件版本号。如果将来Cognito对请求的格式进行重大更改,则可以通过检查此版本号来保护代码免遭破坏。

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.

这篇关于AWS:为Cognito触发器指定Lambda版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆