Bỏ chọn Block Public Access settings for this bucket
aws rekognition create-collection --collection-id iDevelopKnownFaces
Cognito
ta sẽ thấy 2 Role Cognito_FaceRecognitionAuth_Role và Cognito_FaceRecognitionUnauth_Role của Cognito Identity Pool mà ta đã tạo ở bước trên, ta sẽ chỉnh sửa policy của 2 Role này.{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"rekognition:DetectLabels",
"mobileanalytics:PutEvents",
"cognito-sync:*",
"cognito-identity:*"
],
"Resource": "*"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"rekognition:CreateCollection",
"rekognition:DeleteCollection",
"rekognition:IndexFaces",
"dynamodb:Scan",
"dynamodb:Query",
"dynamodb:UpdateItem",
"rekognition:SearchFacesByImage"
],
"Resource": [
"arn:aws:s3:::facerecognitions3bucket/*",
"arn:aws:dynamodb:<YOUR_REGION>:<ACCOUNT_ID>:table/facerecognition",
"arn:aws:rekognition:<YOUR_REGION>:<ACCOUNT_ID>:collection/iDevelopKnownFaces"
]
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"rekognition:DetectLabels",
"mobileanalytics:PutEvents",
"cognito-sync:*",
"cognito-identity:*"
],
"Resource": "*"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"rekognition:CreateCollection",
"rekognition:DeleteCollection",
"rekognition:IndexFaces",
"dynamodb:Scan",
"dynamodb:Query",
"dynamodb:UpdateItem",
"rekognition:SearchFacesByImage"
],
"Resource": [
"arn:aws:s3:::facerecognitions3bucket/*",
"arn:aws:dynamodb:<YOUR_REGION>:<ACCOUNT_ID>:table/facerecognition",
"arn:aws:rekognition:<YOUR_REGION>:<ACCOUNT_ID>:collection/iDevelopKnownFaces"
]
}
]
}