Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 无法将kinesis触发器连接到lambda&引用;无法访问流";-IAM角色配置正确。如何调试这个?_Amazon Web Services_Aws Lambda_Amazon Iam_Amazon Kinesis - Fatal编程技术网

Amazon web services 无法将kinesis触发器连接到lambda&引用;无法访问流";-IAM角色配置正确。如何调试这个?

Amazon web services 无法将kinesis触发器连接到lambda&引用;无法访问流";-IAM角色配置正确。如何调试这个?,amazon-web-services,aws-lambda,amazon-iam,amazon-kinesis,Amazon Web Services,Aws Lambda,Amazon Iam,Amazon Kinesis,我试图将kinesis触发器连接到lambda函数,但无论我如何配置IAM,都会收到相同的错误。我还尝试在大多数字段中将IAM角色设置为“*”。如果按照错误请求的方式配置IAM角色,如何确定阻止触发器连接的原因 以下是错误: 创建触发器时出错:无法访问流[arn]。请确保角色可以在IAM中对您的流执行GetRecords、GetShardIterator、DescribeStream和ListStreams操作 以下是我的IAM角色,它可以执行GetRecords、GetShardIterato

我试图将kinesis触发器连接到lambda函数,但无论我如何配置IAM,都会收到相同的错误。我还尝试在大多数字段中将IAM角色设置为“*”。如果按照错误请求的方式配置IAM角色,如何确定阻止触发器连接的原因

以下是错误:

创建触发器时出错:无法访问流[arn]。请确保角色可以在IAM中对您的流执行GetRecords、GetShardIterator、DescribeStream和ListStreams操作

以下是我的IAM角色,它可以执行GetRecords、GetShardIterator、DescribeStream和ListStreams以及其他功能:

{
"Version": "2012-10-17",
"Statement": [
    {
        "Sid": "Stmt1505763107000",
        "Effect": "Allow",
        "Action": [
            "kinesis:CreateStream",
            "kinesis:DescribeStream",
            "kinesis:GetShardIterator",
            "kinesis:GetRecords",
            "kinesis:ListRecords",
            "kinesis:PutRecord",
            "kinesis:PutRecords"
        ],
        "Resource": [
            "arn:aws:kinesis:us-east-2:219021079475:stream/lead"
        ]
    },
    {
        "Sid": "Stmt1505763184000",
        "Effect": "Allow",
        "Action": [
            "cloudwatch:*"
        ],
        "Resource": [
            "*"
        ]
    },
    {
        "Sid": "Stmt1505763256000",
        "Effect": "Allow",
        "Action": [
            "lambda:*"
        ],
        "Resource": [
            "arn:aws:lambda:us-east-2:219021079475:function:logsKinesisData"
        ]
    }
]
}

除了设置之外,我还没有编写lambda函数:

'use strict';

console.log('Loading function');

exports.handler = (event, context, callback) => {
//console.log('Received event:', JSON.stringify(event, null, 2));
event.Records.forEach((record) => {
    // Kinesis data is base64 encoded so decode here
    const payload = new Buffer(record.kinesis.data, 'base64').toString('ascii');
    console.log('Decoded payload:', payload);
});
callback(null, `Successfully processed ${event.Records.length} records.`);
};

您可以这样做,但仍然只是确认,您是否将问题中显示的用户角色附加到Lambda?您的策略没有kinesis:ListStreams。检查一下!接得好!让我去尝试更新,看看这是否修复了错误。啊,不——我会更新问题。您可能会这样做,但仍然只是确认,您是否将问题中显示的用户角色附加到Lambda?您的策略没有动力学:ListStreams。检查一下!接得好!让我去尝试更新,看看这是否修复了bug。啊,不——我会更新问题。