无效的Bot配置

时间:2018-02-01 13:45:58

标签: amazon-web-services aws-lambda amazon-lex

我在本地运行bot时遇到了下面提到的错误。

  

“无效的Bot配置:调用lambda时访问被拒绝   function arn:aws:lambda:us-east-1:***********:function:dataCodeHook   来自arn:aws:lex:us-east-1:***********:intent:DataProcess:4。请   检查此功能的政策。“

我的编辑关系json是:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Federated": "cognito-identity.amazonaws.com",
        "Service": "lex.amazonaws.com",
        "Service" : 
      },
      "Action": "sts:AssumeRoleWithWebIdentity",
      "Condition": {
        "StringEquals": {
          "cognito-identity.amazonaws.com:aud": "us-east-1:*****-*****-*****"
        },
        "ForAnyValue:StringLike": {
          "cognito-identity.amazonaws.com:amr": "unauthenticated"
        }
      }
    }
  ]
}

1 个答案:

答案 0 :(得分:0)

如下所示更改json已解决了这个问题。

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Federated": "cognito-identity.amazonaws.com",
        "Service": "lambda.amazonaws.com"
      },
      "Action": "sts:AssumeRoleWithWebIdentity",
      "Condition": {
        "StringEquals": {
          "cognito-identity.amazonaws.com:aud": us-east-1:*****-*****-*****"
        },
        "ForAnyValue:StringLike": {
          "cognito-identity.amazonaws.com:amr": "unauthenticated"
        }
      }
    }
  ]
}