Published on

Using Amazon S3 to share your media

Authors
  • avatar
    Name
    PatharaNor
    Twitter

s3-public-access-thumbnail

Requirement

  • AWS's account

Setting

  1. Create bucket via https://s3.console.aws.amazon.com/s3/buckets. Set your bucket name, the other options use default setting.
  2. After created, access into your bucket then go to Permissions. Slide down to Block public access box.
  3. Uncheck Block all public access option then press Save changes.

set-unblock-all

  1. Slide down to Bucket policy box then press Edit button to allow public read by paste JSON below into text box :
{
  "Version": "2008-10-17",
  "Statement": [
    {
      "Sid": "AllowPublicRead",
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*"
    }
  ]
}

note : don't forget change YOUR_BUCKET_NAME to your bucket and save the setting.

set-policy

  1. After saved, you should see red notice Publicly accessible in your bucket.

result

  1. Now you ready to share your media to user.