[英]AWS S3 Bucket Policy to allow only lowercase files
Is it possible to limit s3 bucket to lowercase files/directories only?是否可以将 s3 存储桶限制为仅小写文件/目录?
Some downstream systems are case insensitive so I want to prevent any issues.一些下游系统不区分大小写,所以我想防止出现任何问题。
There's a Lambda workaround, but is it possible to specify this requirement as a bucket policy?有一个 Lambda 解决方法,但是否可以将此要求指定为存储桶策略?
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Enforce lower-case",
"Effect": "Deny",
"Principal":"*",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::mybucket/*",
"Condition": {
"StringNotEquals": {
"s3:KeyName": "lower(s3:KeyName)"
}
}
}
]
}
No, that is not possible because:不,那是不可能的,因为:
An alternative approach would be to have the S3 bucket trigger an AWS Lambda function, which could:另一种方法是让 S3 存储桶触发 AWS Lambda function,这可以:
Key
Key
Copy
the object to a new lowercase Key and delete the original objectCopy
为新的小写Key,并删除原来的object However, it would mean that Foo
would rename to foo
and a later FOO
would overwrite foo
.但是,这意味着
Foo
将重命名为foo
并且稍后的FOO
将覆盖foo
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.