use of com.amazonaws.services.s3.model.Region in project aws-doc-sdk-examples by awsdocs.
the class DescribeRegionsAndZones method main.
public static void main(String[] args) {
final AmazonEC2 ec2 = AmazonEC2ClientBuilder.defaultClient();
DescribeRegionsResult regions_response = ec2.describeRegions();
for (Region region : regions_response.getRegions()) {
System.out.printf("Found region %s " + "with endpoint %s", region.getRegionName(), region.getEndpoint());
}
DescribeAvailabilityZonesResult zones_response = ec2.describeAvailabilityZones();
for (AvailabilityZone zone : zones_response.getAvailabilityZones()) {
System.out.printf("Found availability zone %s " + "with status %s " + "in region %s", zone.getZoneName(), zone.getState(), zone.getRegionName());
}
}
Aggregations