Granting user access to a single Amazon S3 bucket.

Granting an IAM user access to a single bucket is really easy:

  1. Create a User in IAM via the Amazon Web Console
  2. Assign that user the following policies via: Settings > Attach User Policy > Custom Policy
{
  "Statement": [
    {
      "Action": "s3:*",
      "Effect": "Allow",
      "Resource": [
        "arn:aws:s3:::bucketname",
        "arn:aws:s3:::bucketname/*"
      ]
    }
  ]
}
{
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:ListAllMyBuckets",
      "Resource": "arn:aws:s3:::*"
    }
  ]
}

Code as documentation

You often read about the value of code comments and good meaningful variable/method/object names. Yet sometimes when your coding your under presume to release a patch, or you think to yourself who wouldn’t understand this code it’s so beautifully laid out and formatted.

Today I fell victim to my own beautifully laid out and formatted code. Yikes!

...
 and left(accno, 1) in ( '2', '3', '4', '5', '9' ) 
...

I’m sure at the time I was very familiar with why accounts that started in that range were important but a few months on I cannot remember.

From this day forth I promise to do Code as Documentation mum!