Skip to content

Commit 00e2222

Browse files
author
awstools
committed
feat(client-organizations): This release adds the INVALID_PAYMENT_INSTRUMENT as a fail reason and an error message.
1 parent e04ca4d commit 00e2222

File tree

4 files changed

+201
-13
lines changed

4 files changed

+201
-13
lines changed

clients/client-organizations/src/Organizations.ts

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,53 @@ export class Organizations extends OrganizationsClient {
475475
}
476476

477477
/**
478-
* <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>
478+
* <p>Closes an Amazon Web Services member account within an organization. You can't close the management
479+
* account with this API. This is an asynchronous request that Amazon Web Services performs in the
480+
* background. Because <code>CloseAccount</code> operates asynchronously, it can return a
481+
* successful completion message even though account closure might still be in progress.
482+
* You need to wait a few minutes before the account is fully closed. To check the status
483+
* of the request, do one of the following:</p>
484+
* <ul>
485+
* <li>
486+
* <p>Use the <code>AccountId</code> that you sent in the <code>CloseAccount</code>
487+
* request to provide as a parameter to the <a>DescribeAccount</a>
488+
* operation. </p>
489+
* <p>While the close account request is in progress, Account status will indicate
490+
* PENDING_CLOSURE. When the close account request completes, the status will
491+
* change to SUSPENDED. </p>
492+
* </li>
493+
* <li>
494+
* <p>Check the CloudTrail log for the <code>CloseAccountResult</code> event that gets
495+
* published after the account closes successfully. For information on using CloudTrail
496+
* 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
497+
* <i>Organizations User Guide.</i>
498+
* </p>
499+
* </li>
500+
* </ul>
501+
* <note>
502+
* <ul>
503+
* <li>
504+
* <p>You can only close 10% of active member accounts within a rolling 30 day
505+
* period. This quota is not bound by a calendar month, but starts when you
506+
* close an account. Within 30 days of that initial account closure, you can't
507+
* exceed the 10% account closure limit.</p>
508+
* </li>
509+
* <li>
510+
* <p>To reinstate a closed account, contact Amazon Web Services Support within the 90-day
511+
* grace period while the account is in SUSPENDED status. </p>
512+
* </li>
513+
* <li>
514+
* <p>If the Amazon Web Services account you attempt to close is linked to an Amazon Web Services GovCloud (US)
515+
* account, the <code>CloseAccount</code> request will close both accounts. To
516+
* learn important pre-closure details, see <a href="https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/Closing-govcloud-account.html">
517+
* Closing an Amazon Web Services GovCloud (US) account</a> in the <i>
518+
* Amazon Web Services GovCloud User Guide</i>.</p>
519+
* </li>
520+
* </ul>
521+
* </note>
522+
* <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
523+
* Amazon Web Services account</a> in the <i>Organizations User Guide.</i>
524+
* </p>
479525
*/
480526
public closeAccount(
481527
args: CloseAccountCommandInput,

clients/client-organizations/src/commands/CloseAccountCommand.ts

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,53 @@ export interface CloseAccountCommandInput extends CloseAccountRequest {}
2222
export interface CloseAccountCommandOutput extends __MetadataBearer {}
2323

2424
/**
25-
* <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>
25+
* <p>Closes an Amazon Web Services member account within an organization. You can't close the management
26+
* account with this API. This is an asynchronous request that Amazon Web Services performs in the
27+
* background. Because <code>CloseAccount</code> operates asynchronously, it can return a
28+
* successful completion message even though account closure might still be in progress.
29+
* You need to wait a few minutes before the account is fully closed. To check the status
30+
* of the request, do one of the following:</p>
31+
* <ul>
32+
* <li>
33+
* <p>Use the <code>AccountId</code> that you sent in the <code>CloseAccount</code>
34+
* request to provide as a parameter to the <a>DescribeAccount</a>
35+
* operation. </p>
36+
* <p>While the close account request is in progress, Account status will indicate
37+
* PENDING_CLOSURE. When the close account request completes, the status will
38+
* change to SUSPENDED. </p>
39+
* </li>
40+
* <li>
41+
* <p>Check the CloudTrail log for the <code>CloseAccountResult</code> event that gets
42+
* published after the account closes successfully. For information on using CloudTrail
43+
* 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
44+
* <i>Organizations User Guide.</i>
45+
* </p>
46+
* </li>
47+
* </ul>
48+
* <note>
49+
* <ul>
50+
* <li>
51+
* <p>You can only close 10% of active member accounts within a rolling 30 day
52+
* period. This quota is not bound by a calendar month, but starts when you
53+
* close an account. Within 30 days of that initial account closure, you can't
54+
* exceed the 10% account closure limit.</p>
55+
* </li>
56+
* <li>
57+
* <p>To reinstate a closed account, contact Amazon Web Services Support within the 90-day
58+
* grace period while the account is in SUSPENDED status. </p>
59+
* </li>
60+
* <li>
61+
* <p>If the Amazon Web Services account you attempt to close is linked to an Amazon Web Services GovCloud (US)
62+
* account, the <code>CloseAccount</code> request will close both accounts. To
63+
* learn important pre-closure details, see <a href="https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/Closing-govcloud-account.html">
64+
* Closing an Amazon Web Services GovCloud (US) account</a> in the <i>
65+
* Amazon Web Services GovCloud User Guide</i>.</p>
66+
* </li>
67+
* </ul>
68+
* </note>
69+
* <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
70+
* Amazon Web Services account</a> in the <i>Organizations User Guide.</i>
71+
* </p>
2672
* @example
2773
* Use a bare-bones client and the command you need to make an API call.
2874
* ```javascript

clients/client-organizations/src/models/models_0.ts

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ export enum ConstraintViolationExceptionReason {
805805
DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE = "DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE",
806806
EMAIL_VERIFICATION_CODE_EXPIRED = "EMAIL_VERIFICATION_CODE_EXPIRED",
807807
HANDSHAKE_RATE_LIMIT_EXCEEDED = "HANDSHAKE_RATE_LIMIT_EXCEEDED",
808+
INVALID_PAYMENT_INSTRUMENT = "INVALID_PAYMENT_INSTRUMENT",
808809
MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE = "MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE",
809810
MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE = "MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE",
810811
MASTER_ACCOUNT_MISSING_CONTACT_INFO = "MASTER_ACCOUNT_MISSING_CONTACT_INFO",
@@ -877,12 +878,26 @@ export enum ConstraintViolationExceptionReason {
877878
* delegated administrator.</p>
878879
* </li>
879880
* <li>
881+
* <p>CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management
882+
* account. To close the management account for the organization, you must first
883+
* either remove or close all member accounts in the organization. Follow standard
884+
* account closure process using root credentials.​ </p>
885+
* </li>
886+
* <li>
880887
* <p>CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove an
881888
* account that is registered as a delegated administrator for a service integrated
882889
* with your organization. To complete this operation, you must first deregister
883890
* this account as a delegated administrator. </p>
884891
* </li>
885892
* <li>
893+
* <p>CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota for the
894+
* past 30 days. </p>
895+
* </li>
896+
* <li>
897+
* <p>CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number of
898+
* accounts that you can close at a time. ​ </p>
899+
* </li>
900+
* <li>
886901
* <p>CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an
887902
* organization in the specified region, you must enable all features mode.</p>
888903
* </li>
@@ -902,6 +917,13 @@ export enum ConstraintViolationExceptionReason {
902917
* handshakes that you can send in one day.</p>
903918
* </li>
904919
* <li>
920+
* <p>INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no supported
921+
* payment method is associated with the account. Amazon Web Services does not support cards
922+
* issued by financial institutions in Russia or Belarus. For more information, see
923+
* <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html">Managing your
924+
* Amazon Web Services payments</a>.</p>
925+
* </li>
926+
* <li>
905927
* <p>MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account in
906928
* this organization, you first must migrate the organization's management account
907929
* to the marketplace that corresponds to the management account's address. For
@@ -984,8 +1006,8 @@ export enum ConstraintViolationExceptionReason {
9841006
* </li>
9851007
* <li>
9861008
* <p>SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated
987-
* administrator before you enabled service access. Call the <code>EnableAWSServiceAccess</code> API
988-
* first.</p>
1009+
* administrator before you enabled service access. Call the
1010+
* <code>EnableAWSServiceAccess</code> API first.</p>
9891011
* </li>
9901012
* <li>
9911013
* <p>TAG_POLICY_VIOLATION: You attempted to create or update a resource with tags
@@ -1171,7 +1193,8 @@ export namespace CancelHandshakeRequest {
11711193

11721194
export interface CloseAccountRequest {
11731195
/**
1174-
* <p>Retrieves the Amazon Web Services account Id for the current <code>CloseAccount</code> API request. </p>
1196+
* <p>Retrieves the Amazon Web Services account Id for the current <code>CloseAccount</code> API request.
1197+
* </p>
11751198
*/
11761199
AccountId: string | undefined;
11771200
}
@@ -1186,7 +1209,8 @@ export namespace CloseAccountRequest {
11861209
}
11871210

11881211
/**
1189-
* <p>The request failed because it conflicts with the current state of the specified resource.</p>
1212+
* <p>The request failed because it conflicts with the current state of the specified
1213+
* resource.</p>
11901214
*/
11911215
export class ConflictException extends __BaseException {
11921216
readonly name: "ConflictException" = "ConflictException";
@@ -1375,6 +1399,7 @@ export enum CreateAccountFailureReason {
13751399
INVALID_ADDRESS = "INVALID_ADDRESS",
13761400
INVALID_EMAIL = "INVALID_EMAIL",
13771401
INVALID_IDENTITY_FOR_BUSINESS_VALIDATION = "INVALID_IDENTITY_FOR_BUSINESS_VALIDATION",
1402+
INVALID_PAYMENT_INSTRUMENT = "INVALID_PAYMENT_INSTRUMENT",
13781403
MISSING_BUSINESS_VALIDATION = "MISSING_BUSINESS_VALIDATION",
13791404
MISSING_PAYMENT_INSTRUMENT = "MISSING_PAYMENT_INSTRUMENT",
13801405
PENDING_BUSINESS_VALIDATIONv = "PENDING_BUSINESS_VALIDATION",
@@ -1473,6 +1498,13 @@ export interface CreateAccountStatus {
14731498
* provided is not valid.</p>
14741499
* </li>
14751500
* <li>
1501+
* <p>INVALID_PAYMENT_INSTRUMENT: The Amazon Web Services account that owns your organization does
1502+
* not have a supported payment method associated with the account. Amazon Web Services does not
1503+
* support cards issued by financial institutions in Russia or Belarus. For more
1504+
* information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html">Managing your
1505+
* Amazon Web Services payments</a>.</p>
1506+
* </li>
1507+
* <li>
14761508
* <p>INTERNAL_FAILURE: The account could not be created because of an internal
14771509
* failure. Try again later. If the problem persists, contact Amazon Web Services Customer
14781510
* Support.</p>
@@ -1601,7 +1633,9 @@ export interface CreateGovCloudAccountRequest {
16011633
Email: string | undefined;
16021634

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

0 commit comments

Comments
 (0)