AWS Organizations

2017/05/11 - AWS Organizations - 6 updated api methods

Changes  Update organizations client to latest version

CreateAccount (updated) Link ¶
Changes (response)
{'CreateAccountStatus': {'FailureReason': {'INVALID_EMAIL'}}}

Creates an AWS account that is automatically a member of the organization whose credentials made the request. This is an asynchronous request that AWS performs in the background. If you want to check the status of the request later, you need the OperationId response element from this operation to provide as a parameter to the DescribeCreateAccountStatus operation.

AWS Organizations preconfigures the new member account with a role (named OrganizationAccountAccessRole by default) that grants administrator permissions to the new account. Principals in the master account can assume the role. AWS Organizations clones the company name and address information for the new account from the organization's master account.

For more information about creating accounts, see Creating an AWS Account in Your Organization in the AWS Organizations User Guide.

This operation can be called only from the organization's master account.

See also: AWS API Documentation

Request Syntax

client.create_account(
    Email='string',
    AccountName='string',
    RoleName='string',
    IamUserAccessToBilling='ALLOW'|'DENY'
)
type Email:

string

param Email:

[REQUIRED]

The email address of the owner to assign to the new member account. This email address must not already be associated with another AWS account.

type AccountName:

string

param AccountName:

[REQUIRED]

The friendly name of the member account.

type RoleName:

string

param RoleName:

(Optional)

The name of an IAM role that Organizations automatically preconfigures in the new member account. This role trusts the master account, allowing users in the master account to assume the role, as permitted by the master account administrator. The role has administrator permissions in the new member account.

If you do not specify this parameter, the role name defaults to OrganizationAccountAccessRole.

For more information about how to use this role to access the member account, see Accessing and Administering the Member Accounts in Your Organization in the AWS Organizations User Guide, and steps 2 and 3 in Tutorial: Delegate Access Across AWS Accounts Using IAM Roles in the IAM User Guide.

The regex pattern that is used to validate this parameter is a string of characters that can consist of uppercase letters, lowercase letters, digits with no spaces, and any of the following characters: =,.@-

type IamUserAccessToBilling:

string

param IamUserAccessToBilling:

If set to ALLOW, the new account enables IAM users to access account billing information if they have the required permissions. If set to DENY, then only the root user of the new account can access account billing information. For more information, see Activating Access to the Billing and Cost Management Console in the AWS Billing and Cost Management User Guide.

If you do not specify this parameter, the value defaults to ALLOW, and IAM users and roles with the required permissions can access billing information for the new account.

rtype:

dict

returns:

Response Syntax

{
    'CreateAccountStatus': {
        'Id': 'string',
        'AccountName': 'string',
        'State': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED',
        'RequestedTimestamp': datetime(2015, 1, 1),
        'CompletedTimestamp': datetime(2015, 1, 1),
        'AccountId': 'string',
        'FailureReason': 'ACCOUNT_LIMIT_EXCEEDED'|'EMAIL_ALREADY_EXISTS'|'INVALID_ADDRESS'|'INVALID_EMAIL'|'INTERNAL_FAILURE'
    }
}

Response Structure

  • (dict) --

    • CreateAccountStatus (dict) --

      A structure that contains details about the request to create an account. This response structure might not be fully populated when you first receive it because account creation is an asynchronous process. You can pass the returned CreateAccountStatus ID as a parameter to DescribeCreateAccountStatus to get status about the progress of the request at later times.

      • Id (string) --

        The unique identifier (ID) that references this request. You get this value from the response of the initial CreateAccount request to create the account.

        The regex pattern for an create account request ID string requires "car-" followed by from 8 to 32 lower-case letters or digits.

      • AccountName (string) --

        The account name given to the account when it was created.

      • State (string) --

        The status of the request.

      • RequestedTimestamp (datetime) --

        The date and time that the request was made for the account creation.

      • CompletedTimestamp (datetime) --

        The date and time that the account was created and the request completed.

      • AccountId (string) --

        If the account was created successfully, the unique identifier (ID) of the new account.

        The regex pattern for an account ID string requires exactly 12 digits.

      • FailureReason (string) --

        If the request failed, a description of the reason for the failure.

        • ACCOUNT_LIMIT_EXCEEDED: The account could not be created because you have reached the limit on the number of accounts in your organization.

        • EMAIL_ALREADY_EXISTS: The account could not be created because another AWS account with that email address already exists.

        • INVALID_ADDRESS: The account could not be created because the address you provided is not valid.

        • INVALID_EMAIL: The account could not be created because the email address you provided is not valid.

        • INTERNAL_FAILURE: The account could not be created because of an internal failure. Try again later. If the problem persists, contact Customer Support.

