I have spent an embarrassingly long time trying to solve this riddle.
I have a shell variable called API_ID which I parsed from json using jq
ludo$ echo $API_ID
> "ucjj72orp1"
Why is it that when I copy paste it like this it works fine:
aws apigateway get-resources --rest-api-id "ucjj72orp1"
and like this I get an error:
aws apigateway get-resources --rest-api-id $API_ID
An error occurred (NotFoundException) when calling the GetResources operation: Invalid REST API identifier specified 420257254224:"ucjj72orp1"
-rin yourjqcommand? If not, the variable$API_IDmight contain double quote, that possibly makes an invalid aws id.