I'm experiencing an issue where Capistrano only deploys to a single server, despite having multiple running servers in my AutoScalingGroup.
My setup on AWS:
A launch template (id: lt-xxx, name: preprod)
An autoscaling group (name: preprod)
2 running instances launched by the ASG (Ids: i-x1 and i-x2)
Below is the output of instantiating an Elbas::AWS::AutoscaleGroup, calling instances.running, and creating a new Elbas::AWS::InstanceCollection with the IDs I can see in the ASG:
The issue seems to be in Elbas::AWS::InstanceCollection#query_instances_by_ids, which only looks at the first reservation in the response from describe_instances.
I'm submitting a PR, which changes the method to:
def query_instances_by_ids(ids)
aws_client
.describe_instances(instance_ids: @ids)
.reservations.map(&:instances).flatten
end
I'm experiencing an issue where Capistrano only deploys to a single server, despite having multiple running servers in my AutoScalingGroup.
My setup on AWS: A launch template (id: lt-xxx, name: preprod) An autoscaling group (name: preprod) 2 running instances launched by the ASG (Ids: i-x1 and i-x2)
Below is the output of instantiating an Elbas::AWS::AutoscaleGroup, calling instances.running, and creating a new Elbas::AWS::InstanceCollection with the IDs I can see in the ASG:
As you can see, when I instantiate the ASG, I can see 2 instances (i-x1 and i-x2), but calling
or
I only get the first instance.
The issue seems to be in Elbas::AWS::InstanceCollection#query_instances_by_ids, which only looks at the first reservation in the response from describe_instances.
I'm submitting a PR, which changes the method to: