1
我試圖來形容運行,我使用下面的代碼EC2實例:如何在AWS的Java設置可用性區域爲訪問對象EC2
DescribeInstancesResult describeInstancesRequest = ec2.describeInstances();
List<Reservation> reservations = describeInstancesRequest.getReservations();
Set<Instance> instances = new HashSet<Instance>();
for (Reservation reservation : reservations) {
instances.addAll(reservation.getInstances());
}
System.out.println("You have " + instances.size() + " Amazon EC2 instance(s) running.");
我得到的返回0結果。我猜這是因爲默認的AZ被設置爲US-East。
我的實例正在美國西部運行。
如何更改AZ?