title: How to fix the aws CODE BUILD COMMAND_EXECUTION_ERROR exit status 255
body: <p>Iam configuring CICD piepline usng aws services code build pilepileline etc, to update the deploymnet in my ecs fargate cluster, In my buildspec.yml file  aws ecs cli commands are  failing throwing "COMMAND_EXECUTION_ERROR: Error while executing command: aws ecs update-service --services xxxxx. Reason: exit status 255" </p>
  
  <p>I have tried providing permission to the codebuild role with "AmazonECS_FullAccess" policy. </p>
  
  <pre><code>post_build:  
      commands:  
        - echo Build completed on `date`  
        - echo Pushing the Docker images...  
        - docker push $REPOSITORY_URI:latest  
        - docker push $REPOSITORY_URI:$IMAGE_TAG  
        - echo Writing image definitions file...  
        - printf '[{"name":"xxxxxxx","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG &gt; imagedefinitions.json  
        - cat imagedefinitions.json 
        - echo Updating ECSfargate service ...  
        - aws ecs describe-services --services xxxxxxxxxxxxxxxxx 
        - aws ecs update-service --service xxxxxxxxxxxxxxxxx --desired-count 2 --no-force-new-deployment  
  
  </code></pre>