# using Ansible for microservice deployment to ECS

**URL:** <https://forum.ansible.com/t/using-ansible-for-microservice-deployment-to-ecs/43839>\
**Category:** Get Help\
**Tags:** aws\
**Created:** [July 11, 2025, 10:12am UTC](https://forum.ansible.com/t/using-ansible-for-microservice-deployment-to-ecs/43839 "2025-07-11T10:12:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Megala\_Natarajan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/megala_natarajan/32/7781_2.png) [@Megala\_Natarajan](https://forum.ansible.com/u/Megala_Natarajan)\
**Post date:** [July 11, 2025, 10:12am UTC](https://forum.ansible.com/t/using-ansible-for-microservice-deployment-to-ecs/43839/1 "2025-07-11T10:12:02Z")

</div>

Is that possible to retrieve latest image uri from ECR using ansible module? if yes, please guide with the module name.

---

<div class="post-metadata">

**Author:** ![markuman](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@markuman](https://forum.ansible.com/u/markuman)\
**Post date:** [July 22, 2025, 5:34pm UTC](https://forum.ansible.com/t/using-ansible-for-microservice-deployment-to-ecs/43839/2 "2025-07-22T17:34:16Z")

</div>

Yes, that’s possible.

```auto
    - name: get service info
      community.aws.ecs_service_info:
        cluster: "{{ CLUSTER }}"
        service: "{{ SERVICE }}"
        details: true
      register: service

    - name: get taskdefinition info
      community.aws.ecs_taskdefinition_info:
        task_definition: "{{ service.services[0].taskDefinition }}"
      register: td

    - name: do something usefull with the image in use
      debug:
        var: td.container_definitions[0].image

```
