Skip to content

put_control_status_override

put_control_status_override(
    environment_arn: EnvironmentArn,
    project: ProjectName,
    framework: FrameworkName,
    framework_version: FrameworkVersion,
    control_id: ControlID,
    type: StatusOverrideType,
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
    requirement_id: Optional[RequirementId] = None,
    justification: Optional[Justification] = None,
) -> PutControlStatusOverrideOutput

Marks a control, or one of its requirements, as not applicable to a project, or makes it applicable again. The decision applies only to the specified project and framework version, which must be enabled in the project.

Marking a control or requirement not applicable cancels its open remediation tasks. Making it applicable again doesn't reopen them.

If another request changes the same control at the same time, you receive a ConflictException. Call GetControlStatus before you retry.

Parameters:

  • environment_arn (EnvironmentArn) –

    The Amazon Resource Name (ARN) of this governance environment.

  • project (ProjectName) –

    The name of the project.

  • framework (FrameworkName) –

    The name of the compliance framework.

  • framework_version (FrameworkVersion) –

    The version of the compliance framework.

  • control_id (ControlID) –

    The identifier of the control. The control must exist in the framework version.

  • requirement_id (Optional[RequirementId], default: None ) –

    The identifier of a requirement of the control. Specify it to declare or remove a decision on that requirement only. Omit it to apply the decision to the whole control. If the requirement doesn't belong to the control, AWS Assurance returns a ValidationException.

  • type (StatusOverrideType) –

    The decision to declare. Specify one of the following values:

    • NOT_APPLICABLE – Excludes the control or requirement from the project's outcome. Requires a justification. If a decision already exists, the new justification replaces it, and AWS Assurance updates declaredBy and declaredAt.

    • NONE – Removes the current decision on the specified control or requirement. If you remove the decision on a control, the decisions on its individual requirements stay in place. A requirement stays not applicable while its control is not applicable.

  • justification (Optional[Justification], default: None ) –

    The reason that the control or requirement doesn't apply to the project. AWS Assurance keeps it as evidence for the decision. Required when type is NOT_APPLICABLE, and must contain 1–1,024 characters that aren't all whitespace. Omit it when type is NONE.

Raises:

Source code in docs_src/capo_assurance/_services/assurance.py
def put_control_status_override(
    self,
    environment_arn: "capo_assurance.types.environment_arn.EnvironmentArn",
    project: "capo_assurance.types.project_name.ProjectName",
    framework: "capo_assurance.types.framework_name.FrameworkName",
    framework_version: "capo_assurance.types.framework_version.FrameworkVersion",
    control_id: "capo_assurance.types.control_id.ControlID",
    type: "capo_assurance.types.status_override_type.StatusOverrideType",
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
    requirement_id: Optional[
        "capo_assurance.types.requirement_id.RequirementId"
    ] = None,
    justification: Optional[
        "capo_assurance.types.justification.Justification"
    ] = None,
) -> "capo_assurance.types.put_control_status_override_output.PutControlStatusOverrideOutput":
    """<p>Marks a control, or one of its requirements, as not applicable to a project, or makes it applicable again. The decision applies only to the specified project and framework version, which must be enabled in the project.</p> <note> <p>Marking a control or requirement not applicable cancels its open remediation tasks. Making it applicable again doesn't reopen them.</p> </note> <p>If another request changes the same control at the same time, you receive a <code>ConflictException</code>. Call <code>GetControlStatus</code> before you retry.</p>

    Args:
        environment_arn: <p>The Amazon Resource Name (ARN) of this governance environment.</p>
        project: <p>The name of the project.</p>
        framework: <p>The name of the compliance framework.</p>
        framework_version: <p>The version of the compliance framework.</p>
        control_id: <p>The identifier of the control. The control must exist in the framework version.</p>
        requirement_id: <p>The identifier of a requirement of the control. Specify it to declare or remove a decision on that requirement only. Omit it to apply the decision to the whole control. If the requirement doesn't belong to the control, AWS Assurance returns a <code>ValidationException</code>.</p>
        type: <p>The decision to declare. Specify one of the following values:</p> <ul> <li> <p> <code>NOT_APPLICABLE</code> – Excludes the control or requirement from the project's outcome. Requires a <code>justification</code>. If a decision already exists, the new justification replaces it, and AWS Assurance updates <code>declaredBy</code> and <code>declaredAt</code>.</p> </li> <li> <p> <code>NONE</code> – Removes the current decision on the specified control or requirement. If you remove the decision on a control, the decisions on its individual requirements stay in place. A requirement stays not applicable while its control is not applicable.</p> </li> </ul>
        justification: <p>The reason that the control or requirement doesn't apply to the project. AWS Assurance keeps it as evidence for the decision. Required when <code>type</code> is <code>NOT_APPLICABLE</code>, and must contain 1–1,024 characters that aren't all whitespace. Omit it when <code>type</code> is <code>NONE</code>.</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.
    """

    def _handler(
        req: "OperationRequest[capo_assurance.types.put_control_status_override_input.PutControlStatusOverrideInput]",
    ) -> OperationResponse[
        "capo_assurance.types.put_control_status_override_output.PutControlStatusOverrideOutput"
    ]:
        import capo_assurance._operations.assurance.put_control_status_override

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

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

        return (
            capo_assurance.types.put_control_status_override_input.redact_sensitive(
                input_
            )
        )

    def _redact_output(
        output: "capo_assurance.types.put_control_status_override_output.PutControlStatusOverrideOutput",
    ) -> dict[str, Any]:
        import capo_assurance.types.put_control_status_override_output

        return capo_assurance.types.put_control_status_override_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "PutControlStatusOverride",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_assurance.types.put_control_status_override_input.PutControlStatusOverrideInput = {
        "environment_arn": environment_arn,
        "project": project,
        "framework": framework,
        "framework_version": framework_version,
        "control_id": control_id,
        "type": type,
    }
    if requirement_id is not None:
        input_["requirement_id"] = requirement_id
    if justification is not None:
        input_["justification"] = justification

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