I am trying to automate some things on AWS and I am using the Java API for this. I can start several instances that I want, but I cannot find a suitable class or method that can get me the current state of the instance (for example, start, stop, etc.).
I tried this
DescribeInstanceStatusRequest describeInstance = new DescribeInstanceStatusRequest().withInstanceIds(instances.get(i).getInstanceId()); DescribeInstanceStatusResult attr = ec2.describeInstanceStatus(describeInstance); List<InstanceStatus> state = attr.getInstanceStatuses();
not sure why instance status is a list
Can someone point me to the correct API call.
Thanks in advance
source share