# **[bucket_name]**과 **[directory_name]**을 할당할 경로에 맞게 수정 필요
# 예시) bucket_name : tmp-indi-dics / directory_name : users
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowUserToSeeBucketListInTheConsole",
"Action": [
"s3:ListAllMyBuckets",
"s3:GetBucketLocation"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::*"
]
},
{
"Sid": "AllowRootAndHomeListingOfCompanyBucket",
"Action": [
"s3:ListBucket"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::**[bucket_name]**"
],
"Condition": {
"StringEquals": {
"s3:prefix": [
"",
"**[directory_name]**/"
],
"s3:delimiter": [
"/"
]
}
}
},
{
"Sid": "AllowListingOfUserFolder",
"Action": [
"s3:ListBucket"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::**[bucket_name]**"
],
"Condition": {
"StringLike": {
"s3:prefix": [
"**[directory_name]**/${aws:username}/*"
]
}
}
},
{
"Sid": "AllowAllS3ActionsInUserFolder",
"Effect": "Allow",
"Action": [
"s3:*"
],
"Resource": [
"arn:aws:s3:::**[bucket_name]**/**[directory_name]**/${aws:username}/*"
]
}
]
}
IAM 계정으로 관리 콘솔 로그인 후 본인 소유의 디렉터리에만 접근 가능함을 확인