in code/ct_flowlog_activator.py [0:0]
def cfn_handler(event, context):
LOGGER.info('CFN Custom Resource - Received event {}'.format(event))
if event['RequestType'] == 'Create' or event['RequestType'] == 'Update':
try:
LOGGER.info(f"Spawning lambda in each account to setup VPC Flow Logs")
primary_handler(context)
LOGGER.info(f"Lambda's spawned successfully.")
sendCfnResponse(event, context, "SUCCESS", {})
except BaseException as error:
LOGGER.info("exception while trying to spawn lambdas in each account")
LOGGER.error(f"Error: ${error}")
sendCfnResponse(event, context, "FAILED", {})
elif event['RequestType'] == 'Delete':
LOGGER.error(f"This CustomResource does nothing except for Create/Updates. Doing nothing now.")
sendCfnResponse(event, context, "SUCCESS", {})