Make the json from cli-input-json takes proper json
felixgao opened this issue · comments
felixgao commented
I am playing with the iam commands like
saws> aws iam create-role --cli-input-json file://test-saws-iam-role.json
The json file contains the following
{
"AssumeRolePolicyDocument": "{ \"Statement\": [ { \"Effect\": \"Allow\", \"Principal\": { \"Service\": \"ec2.amazonaws.com\" }, \"Action\": \"sts:AssumeRole\" } ] }",
"Path": "/",
"RoleName": "iam-role-test"
}
Notice that I have to escape the values in AssumeRolePolicyDocument
, if it is not escaped the following error cause the command to fail
Parameter validation failed:
Invalid type for parameter AssumeRolePolicyDocument, value: {'Statement': [{'Action': 'sts:AssumeRole', 'Principal': {'Service': 'ec2.amazonaws.com'}, 'Effect': 'Allow'}]}, type: <class 'dict'>, valid types: <class 'str'>
Donne Martin commented
Seppe Stas commented
The same thing happens when the command is run with aws-cli. And it still exists.
Donne Martin commented
@seppestas appreciate for the note on this being an aws-cli issue, I think it will need to be addressed there.
If this is still a problem I would file a report in the aws-cli project. Thanks!