in cdk/event-forwarder/index.ts [36:54]
async function getCloudformationStackName(
event: CloudformationEvent | AutoscalingEvent,
stage: string,
) {
switch (event.source) {
case 'aws.autoscaling': {
return await getCloudformationStackNameForAsg(
event as AutoscalingEvent,
stage,
);
}
case 'aws.cloudformation': {
return getCloudformationStackNameForStack(event as CloudformationEvent);
}
default: {
throw new Error('Unrecognised event source');
}
}
}