Deployment failing with AccessDenied
See original GitHub issueHi,
I’ve tried to follow all the instructions correctly, but am still unable to deploy to a test project.
My gatsby-config.js
includes the bucketName, region and acl
module.exports = {
plugins: [
{
resolve: `gatsby-plugin-s3`,
options: {
bucketName: 'hello-world-gatsby-unique',
region: 'eu-west-3',
acl: null
},
},
]
}
I created an IAM account for the project with an AmazonS3FullAccess
policy — taking the advice that this was the easiest (but not best) way from this comment.
I then created a bucket
With no blocking of public access (for now).
I’m not using an Access Control List, instead setting up a Bucket Policy, taken from the advice in this comment.
I’ve also set up the Static website hosting with index and error documents to index.html
and 404.html
respectively.
After signing into the the AWS CLI using
aws configure
with the Access Key ID and Secret Access Key
I can manually upload a file to the bucket with a command like this
aws s3 cp README.md s3://hello-world-gatsby-unique/README.md
But running yarn run deploy
gives me this error
$ gatsby-plugin-s3 deploy
✖ Failed.
AccessDenied: Access Denied
- s3.js:585 Request.extractError
[hello-world]/[aws-sdk]/lib/services/s3.js:585:35
- sequential_executor.js:106 Request.callListeners
[hello-world]/[aws-sdk]/lib/sequential_executor.js:106:20
- sequential_executor.js:78 Request.emit
[hello-world]/[aws-sdk]/lib/sequential_executor.js:78:10
- request.js:683 Request.emit
[hello-world]/[aws-sdk]/lib/request.js:683:14
- request.js:22 Request.transition
[hello-world]/[aws-sdk]/lib/request.js:22:10
- state_machine.js:14 AcceptorStateMachine.runTo
[hello-world]/[aws-sdk]/lib/state_machine.js:14:12
- state_machine.js:26
[hello-world]/[aws-sdk]/lib/state_machine.js:26:10
- request.js:38 Request.<anonymous>
[hello-world]/[aws-sdk]/lib/request.js:38:9
- request.js:685 Request.<anonymous>
[hello-world]/[aws-sdk]/lib/request.js:685:12
- sequential_executor.js:116 Request.callListeners
[hello-world]/[aws-sdk]/lib/sequential_executor.js:116:18
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
To make sure it wasn’t a unique name issue I tried to make sure with the long bucket name.
I feel like I must have missed something, but not sure what.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6 (3 by maintainers)
Argh those permissions are so frustrating. This is the reason we don’t have an official document yet, because everyone says something different. I also absolutely hate the vague error AWS throws.
@JoshuaWalsh any ideas?
We should probably create a issue to document all permissions. This issue however, is not the place.