Skip to content

enable_organizations_root_sessions async

enable_organizations_root_sessions(
    *, config_overrides: Optional[AsyncIAMClientConfig] = None
) -> EnableOrganizationsRootSessionsResponse

Allows the management account or delegated administrator to perform privileged tasks on member accounts in your organization. For more information, see Centrally manage root access for member accounts in the Identity and Access Management User Guide.

Before you enable this feature, you must have an account configured with the following settings:

  • You must manage your Amazon Web Services accounts in Organizations.

  • Enable trusted access for Identity and Access Management in Organizations. For details, see IAM and Organizations in the Organizations User Guide.

Raises:

Examples:

To enable the RootSessions feature in your organization The following command allows the management account or delegated administrator to perform privileged tasks on member accounts in your organization.

>>> await client.enable_organizations_root_sessions()
Source code in docs_src/capo_iam/_services/async_iam.py
async def enable_organizations_root_sessions(
    self, *, config_overrides: Optional[AsyncIAMClientConfig] = None
) -> "capo_iam.types.enable_organizations_root_sessions_response.EnableOrganizationsRootSessionsResponse":
    """<p>Allows the management account or delegated administrator to perform privileged tasks on member accounts in your organization. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#id_root-user-access-management">Centrally manage root access for member accounts</a> in the <i>Identity and Access Management User Guide</i>.</p> <p>Before you enable this feature, you must have an account configured with the following settings:</p> <ul> <li> <p>You must manage your Amazon Web Services accounts in <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html">Organizations</a>.</p> </li> <li> <p>Enable trusted access for Identity and Access Management in Organizations. For details, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-ra.html">IAM and Organizations</a> in the <i>Organizations User Guide</i>.</p> </li> </ul>

    Raises:
        capo_iam.errors.account_not_management_or_delegated_administrator_exception.AccountNotManagementOrDelegatedAdministratorException: <p>The request was rejected because the account making the request is not the management account or delegated administrator account for <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#id_root-user-access-management">centralized root access</a>.</p>
        capo_iam.errors.caller_is_not_management_account_exception.CallerIsNotManagementAccountException: <p>The request was rejected because the account making the request is not the management account for the organization.</p>
        capo_iam.errors.organization_not_found_exception.OrganizationNotFoundException: <p>The request was rejected because no organization is associated with your account.</p>
        capo_iam.errors.organization_not_in_all_features_mode_exception.OrganizationNotInAllFeaturesModeException: <p>The request was rejected because your organization does not have All features enabled. For more information, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#feature-set">Available feature sets</a> in the <i>Organizations User Guide</i>.</p>
        capo_iam.errors.service_access_not_enabled_exception.ServiceAccessNotEnabledException: <p>The request was rejected because trusted access is not enabled for IAM in Organizations. For details, see IAM and Organizations in the <i>Organizations User Guide</i>.</p>
        capo_iam.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To enable the RootSessions feature in your organization
        The following command allows the management account or delegated administrator to perform privileged tasks on member accounts in your organization.

        >>> await client.enable_organizations_root_sessions()
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iam.types.enable_organizations_root_sessions_request.EnableOrganizationsRootSessionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_iam.types.enable_organizations_root_sessions_response.EnableOrganizationsRootSessionsResponse"
    ]:
        import capo_iam._operations.aws_identity_management_v20100508.enable_organizations_root_sessions

        (
            output,
            http_response,
        ) = await capo_iam._operations.aws_identity_management_v20100508.enable_organizations_root_sessions.async_enable_organizations_root_sessions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("EnableOrganizationsRootSessions")
    )
    input_: capo_iam.types.enable_organizations_root_sessions_request.EnableOrganizationsRootSessionsRequest = {}

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output