Skip to content

start_assessment_run

start_assessment_run(
    assessment_template_arn: Arn,
    *,
    config_overrides: Optional[InspectorClientConfig] = None,
    assessment_run_name: Optional[AssessmentRunName] = None,
) -> StartAssessmentRunResponse

Starts the assessment run specified by the ARN of the assessment template. For this API to function properly, you must not exceed the limit of running up to 500 concurrent agents per AWS account.

Parameters:

  • assessment_template_arn (Arn) –

    The ARN of the assessment template of the assessment run that you want to start.

  • assessment_run_name (Optional[AssessmentRunName], default: None ) –

    You can specify the name for the assessment run. The name must be unique for the assessment template whose ARN is used to start the assessment run.

Raises:

Examples:

Start assessment run Starts the assessment run specified by the ARN of the assessment template. For this API to function properly, you must not exceed the limit of running up to 500 concurrent agents per AWS account.

>>> client.start_assessment_run(assessment_template_arn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T', assessment_run_name='examplerun')
Source code in docs_src/capo_inspector/_services/inspector.py
def start_assessment_run(
    self,
    assessment_template_arn: "capo_inspector.types.arn.Arn",
    *,
    config_overrides: Optional[InspectorClientConfig] = None,
    assessment_run_name: Optional[
        "capo_inspector.types.assessment_run_name.AssessmentRunName"
    ] = None,
) -> (
    "capo_inspector.types.start_assessment_run_response.StartAssessmentRunResponse"
):
    """<p>Starts the assessment run specified by the ARN of the assessment template. For this API to function properly, you must not exceed the limit of running up to 500 concurrent agents per AWS account.</p>

    Args:
        assessment_template_arn: <p>The ARN of the assessment template of the assessment run that you want to start.</p>
        assessment_run_name: <p>You can specify the name for the assessment run. The name must be unique for the assessment template whose ARN is used to start the assessment run.</p>

    Raises:
        capo_inspector.errors.access_denied_exception.AccessDeniedException: <p>You do not have required permissions to access the requested resource.</p>
        capo_inspector.errors.agents_already_running_assessment_exception.AgentsAlreadyRunningAssessmentException: <p>You started an assessment run, but one of the instances is already participating in another assessment run.</p>
        capo_inspector.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_inspector.errors.invalid_cross_account_role_exception.InvalidCrossAccountRoleException: <p>Amazon Inspector cannot assume the cross-account role that it needs to list your EC2 instances during the assessment run.</p>
        capo_inspector.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because an invalid or out-of-range value was supplied for an input parameter.</p>
        capo_inspector.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because it attempted to create resources beyond the current AWS account limits. The error code describes the limit exceeded.</p>
        capo_inspector.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced an entity that does not exist. The error code describes the entity.</p>
        capo_inspector.errors.service_temporarily_unavailable_exception.ServiceTemporarilyUnavailableException: <p>The serice is temporary unavailable.</p>
        capo_inspector.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Start assessment run
        Starts the assessment run specified by the ARN of the assessment template. For this API to function properly, you must not exceed the limit of running up to 500 concurrent agents per AWS account.

        >>> client.start_assessment_run(assessment_template_arn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T', assessment_run_name='examplerun')
    """

    def _handler(
        req: "OperationRequest[capo_inspector.types.start_assessment_run_request.StartAssessmentRunRequest]",
    ) -> OperationResponse[
        "capo_inspector.types.start_assessment_run_response.StartAssessmentRunResponse"
    ]:
        import capo_inspector._operations.inspector_service.start_assessment_run

        output, http_response = (
            capo_inspector._operations.inspector_service.start_assessment_run.start_assessment_run(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartAssessmentRun")
    )
    input_: capo_inspector.types.start_assessment_run_request.StartAssessmentRunRequest = {
        "assessment_template_arn": assessment_template_arn
    }
    if assessment_run_name is not None:
        input_["assessment_run_name"] = assessment_run_name

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