我按照教程http://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html进行了操作.我设置了一个IAM用户(具有奇怪的权限)和一个S3-bucket,可以查询样本Athena表,并将输出写入我的S3-bucket.现在我有来自客户端的凭据来访问他的Athena表.这不起作用,我得到以下错误:
将输出写入url:s3://my-test-bucket/b36-f3c0-482-a225-34d63d355.txt时拒绝访问.请确保您可以访问S3存储桶.如果您使用KMS密钥加密查询结果,请确保您可以访问KMS密钥
我的S3-bucket是公共的."任何经过身份验证的AWS用户"的权限:读取,写入."每个人"的权限:读,写."日志传送"的权限:读取,写入.所有内容的"权限访问":读取,写入
Bucket Policy允许每个人都做任何事情.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::my-test-bucket"
},
{
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::my-test-bucket/*"
},
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::my-test-bucket/*"
}
] }
Run Code Online (Sandbox Code Playgroud)
CORS配置:
<?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration
xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<AllowedHeader>*</AllowedHeader> </CORSRule> </CORSConfiguration>
Run Code Online (Sandbox Code Playgroud)
仍然,我得到错误:将输出写入url时访问被拒绝...
编辑:我不时会收到另一个错误:"无法验证/创建输出存储桶my-test-bucket".不知道为什么我会得到不同的错误.
我能做什么?