我有以下假设:
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Principal": {"Service": "comprehend.amazonaws.com"},
"Action": "sts:AssumeRole"
}
}
和以下策略记录:
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::${bucket.name}/*"
}
}
不幸的是,我从亚马逊理解的是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/master/master/snippets/201902/src/test/kotlect/kotlin/kotlin/kotlin/amazoncomprehend3snippet.3snippet.kt.kt.kt
找到了原因:必须等一点(假设30秒),然后才能访问新创建的存储桶和策略。