use of software.amazon.awssdk.services.cloudfront.model.ListDistributionsResponse in project aws-doc-sdk-examples by awsdocs.
the class GetDistrubutions method getCFDistrubutions.
// snippet-start:[cloudfront.java2.dis.main]
public static void getCFDistrubutions(CloudFrontClient cloudFrontClient) {
try {
ListDistributionsResponse response = cloudFrontClient.listDistributions();
DistributionList list = response.distributionList();
List<DistributionSummary> dists = list.items();
for (DistributionSummary dist : dists) {
System.out.println("The Distribution ARN is " + dist.arn());
}
} catch (CloudFrontException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
Aggregations