AWS S3 Bucket Policy允许从aws机器学习中进行读/写访问

时间:2016-08-04 15:46:43

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

是否可以创建一个允许来自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

1 个答案:

答案 0 :(得分:0)

根据Granting Amazon ML Permissions to Output Predictions对Amazon S3和Granting Amazon ML Permissions to Read Your Data from Amazon S3

仔细检查您的政策

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