amazon-web-services - AWS S3 Permissios - 创建文件夹,同时只能上传某些扩展
问题描述
我正在尝试编写一个 IAM 策略来执行以下操作:
- 允许用户访问特定的存储桶
- 只能上传选定的几种类型的文件.. 基于扩展名
- 允许在该存储桶中创建文件夹
我已经设法做到了前两个,但我无法满足第三个要求。这是我尝试过的:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:ListAllMyBuckets"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::bucketxxx"
]
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:GetObjectVersion"
],
"Resource": [
"arn:aws:s3:::bucketxxx/*.mp4",
"arn:aws:s3:::bucketxxx/*.pdf",
"arn:aws:s3:::bucketxxx/*.jpg",
"arn:aws:s3:::bucketxxx/*.png",
"arn:aws:s3:::bucketxxx/*.xlsx",
"arn:aws:s3:::bucketxxx/*.csv"
]
}
]
}
解决方案
推荐阅读
- vue.js - Nuxt 动态资产未加载
- scala - 将 Doobie 流从数据库保存到文件
- php - PHP 致命错误:未捕获的错误:在 null 上调用成员函数 appendChild()
- winforms - Powershell/Forms - 如何在选项卡控件中锚定列表视图?
- python - 从 pandas.DataFrame.isin 获取单个 True/Flase 值
- mysql - A connection attempt failed because the connected party did not properly respond after a period of time - VB
- apl - 是否曾经有一个 APL-ASCII 音译方案获得了重大采用?
- sql-server - T-SQL 使用触发器或函数创建自定义列
- webpack - 在 webpack 配置中禁用部分 babelrc
- gradle - 如何在 Raspberry Pi 上运行 JavaFX 11 应用程序?