title: how to handle ECS deploys in CodePipeline for changes in task definition
body: <p>I am deploying an ECS Fargate task with two containers: 1 reverse proxy nginx and 1 python server. For each I have an ECR repository, and I have a CI/CD CodePipeline set up with</p>
  
  <p><code>CodeCommit -&gt; CodeBuild -&gt; CodeDeploy</code></p>
  
  <p>This flow works fine for simple code changes. But what if I want to add another container? I can certainly update my <code>buildspec.yml</code> to add the building of the container, but I also need to 1) update my task definition, and 2) assign this task definition to my service. </p>
  
  <p>Questions:</p>
  
  <p>1) If I use the CLI in my CodeBuild stage to create a new task definition and associate it with my service, won't this trigger a deploy? And then my CodeDeploy will try to deploy again, so I'll end up deploying twice?</p>
  
  <p>2) This approach ends up creating a new task definition and updating the service on every single deploy. Is this bad? Should I have some logic to pull down the LATEST task revision and diff the JSON from CodeCommit version and only update if there is a difference?</p>
  
  <p>Thanks!</p>