DescribeAccount (updated) Link ¶
Changes (response)
{'Account': {'Email': 'string'}}

Retrieves Organizations-related information about the specified account.

This operation can be called only from the organization's master account.

See also: AWS API Documentation

Request Syntax

client.describe_account(
    AccountId='string'
)
type AccountId:

string

param AccountId:

[REQUIRED]

The unique identifier (ID) of the AWS account that you want information about. You can get the ID from the ListAccounts or ListAccountsForParent operations.

The regex pattern for an account ID string requires exactly 12 digits.

rtype:

dict

returns:

Response Syntax

{
    'Account': {
        'Id': 'string',
        'Arn': 'string',
        'Email': 'string',
        'Name': 'string',
        'Status': 'ACTIVE'|'SUSPENDED',
        'JoinedMethod': 'INVITED'|'CREATED',
        'JoinedTimestamp': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • Account (dict) --

      A structure that contains information about the requested account.

      • Id (string) --

        The unique identifier (ID) of the account.

        The regex pattern for an account ID string requires exactly 12 digits.

      • Arn (string) --

        The Amazon Resource Name (ARN) of the account.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide.

      • Email (string) --

        The email address associated with the AWS account.

        The regex pattern for this parameter is a string of characters that represents a standard Internet email address.

      • Name (string) --

        The friendly name of the account.

        The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

      • Status (string) --

        The status of the account in the organization.

      • JoinedMethod (string) --

        The method by which the account joined the organization.

      • JoinedTimestamp (datetime) --

        The date the account became a part of the organization.

DescribeCreateAccountStatus (updated) Link ¶
Changes (response)
{'CreateAccountStatus': {'FailureReason': {'INVALID_EMAIL'}}}

Retrieves the current status of an asynchronous request to create an account.

This operation can be called only from the organization's master account.

See also: AWS API Documentation

Request Syntax

client.describe_create_account_status(
    CreateAccountRequestId='string'
)
type CreateAccountRequestId:

string

param CreateAccountRequestId:

[REQUIRED]

Specifies the operationId that uniquely identifies the request. You can get the ID from the response to an earlier CreateAccount request, or from the ListCreateAccountStatus operation.

The regex pattern for an create account request ID string requires "car-" followed by from 8 to 32 lower-case letters or digits.

rtype:

dict

returns:

Response Syntax

{
    'CreateAccountStatus': {
        'Id': 'string',
        'AccountName': 'string',
        'State': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED',
        'RequestedTimestamp': datetime(2015, 1, 1),
        'CompletedTimestamp': datetime(2015, 1, 1),
        'AccountId': 'string',
        'FailureReason': 'ACCOUNT_LIMIT_EXCEEDED'|'EMAIL_ALREADY_EXISTS'|'INVALID_ADDRESS'|'INVALID_EMAIL'|'INTERNAL_FAILURE'
    }
}

Response Structure

  • (dict) --

    • CreateAccountStatus (dict) --

      A structure that contains the current status of an account creation request.

      • Id (string) --

        The unique identifier (ID) that references this request. You get this value from the response of the initial CreateAccount request to create the account.

        The regex pattern for an create account request ID string requires "car-" followed by from 8 to 32 lower-case letters or digits.

      • AccountName (string) --

        The account name given to the account when it was created.

      • State (string) --

        The status of the request.

      • RequestedTimestamp (datetime) --

        The date and time that the request was made for the account creation.

      • CompletedTimestamp (datetime) --

        The date and time that the account was created and the request completed.

      • AccountId (string) --

        If the account was created successfully, the unique identifier (ID) of the new account.

        The regex pattern for an account ID string requires exactly 12 digits.

      • FailureReason (string) --

        If the request failed, a description of the reason for the failure.

        • ACCOUNT_LIMIT_EXCEEDED: The account could not be created because you have reached the limit on the number of accounts in your organization.

        • EMAIL_ALREADY_EXISTS: The account could not be created because another AWS account with that email address already exists.

        • INVALID_ADDRESS: The account could not be created because the address you provided is not valid.

        • INVALID_EMAIL: The account could not be created because the email address you provided is not valid.

        • INTERNAL_FAILURE: The account could not be created because of an internal failure. Try again later. If the problem persists, contact Customer Support.

ListAccounts (updated) Link ¶
Changes (response)
{'Accounts': {'Email': 'string'}}

Lists all the accounts in the organization. To request only the accounts in a root or OU, use the ListAccountsForParent operation instead.

This operation can be called only from the organization's master account.

See also: AWS API Documentation

Request Syntax

client.list_accounts(
    NextToken='string',
    MaxResults=123
)
type NextToken:

string

param NextToken:

Use this parameter if you receive a NextToken response in a previous request that indicates that there is more output available. Set it to the value of the previous call's NextToken response to indicate where the output should continue from.

type MaxResults:

integer

param MaxResults:

(Optional) Use this to limit the number of results you want included in the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the NextToken response element is present and has a value (is not null). Include that value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that Organizations might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

rtype:

dict

returns:

Response Syntax

{
    'Accounts': [
        {
            'Id': 'string',
            'Arn': 'string',
            'Email': 'string',
            'Name': 'string',
            'Status': 'ACTIVE'|'SUSPENDED',
            'JoinedMethod': 'INVITED'|'CREATED',
            'JoinedTimestamp': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Accounts (list) --

      A list of objects in the organization.

      • (dict) --

        Contains information about an AWS account that is a member of an organization.

        • Id (string) --

          The unique identifier (ID) of the account.

          The regex pattern for an account ID string requires exactly 12 digits.

        • Arn (string) --

          The Amazon Resource Name (ARN) of the account.

          For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide.

        • Email (string) --

          The email address associated with the AWS account.

          The regex pattern for this parameter is a string of characters that represents a standard Internet email address.

        • Name (string) --

          The friendly name of the account.

          The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

        • Status (string) --

          The status of the account in the organization.

        • JoinedMethod (string) --

          The method by which the account joined the organization.

        • JoinedTimestamp (datetime) --

          The date the account became a part of the organization.

    • NextToken (string) --

      If present, this value indicates that there is more output available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null.

ListAccountsForParent (updated) Link ¶
Changes (response)
{'Accounts': {'Email': 'string'}}

Lists the accounts in an organization that are contained by the specified target root or organizational unit (OU). If you specify the root, you get a list of all the accounts that are not in any OU. If you specify an OU, you get a list of all the accounts in only that OU, and not in any child OUs. To get a list of all accounts in the organization, use the ListAccounts operation.

See also: AWS API Documentation

Request Syntax

client.list_accounts_for_parent(
    ParentId='string',
    NextToken='string',
    MaxResults=123
)
type ParentId:

string

param ParentId:

[REQUIRED]

The unique identifier (ID) for the parent root or organization unit (OU) whose accounts you want to list.

type NextToken:

string

param NextToken:

Use this parameter if you receive a NextToken response in a previous request that indicates that there is more output available. Set it to the value of the previous call's NextToken response to indicate where the output should continue from.

type MaxResults:

integer

param MaxResults:

(Optional) Use this to limit the number of results you want included in the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the NextToken response element is present and has a value (is not null). Include that value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that Organizations might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

rtype:

dict

returns:

Response Syntax

{
    'Accounts': [
        {
            'Id': 'string',
            'Arn': 'string',
            'Email': 'string',
            'Name': 'string',
            'Status': 'ACTIVE'|'SUSPENDED',
            'JoinedMethod': 'INVITED'|'CREATED',
            'JoinedTimestamp': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Accounts (list) --

      A list of the accounts in the specified root or OU.

      • (dict) --

        Contains information about an AWS account that is a member of an organization.

        • Id (string) --

          The unique identifier (ID) of the account.

          The regex pattern for an account ID string requires exactly 12 digits.

        • Arn (string) --

          The Amazon Resource Name (ARN) of the account.

          For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide.

        • Email (string) --

          The email address associated with the AWS account.

          The regex pattern for this parameter is a string of characters that represents a standard Internet email address.

        • Name (string) --

          The friendly name of the account.

          The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

        • Status (string) --

          The status of the account in the organization.

        • JoinedMethod (string) --

          The method by which the account joined the organization.

        • JoinedTimestamp (datetime) --

          The date the account became a part of the organization.

    • NextToken (string) --

      If present, this value indicates that there is more output available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null.

ListCreateAccountStatus (updated) Link ¶
Changes (response)
{'CreateAccountStatuses': {'FailureReason': {'INVALID_EMAIL'}}}

Lists the account creation requests that match the specified status that is currently being tracked for the organization.

This operation can be called only from the organization's master account.

See also: AWS API Documentation

Request Syntax

client.list_create_account_status(
    States=[
        'IN_PROGRESS'|'SUCCEEDED'|'FAILED',
    ],
    NextToken='string',
    MaxResults=123
)
type States:

list

param States:

A list of one or more states that you want included in the response. If this parameter is not present, then all requests are included in the response.

  • (string) --

type NextToken:

string

param NextToken:

Use this parameter if you receive a NextToken response in a previous request that indicates that there is more output available. Set it to the value of the previous call's NextToken response to indicate where the output should continue from.

type MaxResults:

integer

param MaxResults:

(Optional) Use this to limit the number of results you want included in the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the NextToken response element is present and has a value (is not null). Include that value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that Organizations might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

rtype:

dict

returns:

Response Syntax

{
    'CreateAccountStatuses': [
        {
            'Id': 'string',
            'AccountName': 'string',
            'State': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED',
            'RequestedTimestamp': datetime(2015, 1, 1),
            'CompletedTimestamp': datetime(2015, 1, 1),
            'AccountId': 'string',
            'FailureReason': 'ACCOUNT_LIMIT_EXCEEDED'|'EMAIL_ALREADY_EXISTS'|'INVALID_ADDRESS'|'INVALID_EMAIL'|'INTERNAL_FAILURE'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • CreateAccountStatuses (list) --

      A list of objects with details about the requests. Certain elements, such as the accountId number, are present in the output only after the account has been successfully created.

      • (dict) --

        Contains the status about a CreateAccount request to create an AWS account in an organization.

        • Id (string) --

          The unique identifier (ID) that references this request. You get this value from the response of the initial CreateAccount request to create the account.

          The regex pattern for an create account request ID string requires "car-" followed by from 8 to 32 lower-case letters or digits.

        • AccountName (string) --

          The account name given to the account when it was created.

        • State (string) --

          The status of the request.

        • RequestedTimestamp (datetime) --

          The date and time that the request was made for the account creation.

        • CompletedTimestamp (datetime) --

          The date and time that the account was created and the request completed.

        • AccountId (string) --

          If the account was created successfully, the unique identifier (ID) of the new account.

          The regex pattern for an account ID string requires exactly 12 digits.

        • FailureReason (string) --

          If the request failed, a description of the reason for the failure.

          • ACCOUNT_LIMIT_EXCEEDED: The account could not be created because you have reached the limit on the number of accounts in your organization.

          • EMAIL_ALREADY_EXISTS: The account could not be created because another AWS account with that email address already exists.

          • INVALID_ADDRESS: The account could not be created because the address you provided is not valid.

          • INVALID_EMAIL: The account could not be created because the email address you provided is not valid.

          • INTERNAL_FAILURE: The account could not be created because of an internal failure. Try again later. If the problem persists, contact Customer Support.

    • NextToken (string) --

      If present, this value indicates that there is more output available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null.