How to set json policy under s3 bucket permissions to give only “s3:ListBucket” access to the below IdentityPoolId.
“Action”: “s3:ListBucket”, “Resource”: “arn:aws:s3:::New-customers”, then it gives as public access, but want to restrict and only available access to IdentityPoolId
var bucketName = "New-customers";
var bucketRegion = "ap-south-1";
var IdentityPoolId = "ap-south-1:xxxxxxxxxxxxxxxxxxxxxxxx";
AWS.config.update({
region: bucketRegion,
credentials: new AWS.CognitoIdentityCredentials({
IdentityPoolId: IdentityPoolId
})
});
var s3 = new AWS.S3({
apiVersion: '2006-03-01',
params: {Bucket: bucketName}
});
AWS.config.update({correctClockSkew: true});