Skip to content

start_resource_evaluation async

start_resource_evaluation(
    resource_details: ResourceDetails,
    evaluation_mode: EvaluationMode,
    *,
    config_overrides: Optional[AsyncConfigServiceClientConfig] = None,
    evaluation_context: Optional[EvaluationContext] = None,
    evaluation_timeout: Optional[EvaluationTimeout] = None,
    client_token: Optional[ClientToken] = None,
) -> StartResourceEvaluationResponse

Runs an on-demand evaluation for the specified resource to determine whether the resource details will comply with configured Config rules. You can also use it for evaluation purposes. Config recommends using an evaluation context. It runs an execution against the resource details with all of the Config rules in your account that match with the specified proactive mode and resource type.

Ensure you have the cloudformation:DescribeType role setup to validate the resource type schema.

You can find the Resource type schema in "Amazon Web Services public extensions" within the CloudFormation registry or with the following CLI commmand: aws cloudformation describe-type --type-name "AWS::S3::Bucket" --type RESOURCE.

For more information, see Managing extensions through the CloudFormation registry and Amazon Web Services resource and property types reference in the CloudFormation User Guide.

Parameters:

  • resource_details (ResourceDetails) –

    Returns a ResourceDetails object.

  • evaluation_context (Optional[EvaluationContext], default: None ) –

    Returns an EvaluationContext object.

  • evaluation_mode (EvaluationMode) –

    The mode of an evaluation.

    The only valid value for this API is PROACTIVE.

  • evaluation_timeout (Optional[EvaluationTimeout], default: None ) –

    The timeout for an evaluation. The default is 900 seconds. You cannot specify a number greater than 3600. If you specify 0, Config uses the default.

  • client_token (Optional[ClientToken], default: None ) –

    A client token is a unique, case-sensitive string of up to 64 ASCII characters. To make an idempotent API request using one of these actions, specify a client token in the request.

    Avoid reusing the same client token for other API requests. If you retry a request that completed successfully using the same client token and the same parameters, the retry succeeds without performing any further actions. If you retry a successful request using the same client token, but one or more of the parameters are different, other than the Region or Availability Zone, the retry fails with an IdempotentParameterMismatch error.

Raises:

  • IdempotentParameterMismatch –

    Using the same client token with one or more different parameters. Specify a new client token with the parameter changes and try again.

  • InvalidParameterValueException –

    One or more of the specified parameters are not valid. Verify that your parameters are valid and try 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 start_resource_evaluation(
    self,
    resource_details: "capo_config_service.types.resource_details.ResourceDetails",
    evaluation_mode: "capo_config_service.types.evaluation_mode.EvaluationMode",
    *,
    config_overrides: Optional[AsyncConfigServiceClientConfig] = None,
    evaluation_context: Optional[
        "capo_config_service.types.evaluation_context.EvaluationContext"
    ] = None,
    evaluation_timeout: Optional[
        "capo_config_service.types.evaluation_timeout.EvaluationTimeout"
    ] = None,
    client_token: Optional[
        "capo_config_service.types.client_token.ClientToken"
    ] = None,
) -> "capo_config_service.types.start_resource_evaluation_response.StartResourceEvaluationResponse":
    """<p>Runs an on-demand evaluation for the specified resource to determine whether the resource details will comply with configured Config rules. You can also use it for evaluation purposes. Config recommends using an evaluation context. It runs an execution against the resource details with all of the Config rules in your account that match with the specified proactive mode and resource type.</p> <note> <p>Ensure you have the <code>cloudformation:DescribeType</code> role setup to validate the resource type schema.</p> <p>You can find the <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html">Resource type schema</a> in "<i>Amazon Web Services public extensions</i>" within the CloudFormation registry or with the following CLI commmand: <code>aws cloudformation describe-type --type-name "AWS::S3::Bucket" --type RESOURCE</code>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html#registry-view">Managing extensions through the CloudFormation registry</a> and <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">Amazon Web Services resource and property types reference</a> in the CloudFormation User Guide.</p> </note>

    Args:
        resource_details: <p>Returns a <code>ResourceDetails</code> object.</p>
        evaluation_context: <p>Returns an <code>EvaluationContext</code> object.</p>
        evaluation_mode: <p>The mode of an evaluation.</p> <note> <p>The only valid value for this API is <code>PROACTIVE</code>.</p> </note>
        evaluation_timeout: <p>The timeout for an evaluation. The default is 900 seconds. You cannot specify a number greater than 3600. If you specify 0, Config uses the default.</p>
        client_token: <p>A client token is a unique, case-sensitive string of up to 64 ASCII characters. To make an idempotent API request using one of these actions, specify a client token in the request.</p> <note> <p>Avoid reusing the same client token for other API requests. If you retry a request that completed successfully using the same client token and the same parameters, the retry succeeds without performing any further actions. If you retry a successful request using the same client token, but one or more of the parameters are different, other than the Region or Availability Zone, the retry fails with an IdempotentParameterMismatch error.</p> </note>

    Raises:
        capo_config_service.errors.idempotent_parameter_mismatch.IdempotentParameterMismatch: <p>Using the same client token with one or more different parameters. Specify a new client token with the parameter changes and try again.</p>
        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.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_config_service.types.start_resource_evaluation_request.StartResourceEvaluationRequest]",
    ) -> AsyncOperationResponse[
        "capo_config_service.types.start_resource_evaluation_response.StartResourceEvaluationResponse"
    ]:
        import capo_config_service._operations.starling_dove_service.start_resource_evaluation

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartResourceEvaluation")
    )
    input_: capo_config_service.types.start_resource_evaluation_request.StartResourceEvaluationRequest = {
        "resource_details": resource_details,
        "evaluation_mode": evaluation_mode,
    }
    if evaluation_context is not None:
        input_["evaluation_context"] = evaluation_context
    if evaluation_timeout is not None:
        input_["evaluation_timeout"] = evaluation_timeout
    if client_token is not None:
        input_["client_token"] = client_token

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