aws-cloudformation / aws-cloudformation-resource-providers-awsutilities-commandrunner

Apache License 2.0
81 stars 21 forks source link

Unable to run aws ecs update-service --region us-east-1 --cluster xxxxxx --service xxxxxxxx --deployment-configuration '{"deploymentCircuitBreaker":{"enable":true,"rollback":true},"maximumPercent":200,"minimumHealthyPercent":100}' > ./command-output.txt ```` #55

Open vravula2 opened 1 year ago

vravula2 commented 1 year ago

Hi , I am unable run the below command using CommandeRunner utility, however I can run it successfully using CLI directly aws ecs update-service --region us-east-1 --cluster xxxxxx --service xxxxxxxx --deployment-configuration '{"deploymentCircuitBreaker":{"enable":true,"rollback":true},"maximumPercent":200,"minimumHealthyPercent":100}'

./command-output.txt ````

the issue seems to be with the AWS CLI version that's running on the command runner created instance, I would like to request you to please update the AWS CLI to aws-cli/2.x.x .

gitshawn commented 1 year ago

The first issue with your command is that it is outputting in json. For the CommandRunner resource to be successful what gets echoed to command-output.txt needs to be exactly one string without spaces. AWS CLI by default outputs in json, so that would fail. If you add --output text to your command, this is a good next step.

dpnova commented 1 year ago

https://stackoverflow.com/questions/72515483/retrieve-public-key-via-aws-cli

Seems like I'm having version issues with this as well - the above linked SO question is the exact problem I'm having too