I am trying to connect a powershell script to an Auto Scaling Group via the .NET Amazon API.
I have checked the documentation here, but I am struggling to get an object that contains the IP addresses of the instances belonging to the Auto Scaling Group.
I am not sure which class to use, or which class contains my object.
I am currently using:
$request = New-Object -TypeName Amazon.AutoScaling.Model.DescribeAutoScalingInstancesRequest
Has anyone come across the same situation? Which class/object contains the IP addresses of the instances running in the AutoScaling group?
Expanding on the answer above - you may want to include the name of the auto scaling group so you don't get every instance from every group. Also, if you're using VPC your instances may not have public IPs so you'll be after the private IPs like this
Get-ASAutoScalingInstance | ? {$_.AutoScalingGroupName -eq "web-autoscaler-group"} | select -ExpandProperty InstanceId | Get-EC2Instance | select -ExpandProperty RunningInstance | ft InstanceId, PrivateIpAddress