尽管实施了所有策略,但来自EC2实例的S3 wget给出403禁止错误

时间:2014-07-23 00:44:40

标签: amazon-web-services amazon-ec2 amazon-s3

请帮忙!

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.

我已经尝试了一切。来自IAM的策略,存储桶策略,使文件公开。给了所有权限,但我仍然得到禁止的错误。我正在使用ec2 t2.micro实例,从命令行我使用wget从我的s3存储桶中获取文件。

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

这是我使用的存储桶政策

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

这是IAM政策

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

将IAM策略附加到实例并重新启动但没有效果。请帮忙。

BR, Sarfraz。

1 个答案:

答案 0 :(得分:0)

您的存储桶策略看起来是正确的,所以我建议您查看您的CORS配置并让它看起来像这样:

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