amazon-javascript-sdk

How to list AWS S3 buckets using amazon-javascript-sdk?

空扰寡人 提交于 2019-12-11 12:29:04
问题 I need to get a list of buckets having the client accessKeyId and secretAccessKey. From the docs I understood that I have to update de configurations of AWS, create a new S3 object, then call on it the listBuckets() function with the callback. So, here's my code: AWS.config.update({ accessKeyId: awsKey.identifier, secretAccessKey: awsKey.secret, region: awsKey.region, apiVersion: '2006-03-01' }); let s3 = new AWS.S3(); s3.listBuckets((response, data) => { console.log(response); console.log

AWS Cognito Invalid identity pool configuration

蹲街弑〆低调 提交于 2019-11-30 08:38:08
I am using the AWS Javascript API and trying to get the assigned cognito id: AWS.config.credentials.get(function(err) { if (!err) { console.log("Cognito Identity Id: " + AWS.config.credentials.identityId); } }); Why does this result in a 400 error with the message below? {"__type":"InvalidIdentityPoolConfigurationException","message":"Invalid identity pool configuration. Check assigned IAM roles for this pool."} I have IAM roles configured for authenticated and non-authenticated users. { "Version": "2012-10-17", "Statement": [{ "Action": [ "mobileanalytics:PutEvents", "cognito-sync:*" ],

AWS Cognito Invalid identity pool configuration

空扰寡人 提交于 2019-11-29 11:31:37
问题 I am using the AWS Javascript API and trying to get the assigned cognito id: AWS.config.credentials.get(function(err) { if (!err) { console.log("Cognito Identity Id: " + AWS.config.credentials.identityId); } }); Why does this result in a 400 error with the message below? {"__type":"InvalidIdentityPoolConfigurationException","message":"Invalid identity pool configuration. Check assigned IAM roles for this pool."} I have IAM roles configured for authenticated and non-authenticated users. {