Skip to content

Set AWS S3 bucket permission with mc tool

Use mc tool to set AWS S3 permission.

Install mc

brew install minio/stable/mc

Usage

prepare mc-policy.json

{
 "Statement": [
    {
      "Sid":"PublicRead",
      "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject","s3:GetObjectVersion"],
      "Resource":["arn:aws:s3:::BUCKET1/PREFIX1*","arn:aws:s3:::BUCKET1/PREFIX2*"]
    }
 ],
 "Version": "2012-10-17"
}
mc policy set-json mc-policy.json s3/BUCKET1
mc policy get-json s3/BUCKET1/

Reference