AWS rekognition and s3 bucket region

匆匆过客 提交于 2021-01-27 20:51:32

问题


I am getting the following error when trying to access my s3 bucket with aws rekognition:

message: 'Unable to get object metadata from S3. Check object key, region and/or access permissions.',

My hunch is it has something to do with the region.

Here is the code:

const config = require('./config.json');
const AWS = require('aws-sdk');
AWS.config.update({region:config.awsRegion});
const rekognition = new AWS.Rekognition();


var params = {
   "CollectionId": config.awsFaceCollection
}

rekognition.createCollection(params, function(err, data) {
  if (err) {
    console.log(err, err.stack);
  }
  else  {
    console.log('Collection created');           // successful response
  }

});

And here is my config file:

{
  "awsRegion":"us-east-1",
  "s3Bucket":"daveyman123",
  "lexVoiceId":"justin",
  "awsFaceCollection":"raspifacecollection6"
}

I have given almost all the permissions to the user I can think of. Also the region for the s3 bucket appears to be in a place that can work with rekognition. What can I do?


回答1:


Was having the same issue and the solution was to to use the same region for the Rekognition API and S3 bucket, and if using a Role make sure that it has proper permissions to access both S3 and Rekognition.




回答2:


I had the same problem, resolved by choosing the specific aws recommended region for rekognition.



来源:https://stackoverflow.com/questions/49466041/aws-rekognition-and-s3-bucket-region

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!