【发布时间】:2019-11-28 22:29:40
【问题描述】:
我正在尝试配置一个 S3 存储桶,使其仅可供特定用户访问,而不是公众访问。
我创建了一个名为 s3-injury-log 的用户和以下存储桶策略
{
"Id": "Policy1542998309644",
"Version": "2012-10-17",
"Statement": [{
"Sid": "Stmt1542998308012",
"Action": "s3:*",
"Effect": "Allow",
"Resource": "arn:aws:s3:::injury-log",
"Principal": {
"AWS": ["arn:aws:iam::058842494618:user/s3-injury-log"]
}
}]
}
我的“阻止所有公共访问”选项卡如下
Block all public access - Off
Block public access to buckets and objects granted through new access control lists (ACLs) - On
Block public access to buckets and objects granted through any access control lists (ACLs) - On
Block public access to buckets and objects granted through new public bucket policies - Off
Block public and cross-account access to buckets and objects through any public bucket policies - Off
但是当尝试将对象放入存储桶时(使用 aws java 库),我收到以下错误消息
Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: CC71A7EFAFC9BBDB; S3 Extended Request ID: klrwopIIJK3PsJzEw
知道我做错了什么吗?
【问题讨论】:
标签: amazon-web-services amazon-s3 amazon-iam