Skip to content

get_account_password_policy async

get_account_password_policy(
    *, config_overrides: Optional[AsyncIAMClientConfig] = None
) -> GetAccountPasswordPolicyResponse

Retrieves the password policy for the Amazon Web Services account. This tells you the complexity requirements and mandatory rotation periods for the IAM user passwords in your account. For more information about using a password policy, see Managing an IAM password policy.

Raises:

  • NoSuchEntityException –

    The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ServiceFailureException –

    The request processing has failed because of an unknown error, exception or failure.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To see the current account password policy The following command displays details about the password policy for the current AWS account.

>>> await client.get_account_password_policy()
Source code in docs_src/capo_iam/_services/async_iam.py
async def get_account_password_policy(
    self, *, config_overrides: Optional[AsyncIAMClientConfig] = None
) -> "capo_iam.types.get_account_password_policy_response.GetAccountPasswordPolicyResponse":
    """<p>Retrieves the password policy for the Amazon Web Services account. This tells you the complexity requirements and mandatory rotation periods for the IAM user passwords in your account. For more information about using a password policy, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.html">Managing an IAM password policy</a>.</p>

    Raises:
        capo_iam.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.</p>
        capo_iam.errors.service_failure_exception.ServiceFailureException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_iam.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To see the current account password policy
        The following command displays details about the password policy for the current AWS account.

        >>> await client.get_account_password_policy()
    """

    async def _handler(
        req: "AsyncOperationRequest[None]",
    ) -> AsyncOperationResponse[
        "capo_iam.types.get_account_password_policy_response.GetAccountPasswordPolicyResponse"
    ]:
        import capo_iam._operations.aws_identity_management_v20100508.get_account_password_policy

        (
            output,
            http_response,
        ) = await capo_iam._operations.aws_identity_management_v20100508.get_account_password_policy.async_get_account_password_policy(
            req.options
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetAccountPasswordPolicy")
    )

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