Skip to content

update_assessment_target async

update_assessment_target(
    assessment_target_arn: Arn,
    assessment_target_name: AssessmentTargetName,
    *,
    config_overrides: Optional[AsyncInspectorClientConfig] = None,
    resource_group_arn: Optional[Arn] = None,
) -> None

Updates the assessment target that is specified by the ARN of the assessment target.

If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

Parameters:

  • assessment_target_arn (Arn) –

    The ARN of the assessment target that you want to update.

  • assessment_target_name (AssessmentTargetName) –

    The name of the assessment target that you want to update.

  • resource_group_arn (Optional[Arn], default: None ) –

    The ARN of the resource group that is used to specify the new resource group to associate with the assessment target.

Raises:

Examples:

Update assessment target Updates the assessment target that is specified by the ARN of the assessment target.

>>> await client.update_assessment_target(assessment_target_arn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX', assessment_target_name='Example', resource_group_arn='arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-yNbgL5Pt')
Source code in docs_src/capo_inspector/_services/async_inspector.py
async def update_assessment_target(
    self,
    assessment_target_arn: "capo_inspector.types.arn.Arn",
    assessment_target_name: "capo_inspector.types.assessment_target_name.AssessmentTargetName",
    *,
    config_overrides: Optional[AsyncInspectorClientConfig] = None,
    resource_group_arn: Optional["capo_inspector.types.arn.Arn"] = None,
) -> None:
    """<p>Updates the assessment target that is specified by the ARN of the assessment target.</p> <p>If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target.</p>

    Args:
        assessment_target_arn: <p>The ARN of the assessment target that you want to update.</p>
        assessment_target_name: <p>The name of the assessment target that you want to update.</p>
        resource_group_arn: <p>The ARN of the resource group that is used to specify the new resource group to associate with the assessment target.</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.internal_exception.InternalException: <p>Internal server error.</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.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:
        Update assessment target
        Updates the assessment target that is specified by the ARN of the assessment target.

        >>> await client.update_assessment_target(assessment_target_arn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX', assessment_target_name='Example', resource_group_arn='arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-yNbgL5Pt')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_inspector.types.update_assessment_target_request.UpdateAssessmentTargetRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_inspector._operations.inspector_service.update_assessment_target

        (
            output,
            http_response,
        ) = await capo_inspector._operations.inspector_service.update_assessment_target.async_update_assessment_target(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateAssessmentTarget")
    )
    input_: capo_inspector.types.update_assessment_target_request.UpdateAssessmentTargetRequest = {
        "assessment_target_arn": assessment_target_arn,
        "assessment_target_name": assessment_target_name,
    }
    if resource_group_arn is not None:
        input_["resource_group_arn"] = resource_group_arn

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