# Listing alias record from route53

**URL:** <https://forum.ansible.com/t/listing-alias-record-from-route53/25931>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [November 6, 2017, 3:54am UTC](https://forum.ansible.com/t/listing-alias-record-from-route53/25931 "2017-11-06T03:54:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suresh\_Prajapati](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@Suresh\_Prajapati](https://forum.ansible.com/u/Suresh_Prajapati)\
**Post date:** [November 6, 2017, 3:54am UTC](https://forum.ansible.com/t/listing-alias-record-from-route53/25931/1 "2017-11-06T03:54:41Z")

</div>

Hi,

I am writing a route53 module for internal usage. For that, I want to list the alias records from route53.

> `
> 
> * * *
> 
> - name: retrieve details for [lb.example.io](http://lb.example.io)  
> strategy: debug  
> hosts: localhost  
> tasks:
> - route53:  
> state: get  
> zone: [example.io](http://example.io)  
> record: [lb.example.io](http://lb.example.io)  
> type: A  
> register: rec
> - name: Print record  
> debug:  
> var: rec
> 
> `

This is the run output

`

PLAY [retrieve details for [lb.example.io](http://lb.example.io)] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK [route53] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK [Print record] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> {  
“rec”: {  
“changed”: false,  
“failed”: false,  
“nameservers”: [  
“[ns-464.awsdns-58.com](http://ns-464.awsdns-58.com).”,  
“[ns-1140.awsdns-14.org](http://ns-1140.awsdns-14.org).”,  
“[ns-1893.awsdns-44.co.uk](http://ns-1893.awsdns-44.co.uk).”,  
“[ns-691.awsdns-22.net](http://ns-691.awsdns-22.net).”  
],  
“set”: {}  
}  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
localhost

`

When I list the record using _AWS CLI,_ I get the following answer

`

⚡ aws route53 list-resource-record-sets --hosted-zone-id \*\*\*\*\*\*\*\*\*\*\* --query “ResourceRecordSets[?Name == ‘[lb.example.io](http://lb.example.io).’]” |jq ..AliasTarget.DNSName

“[m1.example.io](http://m1.example.io).”  
“[m2.example.io](http://m2.example.io).”  
“[m3.example.io](http://m3.example.io).”  
“[m4.example.io](http://m4.example.io).”  
“[m5.example.io](http://m5.example.io).”  
“[m6.example.io](http://m6.example.io).”  
“[m7.example.io](http://m7.example.io).”

`

I am following [route53 core module](http://ansible-manual.readthedocs.io/en/latest/route53_module.html). My ansible version is

`

⚡ ansible --version  
ansible 2.4.1.0

`

Please suggest if I am missing something here.

thanks
