0
votes

I am getting the below mentioned error while running the bot locally.

"Invalid Bot Configuration: Access denied while invoking lambda function arn:aws:lambda:us-east-1:***********:function:dataCodeHook from arn:aws:lex:us-east-1:***********:intent:DataProcess:4. Please check the policy on this function."

My Edit relationship json is :

{
  "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

1 Answers

0
votes

Changing the json as below has solved the issue.

{
  "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"
        }
      }
    }
  ]
}