{"action":"created","issue":{"url":"https://api.github.com/repos/andrewrk/node-s3-client/issues/89","labels_url":"https://api.github.com/repos/andrewrk/node-s3-client/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/andrewrk/node-s3-client/issues/89/comments","events_url":"https://api.github.com/repos/andrewrk/node-s3-client/issues/89/events","html_url":"https://github.com/andrewrk/node-s3-client/issues/89","id":88406835,"number":89,"title":"Access Denied Error","user":{"login":"aldendaniels","id":4658558,"avatar_url":"https://avatars.githubusercontent.com/u/4658558?v=3","gravatar_id":"","url":"https://api.github.com/users/aldendaniels","html_url":"https://github.com/aldendaniels","followers_url":"https://api.github.com/users/aldendaniels/followers","following_url":"https://api.github.com/users/aldendaniels/following{/other_user}","gists_url":"https://api.github.com/users/aldendaniels/gists{/gist_id}","starred_url":"https://api.github.com/users/aldendaniels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldendaniels/subscriptions","organizations_url":"https://api.github.com/users/aldendaniels/orgs","repos_url":"https://api.github.com/users/aldendaniels/repos","events_url":"https://api.github.com/users/aldendaniels/events{/privacy}","received_events_url":"https://api.github.com/users/aldendaniels/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-15T12:14:31Z","updated_at":"2015-06-15T12:26:39Z","closed_at":"2015-06-15T12:16:40Z","body":"Hello, I'm trying to use `node-s3-client` to sync a directory to s3:\r\n\r\n```javascript\r\n    s3.createClient({\r\n        s3Options: {\r\n            \"accessKeyId\": \"ACCESSKEY\",\r\n            \"secretAccessKey\": \"SECRETKEY\"\r\n        }\r\n    })\r\n    .uploadDir({\r\n        localDir: 'path/to/localdir',\r\n        s3Params: {\r\n            Prefix: '',\r\n            Bucket: 'bucket-1'\r\n        }\r\n    });\r\n```\r\n\r\nI'm consistently getting an `AccessDenied` error:\r\n```\r\nAccessDenied: Access Denied\r\n    at Request.extractError (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/services/s3.js:343:35)\r\n    at Request.callListeners (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/sequential_executor.js:100:18)\r\n    at Request.emit (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/sequential_executor.js:77:10)\r\n    at Request.emit (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/request.js:604:14)\r\n    at Request.transition (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/request.js:21:12)\r\n    at AcceptorStateMachine.runTo (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/state_machine.js:14:12)\r\n    at /Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/state_machine.js:26:10\r\n    at Request.<anonymous> (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/request.js:22:9)\r\n    at Request.<anonymous> (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/request.js:606:12)\r\n    at Request.callListeners (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/sequential_executor.js:104:18)\r\n    at Request.emit (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/sequential_executor.js:77:10)\r\n    at Request.emit (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/request.js:604:14)\r\n    at Request.transition (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/request.js:21:12)\r\n    at AcceptorStateMachine.runTo (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/state_machine.js:14:12)\r\n    at /Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/state_machine.js:26:10\r\n    at Request.<anonymous> (/Users/alden/Source/bidder/ui/apps/onespot-dashboard/node_modules/s3/node_modules/aws-sdk/lib/request.js:22:9)\r\n```\r\n\r\nMy IAM settings are as follows:\r\n```json\r\n{\r\n    \"Version\": \"2012-10-17\",\r\n    \"Statement\": [\r\n        {\r\n            \"Sid\": \"Stmt1412975049000\",\r\n            \"Effect\": \"Allow\",\r\n            \"Action\": [\r\n                \"s3:*\"\r\n            ],\r\n            \"Resource\": [\r\n                \"arn:aws:s3:::bucket-1/*\",\r\n                \"arn:aws:s3:::bucket-2/*\"\r\n            ]\r\n        }\r\n    ]\r\n}\r\n```\r\n\r\nAny ideas as to what is going on or how to debug?\r\nThanks!\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/andrewrk/node-s3-client/issues/comments/112043653","html_url":"https://github.com/andrewrk/node-s3-client/issues/89#issuecomment-112043653","issue_url":"https://api.github.com/repos/andrewrk/node-s3-client/issues/89","id":112043653,"user":{"login":"aldendaniels","id":4658558,"avatar_url":"https://avatars.githubusercontent.com/u/4658558?v=3","gravatar_id":"","url":"https://api.github.com/users/aldendaniels","html_url":"https://github.com/aldendaniels","followers_url":"https://api.github.com/users/aldendaniels/followers","following_url":"https://api.github.com/users/aldendaniels/following{/other_user}","gists_url":"https://api.github.com/users/aldendaniels/gists{/gist_id}","starred_url":"https://api.github.com/users/aldendaniels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldendaniels/subscriptions","organizations_url":"https://api.github.com/users/aldendaniels/orgs","repos_url":"https://api.github.com/users/aldendaniels/repos","events_url":"https://api.github.com/users/aldendaniels/events{/privacy}","received_events_url":"https://api.github.com/users/aldendaniels/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T12:26:39Z","updated_at":"2015-06-15T12:26:39Z","body":"More precisely, both permissions are needed:\r\n```json\r\n\"Resource\": [\r\n  \"arn:aws:s3:::bucket-1\",\r\n  \"arn:aws:s3:::bucket-1/*\",\r\n  \"arn:aws:s3:::bucket-2\",\r\n  \"arn:aws:s3:::bucket-2/*\"\r\n]\r\n```\r\n\r\nThe `/*` resource gives access to the objects within the bucket while the resource without the `/*` gives access to work with the bucket itself."}}