close_account(**kwargs)¶Closes an Amazon Web Services member account within an organization. You can close an account when all features are enabled. You can't close the management account with this API. This is an asynchronous request that Amazon Web Services performs in the background. Because CloseAccount operates asynchronously, it can return a successful completion message even though account closure might still be in progress. You need to wait a few minutes before the account is fully closed. To check the status of the request, do one of the following:
AccountId that you sent in the CloseAccount request to provide as a parameter to the DescribeAccount operation. While the close account request is in progress, Account status will indicate PENDING_CLOSURE. When the close account request completes, the status will change to SUSPENDED.CloseAccountResult event that gets published after the account closes successfully. For information on using CloudTrail with Organizations, see Logging and monitoring in Organizations in the Organizations User Guide.Note
CloseAccount request will close both accounts. To learn important pre-closure details, see Closing an Amazon Web Services GovCloud (US) account in the Amazon Web Services GovCloud User Guide .For more information about closing accounts, see Closing an Amazon Web Services account in the Organizations User Guide.
See also: AWS API Documentation
Request Syntax
response = client.close_account(
AccountId='string'
)
[REQUIRED]
Retrieves the Amazon Web Services account Id for the current CloseAccount API request.
Exceptions
Organizations.Client.exceptions.AccessDeniedExceptionOrganizations.Client.exceptions.AccountAlreadyClosedExceptionOrganizations.Client.exceptions.AccountNotFoundExceptionOrganizations.Client.exceptions.AWSOrganizationsNotInUseExceptionOrganizations.Client.exceptions.ConcurrentModificationExceptionOrganizations.Client.exceptions.ConflictExceptionOrganizations.Client.exceptions.ConstraintViolationExceptionOrganizations.Client.exceptions.InvalidInputExceptionOrganizations.Client.exceptions.ServiceExceptionOrganizations.Client.exceptions.TooManyRequestsExceptionOrganizations.Client.exceptions.UnsupportedAPIEndpointException