Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Credentials in Config #356

Open
VGoose opened this issue Dec 14, 2019 · 4 comments
Open

Missing Credentials in Config #356

VGoose opened this issue Dec 14, 2019 · 4 comments

Comments

@VGoose
Copy link

VGoose commented Dec 14, 2019

Getting the error below. My bucket is public so I'm not sure what's going on - am I missing something obvious? My plugin is a copy and paste of the README.

"gatsby-source-s3-image" threw an error while running the sourceNodes lifecycle:

Missing credentials in config
plugins: [
    {
      resolve: 'gatsby-source-s3-image',
      options: {
        bucketName: 'my.bucket.name',
        protocol: 'http', // [optional] Default to `https`.
      },
    },
    ...
]
    "Version": "2008-10-17",
    "Statement": [
        {
            "Sid": "AddPublicReadPermissions",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::my.bucket.name/*"
        }
    ]
}```
@otherjohn
Copy link

I get the same issue. I also have the same permissions.

@rub1e
Copy link

rub1e commented May 11, 2020

Any resolution on this? Having the same issue and can't figure out what's going on 😕

@racedale
Copy link

Adding the region fixed it for me, my bucket was in us-east-2

@mattmischuk
Copy link

I was able to fix this but creating an IAM user with its own set of credentials for the hosting platform I’m using (Netlify in this case). You’ll just need to give read access to the desired S3 bucket and put those env vars in your gatsby-config.

  1. Create a specific user for your hosting platform in the IAM Management Console
  2. Create AWS_S3_ACCESS_KEY_ID and AWS_S3_SECRET_ACCESS_KEY env variables
  3. Add those env vars to the hosting platform
  4. Update your plugin options (see below)
module.exports = {
  plugins: [
    {
      resolve: 'gatsby-source-s3-image',
      options: {
        accessKeyId: process.env.AWS_S3_ACCESS_KEY_ID,
        secretAccessKey: process.env.AWS_S3_SECRET_ACCESS_KEY,
        bucketName: 'bucket-name',
        region: 'us-east-1',
      },
    },
  ],
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants