Skip to content

Commit

Permalink
feat(client-organizations): This release adds the INVALID_PAYMENT_INS…
Browse files Browse the repository at this point in the history
…TRUMENT as a fail reason and an error message.
  • Loading branch information
awstools committed May 2, 2022
1 parent e04ca4d commit 00e2222
Show file tree
Hide file tree
Showing 4 changed files with 201 additions and 13 deletions.
48 changes: 47 additions & 1 deletion clients/client-organizations/src/Organizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,53 @@ export class Organizations extends OrganizationsClient {
}

/**
* <p>Closes an Amazon Web Services account that is now a part of an Organizations, either created within the organization, or invited to join the organization.</p>
* <p>Closes an Amazon Web Services member account within an organization. You can't close the management
* account with this API. This is an asynchronous request that Amazon Web Services performs in the
* background. Because <code>CloseAccount</code> 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:</p>
* <ul>
* <li>
* <p>Use the <code>AccountId</code> that you sent in the <code>CloseAccount</code>
* request to provide as a parameter to the <a>DescribeAccount</a>
* operation. </p>
* <p>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. </p>
* </li>
* <li>
* <p>Check the CloudTrail log for the <code>CloseAccountResult</code> event that gets
* published after the account closes successfully. For information on using CloudTrail
* with Organizations, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html#orgs_cloudtrail-integration">Logging and monitoring in Organizations</a> in the
* <i>Organizations User Guide.</i>
* </p>
* </li>
* </ul>
* <note>
* <ul>
* <li>
* <p>You can only close 10% of active member accounts within a rolling 30 day
* period. This quota is not bound by a calendar month, but starts when you
* close an account. Within 30 days of that initial account closure, you can't
* exceed the 10% account closure limit.</p>
* </li>
* <li>
* <p>To reinstate a closed account, contact Amazon Web Services Support within the 90-day
* grace period while the account is in SUSPENDED status. </p>
* </li>
* <li>
* <p>If the Amazon Web Services account you attempt to close is linked to an Amazon Web Services GovCloud (US)
* account, the <code>CloseAccount</code> request will close both accounts. To
* learn important pre-closure details, see <a href="https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/Closing-govcloud-account.html">
* Closing an Amazon Web Services GovCloud (US) account</a> in the <i>
* Amazon Web Services GovCloud User Guide</i>.</p>
* </li>
* </ul>
* </note>
* <p>For more information about closing accounts, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html">Closing an
* Amazon Web Services account</a> in the <i>Organizations User Guide.</i>
* </p>
*/
public closeAccount(
args: CloseAccountCommandInput,
Expand Down
48 changes: 47 additions & 1 deletion clients/client-organizations/src/commands/CloseAccountCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,53 @@ export interface CloseAccountCommandInput extends CloseAccountRequest {}
export interface CloseAccountCommandOutput extends __MetadataBearer {}

/**
* <p>Closes an Amazon Web Services account that is now a part of an Organizations, either created within the organization, or invited to join the organization.</p>
* <p>Closes an Amazon Web Services member account within an organization. You can't close the management
* account with this API. This is an asynchronous request that Amazon Web Services performs in the
* background. Because <code>CloseAccount</code> 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:</p>
* <ul>
* <li>
* <p>Use the <code>AccountId</code> that you sent in the <code>CloseAccount</code>
* request to provide as a parameter to the <a>DescribeAccount</a>
* operation. </p>
* <p>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. </p>
* </li>
* <li>
* <p>Check the CloudTrail log for the <code>CloseAccountResult</code> event that gets
* published after the account closes successfully. For information on using CloudTrail
* with Organizations, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html#orgs_cloudtrail-integration">Logging and monitoring in Organizations</a> in the
* <i>Organizations User Guide.</i>
* </p>
* </li>
* </ul>
* <note>
* <ul>
* <li>
* <p>You can only close 10% of active member accounts within a rolling 30 day
* period. This quota is not bound by a calendar month, but starts when you
* close an account. Within 30 days of that initial account closure, you can't
* exceed the 10% account closure limit.</p>
* </li>
* <li>
* <p>To reinstate a closed account, contact Amazon Web Services Support within the 90-day
* grace period while the account is in SUSPENDED status. </p>
* </li>
* <li>
* <p>If the Amazon Web Services account you attempt to close is linked to an Amazon Web Services GovCloud (US)
* account, the <code>CloseAccount</code> request will close both accounts. To
* learn important pre-closure details, see <a href="https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/Closing-govcloud-account.html">
* Closing an Amazon Web Services GovCloud (US) account</a> in the <i>
* Amazon Web Services GovCloud User Guide</i>.</p>
* </li>
* </ul>
* </note>
* <p>For more information about closing accounts, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html">Closing an
* Amazon Web Services account</a> in the <i>Organizations User Guide.</i>
* </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
44 changes: 39 additions & 5 deletions clients/client-organizations/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,7 @@ export enum ConstraintViolationExceptionReason {
DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE = "DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE",
EMAIL_VERIFICATION_CODE_EXPIRED = "EMAIL_VERIFICATION_CODE_EXPIRED",
HANDSHAKE_RATE_LIMIT_EXCEEDED = "HANDSHAKE_RATE_LIMIT_EXCEEDED",
INVALID_PAYMENT_INSTRUMENT = "INVALID_PAYMENT_INSTRUMENT",
MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE = "MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE",
MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE = "MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE",
MASTER_ACCOUNT_MISSING_CONTACT_INFO = "MASTER_ACCOUNT_MISSING_CONTACT_INFO",
Expand Down Expand Up @@ -877,12 +878,26 @@ export enum ConstraintViolationExceptionReason {
* delegated administrator.</p>
* </li>
* <li>
* <p>CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management
* account. To close the management account for the organization, you must first
* either remove or close all member accounts in the organization. Follow standard
* account closure process using root credentials.​ </p>
* </li>
* <li>
* <p>CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove an
* account that is registered as a delegated administrator for a service integrated
* with your organization. To complete this operation, you must first deregister
* this account as a delegated administrator. </p>
* </li>
* <li>
* <p>CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota for the
* past 30 days. </p>
* </li>
* <li>
* <p>CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number of
* accounts that you can close at a time. ​ </p>
* </li>
* <li>
* <p>CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an
* organization in the specified region, you must enable all features mode.</p>
* </li>
Expand All @@ -902,6 +917,13 @@ export enum ConstraintViolationExceptionReason {
* handshakes that you can send in one day.</p>
* </li>
* <li>
* <p>INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no supported
* payment method is associated with the account. Amazon Web Services does not support cards
* issued by financial institutions in Russia or Belarus. For more information, see
* <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html">Managing your
* Amazon Web Services payments</a>.</p>
* </li>
* <li>
* <p>MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account in
* this organization, you first must migrate the organization's management account
* to the marketplace that corresponds to the management account's address. For
Expand Down Expand Up @@ -984,8 +1006,8 @@ export enum ConstraintViolationExceptionReason {
* </li>
* <li>
* <p>SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated
* administrator before you enabled service access. Call the <code>EnableAWSServiceAccess</code> API
* first.</p>
* administrator before you enabled service access. Call the
* <code>EnableAWSServiceAccess</code> API first.</p>
* </li>
* <li>
* <p>TAG_POLICY_VIOLATION: You attempted to create or update a resource with tags
Expand Down Expand Up @@ -1171,7 +1193,8 @@ export namespace CancelHandshakeRequest {

export interface CloseAccountRequest {
/**
* <p>Retrieves the Amazon Web Services account Id for the current <code>CloseAccount</code> API request. </p>
* <p>Retrieves the Amazon Web Services account Id for the current <code>CloseAccount</code> API request.
* </p>
*/
AccountId: string | undefined;
}
Expand All @@ -1186,7 +1209,8 @@ export namespace CloseAccountRequest {
}

/**
* <p>The request failed because it conflicts with the current state of the specified resource.</p>
* <p>The request failed because it conflicts with the current state of the specified
* resource.</p>
*/
export class ConflictException extends __BaseException {
readonly name: "ConflictException" = "ConflictException";
Expand Down Expand Up @@ -1375,6 +1399,7 @@ export enum CreateAccountFailureReason {
INVALID_ADDRESS = "INVALID_ADDRESS",
INVALID_EMAIL = "INVALID_EMAIL",
INVALID_IDENTITY_FOR_BUSINESS_VALIDATION = "INVALID_IDENTITY_FOR_BUSINESS_VALIDATION",
INVALID_PAYMENT_INSTRUMENT = "INVALID_PAYMENT_INSTRUMENT",
MISSING_BUSINESS_VALIDATION = "MISSING_BUSINESS_VALIDATION",
MISSING_PAYMENT_INSTRUMENT = "MISSING_PAYMENT_INSTRUMENT",
PENDING_BUSINESS_VALIDATIONv = "PENDING_BUSINESS_VALIDATION",
Expand Down Expand Up @@ -1473,6 +1498,13 @@ export interface CreateAccountStatus {
* provided is not valid.</p>
* </li>
* <li>
* <p>INVALID_PAYMENT_INSTRUMENT: The Amazon Web Services account that owns your organization does
* not have a supported payment method associated with the account. Amazon Web Services does not
* support cards issued by financial institutions in Russia or Belarus. For more
* information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html">Managing your
* Amazon Web Services payments</a>.</p>
* </li>
* <li>
* <p>INTERNAL_FAILURE: The account could not be created because of an internal
* failure. Try again later. If the problem persists, contact Amazon Web Services Customer
* Support.</p>
Expand Down Expand Up @@ -1601,7 +1633,9 @@ export interface CreateGovCloudAccountRequest {
Email: string | undefined;

/**
* <p>The friendly name of the member account.</p>
* <p>The friendly name of the member account. </p>
* <p>The account name can consist of only the characters [a-z],[A-Z],[0-9], hyphen (-), or
* dot (.) You can't separate characters with a dash (–).</p>
*/
AccountName: string | undefined;

Expand Down
Loading

0 comments on commit 00e2222

Please sign in to comment.