AWS Rekognition validation error while adding faces to collection

0

Hi ,

I am trying to add the faces to the collection

var params = {
CollectionId: "aws:rekognition:us-east-1:xxxx:collection/collectionidnewbatch",
DetectionAttributes: [
],
ExternalImageId: "testphotoid",
Image: {
S3Object: {
Bucket: "parentbucket/nested/bucket",
Name: "ab1"
}
}
};
rekognition.indexFaces(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data);
});

and getting following error

"image.s3Object.bucket' failed to satisfy constraint: Member must satisfy regular expression pattern: [0-9A-Za-z.-_]

asked 5 years ago393 views
1 Answer
0

Hi,

From the code snippet, it looks like the issue is that you are not specifying the bucket and name correctly. It should probably be:

Bucket: "parentbucket",
Name: "nested/bucket/ab1"

The S3 bucket needs to be the actual bucket name. Path details are part of the object name, not the bucket name.

There's example code in https://docs.aws.amazon.com/rekognition/latest/dg/add-faces-to-collection-procedure.html if that's helpful.

Hope this helps,
Jonathan

AWS
answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions