Skip to content

delete_framework async

delete_framework(
    environment_arn: EnvironmentArn,
    framework: FrameworkName,
    framework_version: FrameworkVersion,
    *,
    config_overrides: Optional[AsyncAssuranceClientConfig] = None,
) -> DeleteFrameworkOutput

Deletes a custom framework that you no longer need. You can delete only custom frameworks. Managed frameworks are read-only. Before you delete a framework, you must disable it in every project where it is enabled. Otherwise, you receive a ConflictException.

A framework in PENDING status must be empty (no control groups or controls) before you delete it. Otherwise, you receive a ConflictException. When you delete an ACTIVE (published) framework, AWS Assurance also deletes its control groups and controls.

In every project, AWS Assurance also deletes your data for this framework version:

  • Assessments and their results

  • Annotations

  • Tasks, task history, and comments

  • Decisions that mark a control or requirement as not applicable, and their justifications

Consider this data permanently deleted as soon as the operation succeeds. Your evidence remains available, but it is no longer linked to the framework's controls.

To keep an assessment report, export it before you disable the framework. First, call StartAssessmentReportExport. Then wait until GetAssessmentReportExport reports COMPLETED. Finally, get the report with GetAssessmentReportContent.

The deletion can continue after the operation returns and might take some time. For example, the deletion might take longer while an assessment that uses the framework is still running. Until the deletion completes, creating a framework with the same name and version returns a ConflictException.

Parameters:

  • environment_arn (EnvironmentArn) –

    The ARN of this governance environment.

  • framework (FrameworkName) –

    The name of the compliance framework.

  • framework_version (FrameworkVersion) –

    The version of the compliance framework.

Raises:

Examples:

Delete a custom framework Deletes a published custom PCI-DSS framework that is no longer enabled for any project, together with its control groups and controls.

>>> await client.delete_framework(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', framework='payments-pci-dss', framework_version='1.0')
Source code in docs_src/capo_assurance/_services/async_assurance.py
async def delete_framework(
    self,
    environment_arn: "capo_assurance.types.environment_arn.EnvironmentArn",
    framework: "capo_assurance.types.framework_name.FrameworkName",
    framework_version: "capo_assurance.types.framework_version.FrameworkVersion",
    *,
    config_overrides: Optional[AsyncAssuranceClientConfig] = None,
) -> "capo_assurance.types.delete_framework_output.DeleteFrameworkOutput":
    """<p>Deletes a custom framework that you no longer need. You can delete only custom frameworks. Managed frameworks are read-only. Before you delete a framework, you must disable it in every project where it is enabled. Otherwise, you receive a <code>ConflictException</code>.</p> <p>A framework in <code>PENDING</code> status must be empty (no control groups or controls) before you delete it. Otherwise, you receive a <code>ConflictException</code>. When you delete an <code>ACTIVE</code> (published) framework, AWS Assurance also deletes its control groups and controls.</p> <p>In every project, AWS Assurance also deletes your data for this framework version:</p> <ul> <li> <p>Assessments and their results</p> </li> <li> <p>Annotations</p> </li> <li> <p>Tasks, task history, and comments</p> </li> <li> <p>Decisions that mark a control or requirement as not applicable, and their justifications</p> </li> </ul> <p>Consider this data permanently deleted as soon as the operation succeeds. Your evidence remains available, but it is no longer linked to the framework's controls.</p> <p>To keep an assessment report, export it before you disable the framework. First, call <code>StartAssessmentReportExport</code>. Then wait until <code>GetAssessmentReportExport</code> reports <code>COMPLETED</code>. Finally, get the report with <code>GetAssessmentReportContent</code>.</p> <p>The deletion can continue after the operation returns and might take some time. For example, the deletion might take longer while an assessment that uses the framework is still running. Until the deletion completes, creating a framework with the same name and version returns a <code>ConflictException</code>.</p>

    Args:
        environment_arn: <p>The ARN of this governance environment.</p>
        framework: <p>The name of the compliance framework.</p>
        framework_version: <p>The version of the compliance framework.</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:
        Delete a custom framework
        Deletes a published custom PCI-DSS framework that is no longer enabled for any project, together with its control groups and controls.

        >>> await client.delete_framework(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', framework='payments-pci-dss', framework_version='1.0')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_assurance.types.delete_framework_input.DeleteFrameworkInput]",
    ) -> AsyncOperationResponse[
        "capo_assurance.types.delete_framework_output.DeleteFrameworkOutput"
    ]:
        import capo_assurance._operations.assurance.delete_framework

        (
            output,
            http_response,
        ) = await capo_assurance._operations.assurance.delete_framework.async_delete_framework(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteFramework")
    )
    input_: capo_assurance.types.delete_framework_input.DeleteFrameworkInput = {
        "environment_arn": environment_arn,
        "framework": framework,
        "framework_version": framework_version,
    }

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