1
这是斗政策:为什么这个S3存储桶策略不允许我的IAM用户放置对象?
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "statement1",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::xxxxxxxxxxxx:user/userName"
},
"Action": "*",
"Resource": "arn:aws:s3:::my-super-awesome-bucket-name-test/*"
}
}
使用AWS CLI我能列出桶的内容:
aws s3 ls s3://my-super-awesome-bucket-name-test
2017-06-28 19:50:42 97 testFile.csv
但是,我不能上传文件:
aws s3 cp csv_sum.js s3://my-super-awesome-bucket-name-test/
upload failed: ./csv_sum.js to s3://my-super-awesome-bucket-name-test/csv_sum.js An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
我还需要做些什么才能授予我的IAM用户访问权限?我通过aws configure添加了所需的信息,还有其他需要的东西吗?
'aws s3 cp'命令可能需要** Bucket **的权限以及存储桶的内容。尝试添加''arn:aws:s3 ::: my-super-awesome-bucket-name-test“(不带'/ *')的第二个资源。 –
事实证明,它一定是由我的AWS CLI客户端引起的,我通过自制软件将它安装在我的Mac上。从我的Linux PC尝试相同的命令没有问题。获得的教训,只需坚持使用Linux – Hoofamon
要在Mac上安装[AWS Command-Line Interface(CLI)](http://aws.amazon.com/cli/),只需使用'sudo pip install awscli'。它在Mac上运行得非常好! –