Skip to content

create_framework async

create_framework(
    environment_arn: EnvironmentArn,
    framework: FrameworkName,
    framework_version: FrameworkVersion,
    *,
    config_overrides: Optional[AsyncAssuranceClientConfig] = None,
    title: Optional[FrameworkTitle] = None,
    description: Optional[FrameworkDescription] = None,
) -> CreateFrameworkOutput

Creates a custom framework. The framework name must not start with AWS:. New frameworks are created in PENDING status. Use PublishFramework to make them ACTIVE.

Parameters:

Raises:

Examples:

Create a custom framework Creates a custom PCI-DSS framework in a governance environment for the payments team assessment.

>>> await client.create_framework(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', framework='payments-pci-dss', framework_version='1.0', title='Payments PCI-DSS v4 Framework', description='Custom control framework for the payments team PCI-DSS v4 assessment.')
Source code in docs_src/capo_assurance/_services/async_assurance.py
async def create_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,
    title: Optional["capo_assurance.types.framework_title.FrameworkTitle"] = None,
    description: Optional[
        "capo_assurance.types.framework_description.FrameworkDescription"
    ] = None,
) -> "capo_assurance.types.create_framework_output.CreateFrameworkOutput":
    """<p>Creates a custom framework. The framework name must not start with <code>AWS:</code>. New frameworks are created in <code>PENDING</code> status. Use <code>PublishFramework</code> to make them <code>ACTIVE</code>.</p>

    Args:
        environment_arn: <p>The ARN of this governance environment.</p>
        framework: <p>The name of the framework. The name must not start with <code>AWS:</code>.</p>
        framework_version: <p>The version that you assign to the framework.</p>
        title: <p>The human-readable title of the framework.</p>
        description: <p>A description of the 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:
        Create a custom framework
        Creates a custom PCI-DSS framework in a governance environment for the payments team assessment.

        >>> await client.create_framework(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', framework='payments-pci-dss', framework_version='1.0', title='Payments PCI-DSS v4 Framework', description='Custom control framework for the payments team PCI-DSS v4 assessment.')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_assurance.types.create_framework_input.CreateFrameworkInput]",
    ) -> AsyncOperationResponse[
        "capo_assurance.types.create_framework_output.CreateFrameworkOutput"
    ]:
        import capo_assurance._operations.assurance.create_framework

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateFramework")
    )
    input_: capo_assurance.types.create_framework_input.CreateFrameworkInput = {
        "environment_arn": environment_arn,
        "framework": framework,
        "framework_version": framework_version,
    }
    if title is not None:
        input_["title"] = title
    if description is not None:
        input_["description"] = description

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