How to get the maximum number of AWS accounts in an organization?

0

Hi, I would like to be able to programmaticly find the value of the account t limit in an AWS Organization and send a notification or alert lets say when reaching 90% of the max account quota.

Is this account limit number exposed in any way for instance in an api?

Best regards,

Jonas

Jonas
已提问 1 年前499 查看次数
2 回答
0

Hi, and thank you for the answer.

I can get a list of accounts with list_accounts with the following command:

aws organizations list-accounts

However to use the GetServiceQuota API I believe I need to send ServiceCode and QuotaCode like this:

aws service-quotas get-service-quota --service-code dynamodb --quota-code <code>

I thought I could find i.e ServiceCode with following command, but it didn't return any info for organization accounts:

aws service-quotas list-services

It did return a long list of information of other services, though.

Jonas

Jonas
已回答 1 年前
  • This likely because you are at the default quota of 10. In that case you use the list-aws-default-service-quotas command.

    example: aws service-quotas list-aws-default-service-quotas --service-code organizations --query "Quotas[?contains(QuotaCode, 'L-29A0C5DF')]"

  • Hi,

    We have increased the quota from 10 to 50, so I guess something should have showed up.

    list-aws-default-service-quotas does return quotas for service-code organizations, but list-service-quotas does not:

    aws service-quotas list-aws-default-service-quotas --service-code organizations --query "Quotas[?contains(QuotaCode, 'L-29A0C5DF')]" --region us-east-1
    [ { "ServiceCode": "organizations", "ServiceName": "AWS Organizations", "QuotaArn": "arn:aws:servicequotas:::organizations/L-29A0C5DF", "QuotaCode": "L-29A0C5DF", "QuotaName": "Default maximum number of accounts", "Value": 10.0, "Unit": "None", "Adjustable": true, "GlobalQuota": true } ]

    aws service-quotas list-service-quotas --service-code organizations --region us-east-1

    { "Quotas": [] }

0

Hi THere

You can use the GetServiceQuota API . You can take the "Value" output and compare it to the number of accounts in your org. You can use the list_accounts API to get a count.

profile pictureAWS
专家
Matt-B
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则