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

When using IAM Policy, I get ERROR in S3Plugin: AccessDenied: Access Denied #62

Closed
hhff opened this issue Dec 14, 2016 · 1 comment
Closed

Comments

@hhff
Copy link

hhff commented Dec 14, 2016

Thanks so much for the hard work @MikaAK !

I'm on Mac OS w/ a Config looking like this:

config.plugins.push(new S3Plugin({
  s3Options: {
    accessKeyId: process.env.AWS_ACCESS_KEY_ID,
    secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
    region: 'us-east-1' // Bucket is US Standard
  },
  s3UploadOptions: {
    Bucket: 'my-bucket-name'
  },
  basePath: 'builds'
}))

However - those Keys are not a root AWS credential, instead they're attached to a group with this resource policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "s3:ListAllMyBuckets",
            "Resource": "arn:aws:s3:::*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::my-bucket-name/*",
                "arn:aws:s3:::my-bucket-name"
            ]
        },
        {
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::my-bucket-name/*",
                "arn:aws:s3:::my-bucket-name"
            ]
        }
    ]
}

The upload throws an AccessDenied error, like so:

ERROR in S3Plugin: AccessDenied: Access Denied
Child html-webpack-plugin for "index.html":
        + 3 hidden modules
Uploading [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆] 47% 4.3s%

Am I missing something simple? I use S3 a lot - and I use that Policy for almost every s3 "uploader" config I have.

Thankyou so much!

@hhff
Copy link
Author

hhff commented Dec 20, 2016

Nevermind - I had a typo in my ENV Vars.

Never code after 10pm....

THANKYOU

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

1 participant