Class: Cluster::Discovery::EC2::AutoScaling
- Inherits:
-
Object
- Object
- Cluster::Discovery::EC2::AutoScaling
- Defined in:
- lib/cluster/discovery/ec2/auto_scaling.rb
Instance Method Summary collapse
-
#discover(aws_asg:) ⇒ Array<Aws::EC2::Types::Instance>
Discover EC2 Instances by AutoScaling Group.
-
#initialize(aws_region:) ⇒ AutoScaling
constructor
A new instance of AutoScaling.
Constructor Details
#initialize(aws_region:) ⇒ AutoScaling
Returns a new instance of AutoScaling.
5 6 7 |
# File 'lib/cluster/discovery/ec2/auto_scaling.rb', line 5 def initialize(aws_region:) @aws_region = aws_region end |
Instance Method Details
#discover(aws_asg:) ⇒ Array<Aws::EC2::Types::Instance>
Discover EC2 Instances by AutoScaling Group
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cluster/discovery/ec2/auto_scaling.rb', line 14 def discover(aws_asg:) fail EmptyASGError if aws_asg.nil? = Cluster::Discovery::EC2::Tag.new(aws_region: @aws_region) .discover(aws_tags: [ { key: 'aws:autoscaling:groupName', value: aws_asg } ]) end |