Avatar of Stuart Saxby
Stuart Saxby
Flag for Australia asked on

AWS - Steps to upload a VM - Creating a vmimport user to upload the image

I'm following the steps to upload an image here:
http://docs.aws.amazon.com/vm-import/latest/userguide/import-vm-image.html

When I run the following command:
aws iam create-role --role-name vmimport --assume-role-policy-document file://trust-policy.json

I get this error:
H:\>aws iam create-role --role-name vmimport --assume-role-policy-document C:\Users\Stuart.Saxby\Desktop\trust-policy.json
An error occurred (MalformedPolicyDocument) when calling the CreateRole operation: This policy contains invalid Json


I've copied the JSON exactly and verified it in a JSON validator.  Any ideas on how I can troubleshoot this?
AWS* IAMJSON

Avatar of undefined
Last Comment
Stuart Saxby

8/22/2022 - Mon
Stuart Saxby

ASKER
Some steps I've taken:
1.)  Confirmed the JSON file is correct and at the correct location
2.)  Compared the JSON file contents with what's displayed on the website
3.)  Confirmed the JSON that's on the website is actually correctly formatted JSON

I'm wondering if it's actually a problem with the JSON or the error is pointing to some other problem.
ASKER CERTIFIED SOLUTION
Phil Phillips

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Stuart Saxby

ASKER
Champ!  That did it.  I tried as written and got:
Error parsing parameter '--assume-role-policy-document': Unable to load paramfile file:///C:/Users/Stuart.Saxby/Desktop/trust-policy.json: [Errno 2] No such file or directory: u'/C:/Users/Stuart.Saxby/Desktop/trust-policy.json'

Removed the additional '/' and the import worked correctly.  Thanks for your help!
Your help has saved me hundreds of hours of internet surfing.
fblack61