I have minio with bucket named "bucket" and IAM user named "user1"
I'll try to grant access to this bucket with Bucket Level Policy
client = boto3.client('s3', endpoint_url='localhost:9000')
client.put_bucket_policy(Bucket=bucket_name, Policy=bucket_policy)
{
'Version': '2012-10-17',
'Statement': [
{
"Sid": "1",
"Effect": "Allow",
"Principal": "*",
"Condition": {
"StringLike": {
"arn:aws:iam": [
"arn:aws:iam:::user1",
]
}
},
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::bucket",
"arn:aws:s3:::bucket/*"
]
}
]
}
But I've got error like this
ClientError: An error occurred (MalformedPolicy) when calling the PutBucketPolicy operation: invalid condition key 'arn:aws:iam'