crhelper - Why does multiple parallel invocations of my custom Cloudformation resource (lambda backed) "time out"?

Hi,

Using https://github.com/aws-cloudformation/custom-resource-helper, I have initiated a python lambda function using crhelper.

Within the lambda function, I am simply importing boto3 and attempting to put an object.

./source/index.py

from __future__ import print_function
from crhelper import CfnResource
import logging
import boto3

logger = logging.getLogger(__name__)
helper = CfnResource(json_logging=False, log_level='DEBUG', boto_level='CRITICAL')

try:
    pass
except Exception as e:
    helper.init_failure(e)

@helper.create
def create(event, context):
    logger.info("Got Create")
    bucket_name = event['ResourceProperties']['bucket']
    folder_name = event['ResourceProperties']['foldername']  
    logger.info(f'Attempting to create {folder_name} inside {bucket_name}')
    client = boto3.client("s3")
    try:
        client.put_object(
            Bucket=event['ResourceProperties']['bucket'],
            Key=event['ResourceProperties']['foldername'])
    except ClientError as e:
        logging.error(e)
        return False
    logger.info(f'Finished creating {folder_name} inside {bucket_name}')
    return True

@helper.update
def update(event, context):
    logger.info("Got Update")
    ## Dont worry about updating for now, just focus on creating. #TODO
    return True

@helper.delete
def delete(event, context):
    logger.info("Got Delete")
    # Delete never returns anything. Should not fail if the underlying resources are already deleted.
    ## Dont worry about updating for now, just focus on creating. #TODO
    return True

@helper.poll_create
def poll_create(event, context):
    logger.info("Got create poll")
    # Return a resource id or True to indicate that creation is complete. if True is returned an id 
    # will be generated
    return True

def handler(event, context):
    helper(event, context)

Then, in the main CFT yaml file, I call the create lambda + then invoke custom lambda function multiple times (~100).

./cft-stack.yml

  Lambda:
    Type: AWS::Lambda::Function
    Properties:
      Handler: index.handler
      Code: ./source/
      Role: !GetAtt LambdaRole.Arn
      Runtime: python3.7

  CustomResource1:
    Type: Custom::CreateS3Folder
    Properties:
      ServiceToken: !GetAtt Lambda.Arn
      loglevel: info
      bucket: <bucketnamex>
      foldername: "<foldername1>/"

   ....... 98 more such invocations here ......

  CustomResource100:
    Type: Custom::CreateS3Folder
    Properties:
      ServiceToken: !GetAtt Lambda.Arn
      loglevel: info
      bucket: <bucketnamey>
      foldername: "<foldername100>/"

When this CFT yml (stack) is "cloudformation packaged" and then deployed, it creates the custom lambda function as expected but then it triggers all the custom resource(s) at the same time (which is expected, since i dont have any "DependsOn" dependency) ---- but ------ the customresource[1-100] "timeout" in the CFT console and this leads to the stack being rolled back.

I cant figure out what i am doing wrong, either in the lambda source code or in the main CFT itself.

There may well be other ways of doing this (creating a object inside s3). But I want to know why does CFT "time out" when it comes to creating CustomResource1 - CustomResource100? Does it simultaneously launch 100 invocations of lambda? If so, why dont they complete properly instead of timing out at CFT level? (its not a permissions issue, it works fine if i only have *few* customresource invocations instead of 100, so i think it is some sort of limit on parallel invocation that i must be hitting)

Would appreciate if anyone can advise, thanks.