Skip to content

put_evaluations async

put_evaluations(
    result_token: String,
    *,
    config_overrides: Optional[AsyncConfigServiceClientConfig] = None,
    evaluations: Optional[Evaluations] = None,
    test_mode: Optional[Boolean] = None,
) -> PutEvaluationsResponse

Used by an Lambda function to deliver evaluation results to Config. This operation is required in every Lambda function that is invoked by an Config rule.

Parameters:

  • evaluations (Optional[Evaluations], default: None ) –

    The assessments that the Lambda function performs. Each evaluation identifies an Amazon Web Services resource and indicates whether it complies with the Config rule that invokes the Lambda function.

  • result_token (String) –

    An encrypted token that associates an evaluation with an Config rule. Identifies the rule and the event that triggered the evaluation.

  • test_mode (Optional[Boolean], default: None ) –

    Use this parameter to specify a test run for PutEvaluations. You can verify whether your Lambda function will deliver evaluation results to Config. No updates occur to your existing evaluations, and evaluation results are not sent to Config.

    When TestMode is true, PutEvaluations doesn't require a valid value for the ResultToken parameter, but the value cannot be null.

Raises:

  • InvalidParameterValueException –

    One or more of the specified parameters are not valid. Verify that your parameters are valid and try again.

  • InvalidResultTokenException –

    The specified ResultToken is not valid.

  • NoSuchConfigRuleException –

    The Config rule in the request is not valid. Verify that the rule is an Config Process Check rule, that the rule name is correct, and that valid Amazon Resouce Names (ARNs) are used before trying again.

  • UnknownServiceError –

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

Source code in docs_src/capo_config_service/_services/async_config_service.py
async def put_evaluations(
    self,
    result_token: "capo_config_service.types.string.String",
    *,
    config_overrides: Optional[AsyncConfigServiceClientConfig] = None,
    evaluations: Optional[
        "capo_config_service.types.evaluations.Evaluations"
    ] = None,
    test_mode: Optional["capo_config_service.types.boolean.Boolean"] = None,
) -> "capo_config_service.types.put_evaluations_response.PutEvaluationsResponse":
    """<p>Used by an Lambda function to deliver evaluation results to Config. This operation is required in every Lambda function that is invoked by an Config rule.</p>

    Args:
        evaluations: <p>The assessments that the Lambda function performs. Each evaluation identifies an Amazon Web Services resource and indicates whether it complies with the Config rule that invokes the Lambda function.</p>
        result_token: <p>An encrypted token that associates an evaluation with an Config rule. Identifies the rule and the event that triggered the evaluation.</p>
        test_mode: <p>Use this parameter to specify a test run for <code>PutEvaluations</code>. You can verify whether your Lambda function will deliver evaluation results to Config. No updates occur to your existing evaluations, and evaluation results are not sent to Config.</p> <note> <p>When <code>TestMode</code> is <code>true</code>, <code>PutEvaluations</code> doesn't require a valid value for the <code>ResultToken</code> parameter, but the value cannot be null.</p> </note>

    Raises:
        capo_config_service.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more of the specified parameters are not valid. Verify that your parameters are valid and try again.</p>
        capo_config_service.errors.invalid_result_token_exception.InvalidResultTokenException: <p>The specified <code>ResultToken</code> is not valid.</p>
        capo_config_service.errors.no_such_config_rule_exception.NoSuchConfigRuleException: <p>The Config rule in the request is not valid. Verify that the rule is an Config Process Check rule, that the rule name is correct, and that valid Amazon Resouce Names (ARNs) are used before trying again.</p>
        capo_config_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_config_service.types.put_evaluations_request.PutEvaluationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_config_service.types.put_evaluations_response.PutEvaluationsResponse"
    ]:
        import capo_config_service._operations.starling_dove_service.put_evaluations

        (
            output,
            http_response,
        ) = await capo_config_service._operations.starling_dove_service.put_evaluations.async_put_evaluations(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutEvaluations")
    )
    input_: capo_config_service.types.put_evaluations_request.PutEvaluationsRequest = {
        "result_token": result_token
    }
    if evaluations is not None:
        input_["evaluations"] = evaluations
    if test_mode is not None:
        input_["test_mode"] = test_mode

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