cannot access attributes of registered variable returned by AWS CLI command run

Hi All,

I cannot figure out how to reference the zone id attribute from the registered variable of the below AWS CLI.
For some reason it doesn’t work.

Playbook:

You will have issues trying to use ‘|from_json’ in a set_fact as it is likely to cast the value back to a string before Ansible 2.0.

You should typically always use filters that change the data type in the “last mile”.

So instead of using set_fact, just use the registered var where you need it. If you want, you could always use set_fact to give you easier direct access to stdout, but you will still need to use ‘|from_json’ in the last mile.

Such as:

(hosted_zone_list_res.stdout | from_json)[0].Id