Module for describing availability zones?

I’m not sure if I’m overlooking this or not, but is there a module from Ansible that will describe the availability zones in my AWS region?

I typically use us-east-1 as my default region, which has 5 available availability zones (A,B, C, D, E), out of which I can only use 4. I never know which ones are available to me when I stand up my VPC and create my subnets.

So my desire is to simply describe availability zones with an ansible module, and NOT pass the aws cli ec2 describe-availability-zones through with a command in my role.

Thank you.

You can write a module or a simple filter that will give you the availability zones in a region.
https://github.com/linuxdynasty/ld-ansible-filters/blob/master/filter_plugins/aws.py#L202

So you can do something like this
zones: “{{ aws_region | zones() }}”

Thanks Allen!

I was trying to avoid creating anything custom, but it looks like a custom module needs to be made.

Thank you so much.

A filter as I showed you above would be simpler, than a module imo.