ComputeOptimizerAutomation / Client / associate_accounts

associate_accounts

ComputeOptimizerAutomation.Client.associate_accounts(**kwargs)

Associates one or more member accounts with your organization’s management account, enabling centralized implementation of optimization actions across those accounts. Once associated, the management account (or a delegated administrator) can apply recommended actions to the member account. When you associate a member account, its organization rule mode is automatically set to “Any allowed,” which permits the management account to create Automation rules that automatically apply actions to that account. If the member account has not previously enabled the Automation feature, the association process automatically enables it.

Note

Only the management account or a delegated administrator can perform this action.

See also: AWS API Documentation

Request Syntax

response = client.associate_accounts(
    accountIds=[
        'string',
    ],
    clientToken='string'
)
Parameters:
  • accountIds (list) –

    [REQUIRED]

    The IDs of the member accounts to associate. You can specify up to 50 account IDs.

    • (string) –

  • clientToken (string) –

    A unique identifier to ensure idempotency of the request. Valid for 24 hours after creation.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'accountIds': [
        'string',
    ],
    'errors': [
        'string',
    ]
}

Response Structure

  • (dict) –

    • accountIds (list) –

      The IDs of the member accounts that were successfully associated.

      • (string) –

    • errors (list) –

      Any errors that occurred during the association process.

      • (string) –

Exceptions

  • ComputeOptimizerAutomation.Client.exceptions.InvalidParameterValueException

  • ComputeOptimizerAutomation.Client.exceptions.ForbiddenException

  • ComputeOptimizerAutomation.Client.exceptions.OptInRequiredException

  • ComputeOptimizerAutomation.Client.exceptions.IdempotentParameterMismatchException

  • ComputeOptimizerAutomation.Client.exceptions.ThrottlingException

  • ComputeOptimizerAutomation.Client.exceptions.AccessDeniedException

  • ComputeOptimizerAutomation.Client.exceptions.InternalServerException

  • ComputeOptimizerAutomation.Client.exceptions.NotManagementAccountException

  • ComputeOptimizerAutomation.Client.exceptions.ServiceUnavailableException

  • ComputeOptimizerAutomation.Client.exceptions.IdempotencyTokenInUseException