Skip to content

register_organization_delegated_admin

register_organization_delegated_admin(
    member_account_id: AccountId,
    *,
    config_overrides: Optional[CloudTrailClientConfig] = None,
) -> RegisterOrganizationDelegatedAdminResponse

Registers an organization’s member account as the CloudTrail delegated administrator.

Parameters:

  • member_account_id (AccountId) –

    An organization member account ID that you want to designate as a delegated administrator.

Raises:

Source code in docs_src/capo_cloudtrail/_services/cloud_trail.py
def register_organization_delegated_admin(
    self,
    member_account_id: "capo_cloudtrail.types.account_id.AccountId",
    *,
    config_overrides: Optional[CloudTrailClientConfig] = None,
) -> "capo_cloudtrail.types.register_organization_delegated_admin_response.RegisterOrganizationDelegatedAdminResponse":
    """<p>Registers an organization’s member account as the CloudTrail <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-delegated-administrator.html">delegated administrator</a>.</p>

    Args:
        member_account_id: <p>An organization member account ID that you want to designate as a delegated administrator.</p>

    Raises:
        capo_cloudtrail.errors.account_not_found_exception.AccountNotFoundException: <p>This exception is thrown when the specified account is not found or not part of an organization.</p>
        capo_cloudtrail.errors.account_registered_exception.AccountRegisteredException: <p>This exception is thrown when the account is already registered as the CloudTrail delegated administrator.</p>
        capo_cloudtrail.errors.cannot_delegate_management_account_exception.CannotDelegateManagementAccountException: <p>This exception is thrown when the management account of an organization is registered as the CloudTrail delegated administrator.</p>
        capo_cloudtrail.errors.cloud_trail_access_not_enabled_exception.CloudTrailAccessNotEnabledException: <p>This exception is thrown when trusted access has not been enabled between CloudTrail and Organizations. For more information, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access">How to enable or disable trusted access</a> in the <i>Organizations User Guide</i> and <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html">Prepare For Creating a Trail For Your Organization</a> in the <i>CloudTrail User Guide</i>.</p>
        capo_cloudtrail.errors.conflict_exception.ConflictException: <p>This exception is thrown when the specified resource is not ready for an operation. This can occur when you try to run an operation on a resource before CloudTrail has time to fully load the resource, or because another operation is modifying the resource. If this exception occurs, wait a few minutes, and then try the operation again.</p>
        capo_cloudtrail.errors.delegated_admin_account_limit_exceeded_exception.DelegatedAdminAccountLimitExceededException: <p>This exception is thrown when the maximum number of CloudTrail delegated administrators is reached.</p>
        capo_cloudtrail.errors.insufficient_dependency_service_access_permission_exception.InsufficientDependencyServiceAccessPermissionException: <p>This exception is thrown when the IAM identity that is used to create the organization resource lacks one or more required permissions for creating an organization resource in a required service.</p>
        capo_cloudtrail.errors.insufficient_iam_access_permission_exception.InsufficientIAMAccessPermissionException: <p>The task can't be completed because you are signed in with an account that lacks permissions to view or create a service-linked role. Sign in with an account that has the required permissions and then try again.</p>
        capo_cloudtrail.errors.invalid_parameter_exception.InvalidParameterException: <p>The request includes a parameter that is not valid.</p>
        capo_cloudtrail.errors.not_organization_management_account_exception.NotOrganizationManagementAccountException: <p> This exception is thrown when the account making the request is not the organization's management account. </p>
        capo_cloudtrail.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>This exception is thrown when the requested operation is not permitted.</p>
        capo_cloudtrail.errors.organization_not_in_all_features_mode_exception.OrganizationNotInAllFeaturesModeException: <p>This exception is thrown when Organizations is not configured to support all features. All features must be enabled in Organizations to support creating an organization trail or event data store.</p>
        capo_cloudtrail.errors.organizations_not_in_use_exception.OrganizationsNotInUseException: <p>This exception is thrown when the request is made from an Amazon Web Services account that is not a member of an organization. To make this request, sign in using the credentials of an account that belongs to an organization.</p>
        capo_cloudtrail.errors.unsupported_operation_exception.UnsupportedOperationException: <p>This exception is thrown when the requested operation is not supported.</p>
        capo_cloudtrail.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudtrail.types.register_organization_delegated_admin_request.RegisterOrganizationDelegatedAdminRequest]",
    ) -> OperationResponse[
        "capo_cloudtrail.types.register_organization_delegated_admin_response.RegisterOrganizationDelegatedAdminResponse"
    ]:
        import capo_cloudtrail._operations.cloud_trail_20131101.register_organization_delegated_admin

        output, http_response = (
            capo_cloudtrail._operations.cloud_trail_20131101.register_organization_delegated_admin.register_organization_delegated_admin(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RegisterOrganizationDelegatedAdmin")
    )
    input_: capo_cloudtrail.types.register_organization_delegated_admin_request.RegisterOrganizationDelegatedAdminRequest = {
        "member_account_id": member_account_id
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output