Description
Problem
In VS Code, most of my problems with IAM Policies is small syntax errors on my part. I have Parkinsons and mistyping is common occurrence. I typically live in visual studio code for all of my day-to-day tasks, if possible.
Expected behavior
As such it would be nice to have support IAM Validation syntax/validation checker, like what is online with errors and warnings on a given IAM Policy.
Example:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AccessToViewTerraformStateLockandReset",
"Action": [
"dynamodb:ListTables",
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:DeleteItem",
"asdf:asdf"
],
"Effect": "Allowed",
"Resource": "warn:dynamodb:sometable"
},
]
}
The validation would find the following using the above code block.
Errors:
-
asdf:asdf
as it is not a valid action. -
Allowed
as it should really beAllow
-
warn:dynamodb:sometable
as it is not a valid formatted Arn. -
},
json syntax error due to misplaced comma.
Warnings: -
dynamodb:ListTables
cannot be restricted to a specific resource.
It would also be nice to have a way to list the possible IAM Actions for a given service, as right now I get code completion sometimes, but I don't always remember the prefixes for each service.