99designs / 99designs/iamy

MalformedPolicyDocument: The policy failed legacy parsing

Open
#65 15 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
245
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Ran into a strange issue with this group policy:

```
> aws iam put-group-policy --group-name AdministratorsWithMFA --policy-name AllowAssumingBastionRole --policy-document '{
"Statement": {
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Resource": "arn:aws:iam::xxx:role/bastion"
},
"Version": "2012-10-17"
}'

An error occurred (MalformedPolicyDocument) when calling the PutGroupPolicy operation: The policy failed legacy parsing
exit status 255
```

Looks like the `Version` key needs to be the first thing. Seems horrible. This works:

```yaml
{
"Version": "2012-10-17",
"Statement": {
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Resource": "arn:aws:iam::xxx:role/bastion"
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.