AWS examples for Java/Javascript

dogsareit
dogsareit used Ask the Experts™
on
This is going to sound really stupid - so be it - but with the AWS examples - I see a lot of this coding - Can someone explain to me - basically - what the code is describing ??
I think I know, its giving substance/value to "Version", "Statement" etc but when I try this in Java, especially when compiling it in a package it does not fly. And I found this example in AWS SDK examples for Javascript/Java.
Could someone clear the air for me ?? And yes, I feel pretty stupid.
thank you.

{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"PublicRead",
      "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::examplebucket/*"]
    }
  ]
}

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Phil PhillipsSenior Platform Engineer

Commented:
That's an IAM policy (see: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html).  You normally attach to those an IAM role/group (can be done in the AWS console). Basically, it's a way of defining access to AWS resources. Another resource to check out is the AWS IAM policy generator: https://awspolicygen.s3.amazonaws.com/policygen.html
Top Expert 2016
Commented:
It's also JSON of course. The normal context of JSON is Javascript, so if you want to use it in Java, you should be using a Java JSON api

Author

Commented:
well smack myself on the forehead.....then smack myself on the back of the head too ! Thank you both !!
Really clears the air...

Author

Commented:
Thank you both so very much...
Top Expert 2016

Commented:
:)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial