mugi
mugi

Reputation: 11

Aws json policy - Error: Parse error on line 10

Staring at this but can't figure out what's the error, Trying to give user (in principle) access to bucket mentioned in resource.


{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::000000:user/username"
            
            }
            },
            "Action": ["s3:ListBucket"],
            "Resource": "arn:aws:s3:::bucketname"
        }
    ]
}


Error: Parse error on line 10: ... } }, "Action": ["s3:ListBucket"],

Expecting 'EOF', '}', ',', ']', got ':'

edited a few times but no luck, new to this.

Upvotes: 0

Views: 146

Answers (1)

jellycsc
jellycsc

Reputation: 12359

There is an extra } below the line "AWS": "arn:aws:iam::000000:user/username". Please find the fixed json below.

{
    "Version": "2012-10-17",
    "Statement":
    [
        {
            "Effect": "Allow",
            "Principal":
            {
                "AWS": "arn:aws:iam::000000:user/username"
            },
            "Action":
            [
                "s3:ListBucket"
            ],
            "Resource": "arn:aws:s3:::bucketname"
        }
    ]
}

Upvotes: 1

Related Questions