【发布时间】:2019-12-03 15:34:24
【问题描述】:
我有一个查询 Amazon Athena 数据库的 AWS Lambda 函数。但是执行 Lambda 函数时出现权限错误:
调用 GetQueryExecution 操作时发生错误 (AccessDeniedException):用户: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 -
你是对的。请张贴作为我会接受的答案
-
您在该问题中发布了您的 aws 帐户。你可能想要混淆它。
标签: amazon-web-services aws-lambda amazon-athena aws-security-group