인스턴스 하나만 허락(Policy)
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:StartInstances",
"ec2:StopInstances",
"ec2:RebootInstances",
"ec2:DescribeInstances"
],
"Resource": "arn:aws:ec2:<<현재리전>>:<<계정 아이디>>:instance/<<인스턴스 아이디>>"
},
{
"Effect": "Allow",
"Action": "ec2:DescribeInstances",
"Resource": "*"
}
]
}
들어온 사용자 마다 유동적으로 똑같은 닉네임의 디렉토리만 접근 가능()
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListSpecificBucket",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::demo-my-home-bucket-1",
"Condition": {
"StringLike": {
"s3:prefix": [
"",
"home/",
"home/${aws:username}/*"
]
}
}
},
{
"Sid": "FullAccessToUserHome",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::demo-my-home-bucket-1/home/${aws:username}",
"arn:aws:s3:::demo-my-home-bucket-1/home/${aws:username}/*"
]
}
]
}