gpt4 book ai didi

amazon-web-services - 如何授予 Athena 对 Lambda 函数的查询权限?

转载 作者:行者123 更新时间:2023-12-05 02:11:39 26 4
gpt4 key购买 nike

我有一个查询 Amazon Athena 数据库的 AWS Lambda 函数。但是在执行 Lambda 函数时出现权限错误:

An error occurred (AccessDeniedException) when calling the GetQueryExecution operation: User: arn:aws:sts::773592622512:assumed-role/lambda_access-role/reddit_monitor is not authorized to perform: athena:GetQueryExecution on resource: arn:aws:athena:ap-southeast-2:773592622512:workgroup/primary: ClientError

我为 Lambda 函数创建了这个策略:

  "Version": "2012-10-17",
"Statement": [
{
"Action": [
"athena:StartQueryExecution"
],
"Effect": "Allow",
"Resource": "*"
},
{
"Action": [
"s3:*"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::${var.athena-bucket}",
"arn:aws:s3:::${var.athena-bucket}/*"
]
}
]
}

请问为什么还是没有权限查询Athena?我在这里错过了什么吗?

最佳答案

您授予了 athena:StartQueryExecution 而不是 athena:GetQueryExecution

关于amazon-web-services - 如何授予 Athena 对 Lambda 函数的查询权限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57200560/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com