I'm trying to setup an lambda function triggered by S3 events within a localstack docker-compose environment.
I've got the latest localstack image running in one service with S3, Lambda and APIGATEWAY and the second service is using `awslocal` to communicate with the localstack.

I have gotten as far as successfully creating a lambda function but when I attempt to `add-permission` I get a 404 Not Found error.

My command is:
```
awslocal lambda add-permission 
--function-name my-lambda-function 
--action lambda:InvokeFunction 
--statement-id s3 
--principal s3.amazonaws.com 
--source-arn arn:aws:s3:::event-source-bucket
```

This works against AWS so I'm not sure what I need to have setup within localstack to get it working.  Thanks for any insight you may have.
"""
    arn = func_arn(function)
    
    LAMBDA_EXECUTOR.cleanup(arn)
    try:
        arn_to_lambda.pop(arn)
    except KeyError:
        return not_found_error(func_arn(function))
    event_publisher.fire_event(event_publisher.EVENT_LAMBDA_DELETE_FUNC,
        payload={'n': event_publisher.get_hash(function)})
    i = 0
    while i < len(event_source_mappings):
        mapping = event_source_mappings[i]
        if mapping['FunctionArn'] == arn:
            del event_source_mappings[i]
            i -= 1
        i += 1
    result = {}
    return jsonify(result)
@app.route('%s/functions/<function>/code' % PATH_ROOT, methods=['PUT'])
def update_function_code(function):
    """ Update the code of an existing function
        ---
        operationId: 'updateFunctionCode'
        parameters:
            - name: 'request'
              in: body
    """
    data = json.loads(to_str(request.data))
    result = set_function_code(data, function)