Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred (MalformedPolicyDocument) when calling the CreateRole operation: This policy contains invalid Json #2

Closed
pknomad opened this issue Jul 4, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@pknomad
Copy link

pknomad commented Jul 4, 2022

Creating a role using AWS CLI generates the following error:
An error occurred (MalformedPolicyDocument) when calling the CreateRole operation: This policy contains invalid Json

  1. Go to AWS Cookbook repo
  2. Run ROLE_ARN=$(aws iam create-role --role-name AWSCookbook101Role --assume-role-policy-document assume-role-policy.json --output text --query Role.Arn)

Expected behavior
A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • macOS 12.4 ARM
  • Chrome, Visual Studio Code, iTerm, AWS CLI 2.7.12, Python 3.10.5

JSON is happily accepted when creating the role through the AWS UI. I'm inclined to think I'm fat fingering something or something about AWS CLI doesn't like the formatting somewhere.

@pknomad pknomad added the bug Something isn't working label Jul 4, 2022
@pknomad
Copy link
Author

pknomad commented Jul 4, 2022

AWS CLI will permit assume-role function on the role created manually on the UI.

@pknomad pknomad closed this as completed Jul 4, 2022
@pknomad
Copy link
Author

pknomad commented Jul 4, 2022

missing file:// right before assume-role-policy.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant