Skip to content

update_evidence

update_evidence(
    environment_arn: EnvironmentArn,
    project: ProjectName,
    evidence_id: str,
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
    title: Optional[EvidenceTitle] = None,
    description: Optional[EvidenceDescription] = None,
    add_control_reference_links: Optional[ControlReferenceList] = None,
    remove_control_reference_links: Optional[ControlReferenceList] = None,
    link_mode: Optional[LinkMode] = None,
) -> UpdateEvidenceOutput

Updates evidence metadata and manages control links (add or remove) and re-analysis without creating a new evidence version.

Parameters:

  • environment_arn (EnvironmentArn) –

    The ARN of this governance environment.

  • project (ProjectName) –

    The name of the project.

  • evidence_id (str) –

    The unique identifier of the evidence item.

  • title (Optional[EvidenceTitle], default: None ) –

    The optional new title.

  • description (Optional[EvidenceDescription], default: None ) –

    The optional new description.

  • add_control_reference_links (Optional[ControlReferenceList], default: None ) –

    The control links to add.

  • remove_control_reference_links (Optional[ControlReferenceList], default: None ) –

    The control links to remove. AWS Assurance doesn't suggest removed links again.

  • link_mode (Optional[LinkMode], default: None ) –

    Controls whether AWS Assurance analyzes the latest version of the evidence again and suggests new control links. Specify one of the following values:

    • AUTO – Starts an analysis. The analysis only adds links. It keeps existing links, and it doesn't suggest links that you removed.

    • MANUAL – Doesn't run an analysis. This is the default if you omit this parameter.

    You can't specify DISABLED. If an analysis that started less than 10 minutes ago is still running, AWS Assurance returns a ConflictException. Other changes in the same request might already be applied, so it's safe to retry.

Raises:

Examples:

Link evidence to a control Links the user access review evidence to a PCI-DSS control in the payments-prod project.

>>> client.update_evidence(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', project='payments-prod', evidence_id='assurance://PCI-DSS-user-access-review.pdf', add_control_reference_links=[{'framework': 'AWS:PCI-DSS', 'frameworkVersion': '4', 'controlId': '8.2.1'}])
Source code in docs_src/capo_assurance/_services/assurance.py
def update_evidence(
    self,
    environment_arn: "capo_assurance.types.environment_arn.EnvironmentArn",
    project: "capo_assurance.types.project_name.ProjectName",
    evidence_id: str,
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
    title: Optional["capo_assurance.types.evidence_title.EvidenceTitle"] = None,
    description: Optional[
        "capo_assurance.types.evidence_description.EvidenceDescription"
    ] = None,
    add_control_reference_links: Optional[
        "capo_assurance.types.control_reference_list.ControlReferenceList"
    ] = None,
    remove_control_reference_links: Optional[
        "capo_assurance.types.control_reference_list.ControlReferenceList"
    ] = None,
    link_mode: Optional["capo_assurance.types.link_mode.LinkMode"] = None,
) -> "capo_assurance.types.update_evidence_output.UpdateEvidenceOutput":
    """<p>Updates evidence metadata and manages control links (add or remove) and re-analysis without creating a new evidence version.</p>

    Args:
        environment_arn: <p>The ARN of this governance environment.</p>
        project: <p>The name of the project.</p>
        evidence_id: <p>The unique identifier of the evidence item.</p>
        title: <p>The optional new title.</p>
        description: <p>The optional new description.</p>
        add_control_reference_links: <p>The control links to add.</p>
        remove_control_reference_links: <p>The control links to remove. AWS Assurance doesn't suggest removed links again.</p>
        link_mode: <p>Controls whether AWS Assurance analyzes the latest version of the evidence again and suggests new control links. Specify one of the following values:</p> <ul> <li> <p> <code>AUTO</code> – Starts an analysis. The analysis only adds links. It keeps existing links, and it doesn't suggest links that you removed.</p> </li> <li> <p> <code>MANUAL</code> – Doesn't run an analysis. This is the default if you omit this parameter.</p> </li> </ul> <p>You can't specify <code>DISABLED</code>. If an analysis that started less than 10 minutes ago is still running, AWS Assurance returns a <code>ConflictException</code>. Other changes in the same request might already be applied, so it's safe to retry.</p>

    Raises:
        capo_assurance.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.</p>
        capo_assurance.errors.conflict_exception.ConflictException: <p>A conflict occurred (for example, resource already exists).</p>
        capo_assurance.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred.</p>
        capo_assurance.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_assurance.errors.throttling_exception.ThrottlingException: <p>The request was throttled.</p>
        capo_assurance.errors.validation_exception.ValidationException: <p>The request failed validation.</p>
        capo_assurance.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Link evidence to a control
        Links the user access review evidence to a PCI-DSS control in the payments-prod project.

        >>> client.update_evidence(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', project='payments-prod', evidence_id='assurance://PCI-DSS-user-access-review.pdf', add_control_reference_links=[{'framework': 'AWS:PCI-DSS', 'frameworkVersion': '4', 'controlId': '8.2.1'}])
    """

    def _handler(
        req: "OperationRequest[capo_assurance.types.update_evidence_input.UpdateEvidenceInput]",
    ) -> OperationResponse[
        "capo_assurance.types.update_evidence_output.UpdateEvidenceOutput"
    ]:
        import capo_assurance._operations.assurance.update_evidence

        output, http_response = (
            capo_assurance._operations.assurance.update_evidence.update_evidence(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_assurance.types.update_evidence_input.UpdateEvidenceInput",
    ) -> dict[str, Any]:
        import capo_assurance.types.update_evidence_input

        return capo_assurance.types.update_evidence_input.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateEvidence", redact_input=_redact_input),
    )
    input_: capo_assurance.types.update_evidence_input.UpdateEvidenceInput = {
        "environment_arn": environment_arn,
        "project": project,
        "evidence_id": evidence_id,
    }
    if title is not None:
        input_["title"] = title
    if description is not None:
        input_["description"] = description
    if add_control_reference_links is not None:
        input_["add_control_reference_links"] = add_control_reference_links
    if remove_control_reference_links is not None:
        input_["remove_control_reference_links"] = remove_control_reference_links
    if link_mode is not None:
        input_["link_mode"] = link_mode

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