S3 wget from EC2 instance gives 403 forbidden error even though all policies are implemented

Please, help!

Last login: Wed Jul 23 00:04:41 2014 from 46.7.181.81 Could not open a connection to your authentication agent. ubuntu@ip:~$ wget https://s3-eu-west-1.amazonaws.com/hadoopconfigfiles/core-site.xml
--2014-07-23 00:29:12--   Resolving s3-eu-west-1.amazonaws.com (s3-eu-west-1.amazonaws.com)...  Connecting to s3-eu-west-1.amazonaws.com (s3-eu-west-1.amazonaws.com)| connected.

HTTP request sent, awaiting response... 403 Forbidden 2014-07-23 00:29:12 ERROR 403: Forbidden.

I have tried everything. The policy from the IAM policy, bucket, made the file publicly available. gave all permissions, but still I got a forbidden error. I use an ec2 t2.micro instance, and from the command line I use wget to get the file from my s3 bucket.

https://s3-eu-west-1.amazonaws.com/hadoopconfigfiles/core-site.xml

this is the bucket policy i used

{
    "Version": "2008-10-17",
    "Id": "Policy1406073673060",
    "Statement": [
        {
            "Sid": "Stmt1406073666892",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:*",
            "Resource": "arn:aws:s3:::hadoopconfigfiles/*"
        }
    ]
}

and this is the IAM policy

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "*",
      "Resource": "*"
    }
  ]
}

bound the IAM policy to the instance and restarted, but had no effect. Please, help.

BR, Sarfraz.

+4
source share
1 answer

, CORS , :

<CORSConfiguration>
<CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
0

All Articles