Skip to content

create_control async

create_control(
    environment_arn: EnvironmentArn,
    framework: FrameworkName,
    framework_version: FrameworkVersion,
    control_id: ControlID,
    parent_control_id: ControlID,
    title: ControlTitle,
    *,
    config_overrides: Optional[AsyncAssuranceClientConfig] = None,
    description: Optional[ControlDescription] = None,
    requirements: Optional[RequirementList] = None,
    display_order: Optional[DisplayOrder] = None,
    control_intents: Optional[ControlIntentList] = None,
    workflow_type: Optional[WorkflowType] = None,
) -> CreateControlOutput

Creates a leaf control, which is a control with no child controls, in a custom framework.

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.

  • control_id (ControlID) –

    The control identifier. Optional. If omitted, the operation applies to the full framework.

  • parent_control_id (ControlID) –

    The identifier of the parent control group.

  • title (ControlTitle) –

    The display name for the control.

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

    A description of the control.

  • requirements (Optional[RequirementList], default: None ) –

    The individual checks an assessment scores for this control. Assign each one an id that findings, assessment results, and remediation tasks reference.

  • display_order (Optional[DisplayOrder], default: None ) –

    The ordering key that determines the display sequence within the framework.

  • control_intents (Optional[ControlIntentList], default: None ) –

    The technical control intents that classify how an assessment evaluates this leaf control. Supplying at least one intent makes the control eligible for automated scanning. Leaf controls only.

  • workflow_type (Optional[WorkflowType], default: None ) –

    The optional evaluation workflow type. When omitted and controlIntents are present, the service defaults this to automated-scan. Leaf controls only.

Raises:

Examples:

Create a control Creates a leaf control in the payments team's custom framework while it is still a draft, with a requirement the payments-prod assessment will score.

>>> await client.create_control(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', framework='payments-pci-dss', framework_version='1.0', control_id='PAY-1.1', parent_control_id='PAY-1', title='Encrypt cardholder data at rest', description='Requires that stored cardholder data is encrypted with a customer-managed key.', requirements=[{'id': 'PAY-1.1-R1', 'description': 'Confirm that storage holding cardholder data has encryption enabled.'}], display_order=1, control_intents=['storageEncryptionConfiguration'], workflow_type='automated-scan')
Source code in docs_src/capo_assurance/_services/async_assurance.py
async def create_control(
    self,
    environment_arn: "capo_assurance.types.environment_arn.EnvironmentArn",
    framework: "capo_assurance.types.framework_name.FrameworkName",
    framework_version: "capo_assurance.types.framework_version.FrameworkVersion",
    control_id: "capo_assurance.types.control_id.ControlID",
    parent_control_id: "capo_assurance.types.control_id.ControlID",
    title: "capo_assurance.types.control_title.ControlTitle",
    *,
    config_overrides: Optional[AsyncAssuranceClientConfig] = None,
    description: Optional[
        "capo_assurance.types.control_description.ControlDescription"
    ] = None,
    requirements: Optional[
        "capo_assurance.types.requirement_list.RequirementList"
    ] = None,
    display_order: Optional[
        "capo_assurance.types.display_order.DisplayOrder"
    ] = None,
    control_intents: Optional[
        "capo_assurance.types.control_intent_list.ControlIntentList"
    ] = None,
    workflow_type: Optional[
        "capo_assurance.types.workflow_type.WorkflowType"
    ] = None,
) -> "capo_assurance.types.create_control_output.CreateControlOutput":
    """<p>Creates a leaf control, which is a control with no child controls, in a custom framework.</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>
        control_id: <p>The control identifier. Optional. If omitted, the operation applies to the full framework.</p>
        parent_control_id: <p>The identifier of the parent control group.</p>
        title: <p>The display name for the control.</p>
        description: <p>A description of the control.</p>
        requirements: <p>The individual checks an assessment scores for this control. Assign each one an <code>id</code> that findings, assessment results, and remediation tasks reference.</p>
        display_order: <p>The ordering key that determines the display sequence within the framework.</p>
        control_intents: <p>The technical control intents that classify how an assessment evaluates this leaf control. Supplying at least one intent makes the control eligible for automated scanning. Leaf controls only.</p>
        workflow_type: <p>The optional evaluation workflow type. When omitted and controlIntents are present, the service defaults this to automated-scan. Leaf controls only.</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 control
        Creates a leaf control in the payments team's custom framework while it is still a draft, with a requirement the payments-prod assessment will score.

        >>> await client.create_control(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', framework='payments-pci-dss', framework_version='1.0', control_id='PAY-1.1', parent_control_id='PAY-1', title='Encrypt cardholder data at rest', description='Requires that stored cardholder data is encrypted with a customer-managed key.', requirements=[{'id': 'PAY-1.1-R1', 'description': 'Confirm that storage holding cardholder data has encryption enabled.'}], display_order=1, control_intents=['storageEncryptionConfiguration'], workflow_type='automated-scan')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_assurance.types.create_control_input.CreateControlInput]",
    ) -> AsyncOperationResponse[
        "capo_assurance.types.create_control_output.CreateControlOutput"
    ]:
        import capo_assurance._operations.assurance.create_control

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateControl")
    )
    input_: capo_assurance.types.create_control_input.CreateControlInput = {
        "environment_arn": environment_arn,
        "framework": framework,
        "framework_version": framework_version,
        "control_id": control_id,
        "parent_control_id": parent_control_id,
        "title": title,
    }
    if description is not None:
        input_["description"] = description
    if requirements is not None:
        input_["requirements"] = requirements
    if display_order is not None:
        input_["display_order"] = display_order
    if control_intents is not None:
        input_["control_intents"] = control_intents
    if workflow_type is not None:
        input_["workflow_type"] = workflow_type

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