Skip to content

create_control

create_control(
    name: ControlName,
    control_mapping_sources: CreateControlMappingSources,
    *,
    config_overrides: Optional[AuditManagerClientConfig] = None,
    description: Optional[ControlDescription] = None,
    testing_information: Optional[TestingInformation] = None,
    action_plan_title: Optional[ActionPlanTitle] = None,
    action_plan_instructions: Optional[ActionPlanInstructions] = None,
    tags: Optional[TagMap] = None,
) -> CreateControlResponse

Creates a new custom control in Audit Manager.

Parameters:

Raises:

Source code in docs_src/capo_auditmanager/_services/audit_manager.py
def create_control(
    self,
    name: "capo_auditmanager.types.control_name.ControlName",
    control_mapping_sources: "capo_auditmanager.types.create_control_mapping_sources.CreateControlMappingSources",
    *,
    config_overrides: Optional[AuditManagerClientConfig] = None,
    description: Optional[
        "capo_auditmanager.types.control_description.ControlDescription"
    ] = None,
    testing_information: Optional[
        "capo_auditmanager.types.testing_information.TestingInformation"
    ] = None,
    action_plan_title: Optional[
        "capo_auditmanager.types.action_plan_title.ActionPlanTitle"
    ] = None,
    action_plan_instructions: Optional[
        "capo_auditmanager.types.action_plan_instructions.ActionPlanInstructions"
    ] = None,
    tags: Optional["capo_auditmanager.types.tag_map.TagMap"] = None,
) -> "capo_auditmanager.types.create_control_response.CreateControlResponse":
    """<p> Creates a new custom control in Audit Manager. </p>

    Args:
        name: <p> The name of the control. </p>
        description: <p> The description of the control. </p>
        testing_information: <p> The steps to follow to determine if the control is satisfied. </p>
        action_plan_title: <p> The title of the action plan for remediating the control. </p>
        action_plan_instructions: <p> The recommended actions to carry out if the control isn't fulfilled. </p>
        control_mapping_sources: <p> The data mapping sources for the control. </p>
        tags: <p> The tags that are associated with the control. </p>

    Raises:
        capo_auditmanager.errors.access_denied_exception.AccessDeniedException: <p> Your account isn't registered with Audit Manager. Check the delegated administrator setup on the Audit Manager settings page, and try again. </p>
        capo_auditmanager.errors.internal_server_exception.InternalServerException: <p> An internal service error occurred during the processing of your request. Try again later. </p>
        capo_auditmanager.errors.resource_not_found_exception.ResourceNotFoundException: <p> The resource that's specified in the request can't be found. </p>
        capo_auditmanager.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You've reached your account quota for this resource type. To perform the requested action, delete some existing resources or <a href="https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html">request a quota increase</a> from the Service Quotas console. For a list of Audit Manager service quotas, see <a href="https://docs.aws.amazon.com/audit-manager/latest/userguide/service-quotas.html">Quotas and restrictions for Audit Manager</a>.</p>
        capo_auditmanager.errors.validation_exception.ValidationException: <p> The request has invalid or missing parameters. </p>
        capo_auditmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_auditmanager.types.create_control_request.CreateControlRequest]",
    ) -> OperationResponse[
        "capo_auditmanager.types.create_control_response.CreateControlResponse"
    ]:
        import capo_auditmanager._operations.bedrock_assessment_manager_lambda.create_control

        output, http_response = (
            capo_auditmanager._operations.bedrock_assessment_manager_lambda.create_control.create_control(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_auditmanager.types.create_control_request.CreateControlRequest",
    ) -> dict[str, Any]:
        import capo_auditmanager.types.create_control_request

        return capo_auditmanager.types.create_control_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_auditmanager.types.create_control_response.CreateControlResponse",
    ) -> dict[str, Any]:
        import capo_auditmanager.types.create_control_response

        return capo_auditmanager.types.create_control_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateControl",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_auditmanager.types.create_control_request.CreateControlRequest = {
        "name": name,
        "control_mapping_sources": control_mapping_sources,
    }
    if description is not None:
        input_["description"] = description
    if testing_information is not None:
        input_["testing_information"] = testing_information
    if action_plan_title is not None:
        input_["action_plan_title"] = action_plan_title
    if action_plan_instructions is not None:
        input_["action_plan_instructions"] = action_plan_instructions
    if tags is not None:
        input_["tags"] = tags

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