我想要做的是列出存储桶的所有内容,除了特定文件夹(存档)的内容。问题是当我“ls”存储桶时,我也从“存档”文件夹中获取文件。这是我目前的设置:
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:ListBucket"
],
"Sid": "Stmt1382452205000",
"Resource": [
"arn:aws:s3:::mybucket"
],
"Condition":{
"StringNotLike":{"s3:prefix":["archive/"]}
},
"Effect": "Allow"
},
{
"Sid": "ExplictDenyAccessToArchive",
"Action": ["s3:*"],
"Effect": "Deny",
"Resource":["arn:aws:s3:::mybucket/archive/*"]
},
{
"Sid": "DenyListBucketOnArchive",
"Action": ["s3:ListBucket"],
"Effect": "Deny",
"Resource": ["arn:aws:s3:::*"],
"Condition":{
"StringLike":{"s3:prefix":["archive/"]}
}
}
]
}