use of com.amazonaws.services.ec2.model.DescribeAccountAttributesResult in project aws-doc-sdk-examples by awsdocs.
the class DescribeAccount method main.
public static void main(String[] args) {
// snippet-start:[ec2.java1.describe_account.main]
AmazonEC2 ec2 = AmazonEC2ClientBuilder.defaultClient();
try {
DescribeAccountAttributesResult accountResults = ec2.describeAccountAttributes();
List<AccountAttribute> accountList = accountResults.getAccountAttributes();
for (ListIterator iter = accountList.listIterator(); iter.hasNext(); ) {
AccountAttribute attribute = (AccountAttribute) iter.next();
System.out.print("\n The name of the attribute is " + attribute.getAttributeName());
List<AccountAttributeValue> values = attribute.getAttributeValues();
// iterate through the attribute values
for (ListIterator iterVals = values.listIterator(); iterVals.hasNext(); ) {
AccountAttributeValue myValue = (AccountAttributeValue) iterVals.next();
System.out.print("\n The value of the attribute is " + myValue.getAttributeValue());
}
}
System.out.print("Done");
} catch (Exception e) {
e.getStackTrace();
}
// snippet-end:[ec2.java1.describe_account.main]
}
Aggregations