什么是Amazon Comprehend正确的AssumeRolePolicyDocument和PolicyDocument

时间:2019-02-27 16:21:40

标签: amazon-web-services amazon-iam aws-comprehend

我有以下AssumeRolePolicyDocument:

                            {
                              "Version": "2012-10-17",
                              "Statement": {
                                "Effect": "Allow",
                                "Principal": {"Service": "comprehend.amazonaws.com"},
                                "Action": "sts:AssumeRole"
                              }
                            }

和以下PolicyDocument:

{
                                  "Version": "2012-10-17",
                                  "Statement": {
                                    "Effect": "Allow",
                                    "Action": "s3:GetObject",
                                    "Resource": "arn:aws:s3:::${bucket.name}/*"
                                  }
                                }

不幸的是,我从Amazon Comprehend获得的是NO_READ_ACCESS_TO_INPUT: The provided data access role does not have proper access to the input data.。怎么了?

完整的源代码在这里:https://github.com/SnipHubNet/SnipHubNet.github.io/blob/master/snippets/201902/src/test/kotlin/AmazonComprehend3Snippet.kt

1 个答案:

答案 0 :(得分:0)

发现原因:必须等待一段时间(例如30秒钟),然后理解才能访问新创建的存储桶和策略。