【问题标题】:AWS S3 Bucket Policy to allow read/write access from aws machine learningAWS S3 存储桶策略允许从 aws 机器学习进行读/写访问
【发布时间】:2016-12-10 20:21:21
【问题描述】:

是否可以创建允许从 aws 机器学习进行读写访问的 S3 存储桶策略?我尝试了以下存储桶策略,但不起作用。

存储桶策略:

{
    "Version": "2008-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "machinelearning.amazonaws.com"
            },
            "Action": [
                "s3:GetObject",
                "s3:PutObject"
            ],
            "Resource": "arn:aws:s3:::cxra/*"
        },
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "machinelearning.amazonaws.com"
            },
            "Action": "s3:PutObjectAcl",
            "Resource": "arn:aws:s3:::cxra/*",
            "Condition": {
                "StringEquals": {
                    "s3:x-amz-acl": "bucket-owner-full-control"
                }
            }
        },
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "machinelearning.amazonaws.com"
            },
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::cxra"
        },
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "machinelearning.amazonaws.com"
            },
            "Action": [
                "s3:GetBucketLocation"
            ],
            "Resource": "arn:aws:s3:::cxra"
        }
    ]
}

Error screen

【问题讨论】:

  • 在资源中的 2 个位置将此 arn:aws:s3:::cxra 更改为 arn:aws:s3:::cxra/*,然后检查

标签: amazon-web-services amazon-s3 policy bucket


【解决方案1】:

根据 Granting Amazon ML Permissions to Output Predictions 到 Amazon S3 和 Granting Amazon ML Permissions to Read Your Data from Amazon S3 仔细检查您的政策

由于它们被记录为两个单独的政策,我建议您遵循这一点,而不是将这两个政策合并到一个文档中。故障排除会更容易。

【讨论】:

  • 谢谢。我会检查更多细节。
  • 通过检查 S3 url 解决了这个问题。 aws 机器学习页面中的目标文件 URL 错误,因此我将 URL 从“s3.ap-northeast-2.amazonaws.com/cxra/ml1.csv”更改为“cxra/ml1.csv”。感谢您的评论。
猜你喜欢
  • 1970-01-01
  • 2020-12-18
  • 1970-01-01
  • 2020-03-26
  • 2018-08-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多