我正在使用 go sdk 创建一个新角色并承担它。两者都是由同一个 IAM 用户完成的。角色信任关系如下:
{
"Statement": [{
"Effect": "Allow",
"Principal": { "AWS": "<an admin user>" },
"Action": [ "sts:AssumeRole" ]
}]
}
稍后尝试将对象添加到存储桶时,我可以创建会话令牌,但 PutObject 操作因 AccessDenied 而失败。桶策略是:
{
"Effect": "Allow",
"Action":"s3:*",
"Resource": [
"arn:aws:s3:::<name of the bucket>/*"
],
"Condition": {}
}