通过CLI配置AWS Cognito用户池高级安全功能帐户接管风险配置

时间:2018-12-28 02:24:23

标签: amazon-cognito aws-cli

尝试通过CLI配置我的Cognito用户池

如果我跑步

aws cognito-idp set-risk-configuration --user-pool-id ap-southeast-2_123456789 --account-takeover-risk-configuration Actions={LowAction={Notify=false,EventAction=NO_ACTION},MediumAction={Notify=false,EventAction=NO_ACTION},HighAction={Notify=false,EventAction=NO_ACTION}}

我刚得到错误

Unknown options: Actions=MediumAction=Notify=false, Actions=MediumAction=EventAction=NO_ACTION, Actions=HighAction=Notify=false, Actions=HighAction=EventAction=NO_ACTION, Actions=LowAction=EventAction=NO_ACTION

我尝试将请求简化为

aws cognito-idp set-risk-configuration --user-pool-id ap-southeast-2_123456789 --account-takeover-risk-configuration Actions={HighAction={EventAction=NO_ACTION}}

我得到了错误

Missing required parameter in AccountTakeoverRiskConfiguration.Actions.HighAction: "Notify"

所以我知道我走在正确的轨道上,但是当我将命令更改为

aws cognito-idp set-risk-configuration --user-pool-id ap-southeast-2_123456789 --account-takeover-risk-configuration Actions={HighAction={EventAction=NO_ACTION,Notify=false}}满足缺失的参数,我得到Unknown options: Actions={HighAction=Notify=false}

“通知”参数的正确语法是什么?

1 个答案:

答案 0 :(得分:0)

AWS支持人员确认该错误为解析器仅丢弃布尔值的错误

唯一的解决方法是将外部JSON文件用于道具。

set-risk-configuration --user-pool-id ap-southeast-2_123456789 --account-takeover-risk-configuration file://riskconfig.json

riskconfig.json

{
    "Actions": {
        "LowAction": {
            "Notify": false,
            "EventAction": "NO_ACTION"
        },
        "MediumAction": {
            "Notify": false,
            "EventAction": "NO_ACTION"
        },
        "HighAction": {
            "Notify": false,
            "EventAction": "NO_ACTION"
        }
    }
}