function buildFrameworkRequest()

in lambda/src/frameworks.ts [42:57]


function buildFrameworkRequest(
    framework: Framework,
    customControlList: AWS.AuditManager.ControlMetadataList
): AWS.AuditManager.CreateAssessmentFrameworkRequest {
    const getControlIdByName = (name: string): string | undefined =>
        customControlList.find(({ name: controlName }) => controlName === name)?.id;
    return {
        name: framework.name,
        description: framework.description,
        complianceType: framework.complianceType,
        controlSets: framework.controlSets.map((item) => ({
            name: item.name,
            controls: item.controls.map((name) => ({ id: getControlIdByName(name) })),
        })),
    };
}