ansible-collections / amazon.aws

Ansible Collection for Amazon AWS
GNU General Public License v3.0
308 stars 337 forks source link

Add placement/availability-zone-id as a hostvar #1550

Open timchenko-a opened 1 year ago

timchenko-a commented 1 year ago

Summary

It would be nice to have availability-zone-id available in the hostvars. Right now only availability_zone is available, storing AZ name.

Main use case is to use it in different topology-aware configurations when having services in different AWS accounts. E.g. we have a kafka cluster in one AWS account, consumers are in a different one. According to AWS documentation AZ names may be mapped to different physical locations in order to have a more even load spread. It would be much easier to perform a proper configuration if we have this AZ ID in hostvars, instead of getting it from EC2 metadata directly in ansible tasks.

It can be found using describe_availability_zones from Boto3.

Issue Type

Feature Idea

Component Name

plugins/inventory/aws_ec2.py

Additional Information

Code of Conduct

ansibullbot commented 1 year ago

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help