Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Use GetAccountSummary
with an Amazon SDK or CLI
The following code examples show how to use GetAccountSummary
.
Action examples are code excerpts from larger programs and must be run in context. You can see this action in
context in the following code example:
- CLI
-
- Amazon CLI
-
To get information about IAM entity usage and IAM quotas in the current account
The following get-account-summary
command returns information about the current IAM entity usage and current IAM entity quotas in the account.
aws iam get-account-summary
Output:
{
"SummaryMap": {
"UsersQuota": 5000,
"GroupsQuota": 100,
"InstanceProfiles": 6,
"SigningCertificatesPerUserQuota": 2,
"AccountAccessKeysPresent": 0,
"RolesQuota": 250,
"RolePolicySizeQuota": 10240,
"AccountSigningCertificatesPresent": 0,
"Users": 27,
"ServerCertificatesQuota": 20,
"ServerCertificates": 0,
"AssumeRolePolicySizeQuota": 2048,
"Groups": 7,
"MFADevicesInUse": 1,
"Roles": 3,
"AccountMFAEnabled": 1,
"MFADevices": 3,
"GroupsPerUserQuota": 10,
"GroupPolicySizeQuota": 5120,
"InstanceProfilesQuota": 100,
"AccessKeysPerUserQuota": 2,
"Providers": 0,
"UserPolicySizeQuota": 2048
}
}
For more information about entity limitations, see IAM and Amazon STS quotas in the Amazon IAM User Guide.
- PowerShell
-
- Tools for PowerShell
-
Example 1: This example returns information about the current IAM entity usage and current IAM entity quotas in the Amazon Web Services account.
Get-IAMAccountSummary
Output:
Key Value
Users 7
GroupPolicySizeQuota 5120
PolicyVersionsInUseQuota 10000
ServerCertificatesQuota 20
AccountSigningCertificatesPresent 0
AccountAccessKeysPresent 0
Groups 3
UsersQuota 5000
RolePolicySizeQuota 10240
UserPolicySizeQuota 2048
GroupsPerUserQuota 10
AssumeRolePolicySizeQuota 2048
AttachedPoliciesPerGroupQuota 2
Roles 9
VersionsPerPolicyQuota 5
GroupsQuota 100
PolicySizeQuota 5120
Policies 5
RolesQuota 250
ServerCertificates 0
AttachedPoliciesPerRoleQuota 2
MFADevicesInUse 2
PoliciesQuota 1000
AccountMFAEnabled 1
Providers 2
InstanceProfilesQuota 100
MFADevices 4
AccessKeysPerUserQuota 2
AttachedPoliciesPerUserQuota 2
SigningCertificatesPerUserQuota 2
PolicyVersionsInUse 4
InstanceProfiles 1
...
- Python
-
- SDK for Python (Boto3)
-
def get_summary():
"""
Gets a summary of account usage.
:return: The summary of account usage.
"""
try:
summary = iam.AccountSummary()
logger.debug(summary.summary_map)
except ClientError:
logger.exception("Couldn't get a summary for your account.")
raise
else:
return summary.summary_map
For a complete list of Amazon SDK developer guides and code examples, see
Using this service with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.