Hi everyone,
I’m trying to migrate from using AWS Classic ELB to ALB.
In my playbook I’m using the elb_instance module to de-register an instance from an ELB before upgrading the application version, then re-register the instance afterwards.
That works very well with Classic ELB but elb_instance doesn’t seem to work with ALB: I’m getting an “ELB my_new_alb does not exist” error.
Looking at the code, I think elb_instance doesn’t support ALB and would need to use Boto3’s ElasticLoadBalancingv2 API, which is of course, not trivial.
So I turned to the elb_target_group module, which seems to be the way to interact with the instances of an ALB, but the API is cumbersome to use for my case.
I’d need to provide the whole list of the instances for a TG and do a modify_targets.
Meaning, when I de-register, I’d need the list of all instances and remove from it the one I want to de-register.
Same principle for registering a new instance.
So my question is: is there a way I’m missing to simply register/register instances on ALBs?
If not, is that under consideration (I couldn’t find anything on github)?
If using elb_target_group, is there a way to get the current instances of a target_group?
According to the documentation of elb_target_group_facts or elb_application_lb_facts, they don’t contain the targets.
Otherwise, what are my alternatives? Amend one of the plugins? Create a new one?
Thanks in advance,
Cyril.