How do I troubleshoot the “ConstraintViolationException” error when I close AWS member accounts in my organization?

2 minute read
0

When I try to close an account in my organization, I receive a “ConstraintViolationException” error and a message about my account quota.

Short description

If you closed AWS accounts in your organization within the last 30 days but can't close another account, then you might get the following error:

"ConstraintViolationException - You have exceeded close account quota for the past 30 days."

This error occurs when you try to close a number of accounts that exceeds the quota.

AWS has an account closure quota that limits the number of accounts that you can close within a given time frame.

Resolution

By default, you can close only 10% of the total member accounts in your organization within 30 days. This quota has a minimum of 10 and a maximum of 1000 active account closures. This is a hard limit, and you can't increase it.

The quota's time frame starts when you close an account and isn't restricted to a calendar month. After 30 days from the initial account closure, you can close additional accounts.

Check account closure status

To check the status of an account closure request, use one of the following methods:

Use the DescribeAccount API

To retrieve information about an AWS Organizations account, use the DescribeAccount API. For the AccountId parameter, use the account ID that you sent in the CloseAccount request.

Check the Status element in the response. When the account closure request is in progress, this status is PENDING_CLOSURE. When the request completes, the status changes to SUSPENDED.

Monitor the CloudTrail event

Check the AWS CloudTrail log for the CloseAccountResult event. CloudTrail publishes this event after the account closes successfully. For more information, see Logging AWS Organizations API calls with AWS CloudTrail.

Additional considerations

To avoid confusion when you try to close an AWS account, keep the following points in mind:

  • You can close an account in AWS Organizations only after you turn on all features.
  • The Close Account action operates asynchronously from other processes. You might receive a successful completion message even if the account closure is still in progress. In this case, wait a few minutes for the account to fully close.

Related information

CloseAccount

Considerations before closing a member account

AWS OFFICIAL
AWS OFFICIALUpdated a year ago