# Update AWS ECS Task Definition Image from Jenkins

**URL:** <https://community.jenkins.io/t/update-aws-ecs-task-definition-image-from-jenkins/5721>\
**Category:** Using Jenkins\
**Created:** [February 10, 2023, 6:52pm UTC](https://community.jenkins.io/t/update-aws-ecs-task-definition-image-from-jenkins/5721 "2023-02-10T18:52:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aub\_C](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@Aub\_C](https://community.jenkins.io/u/Aub_C)\
**Post date:** [February 10, 2023, 6:52pm UTC](https://community.jenkins.io/t/update-aws-ecs-task-definition-image-from-jenkins/5721/1 "2023-02-10T18:52:38Z")

</div>

Hello,

I’m currently using ‘amazon-ecs’ and ‘aws-codebuild’ plugins. I have a CodeBuild project setup to build an image from a Dockerfile and push the image up to ECR.

My question is; What is the best way to update an ECS Task Definition with the new image from ECR and kill the tasks? Can I do this in the Jenkins pipeline using the ‘amazon-ecs’ plugin or do I need to use AWS CLI to do this?

Thanks!  
Aub\_C
