<!-- Love localstack? Please consider supporting our collective:
👉  https://opencollective.com/localstack/donate -->

# Type of request: This is a ...

[ ] bug report
[x] feature request

# Detailed description

Until https://github.com/localstack/localstack/issues/1783 is resolved (which is blocked on upstream bug https://github.com/aws/aws-cli/issues/4727), it's not possible to use cloudformation to package and deploy a lambda to localstack.

One workaround for this is to manually upload a lambda to localstack's lambda service, but this requires manually zipping and uploading. If you need to add API Gateway to the lambdas then that's even more fiddly AWS CLI work.

In AWS' documentation for step functions local (https://docs.aws.amazon.com/step-functions/latest/dg/sfn-local-lambda.html#start-stepfunctions-local) they have a better workaround, pass a lambda endpoint (where you're running sam locally, outside of localstack): 

`java -jar StepFunctionsLocal.jar --lambda-endpoint http://localhost:3001`

Looking at localstack code, this `lambda-endpoint` doesn't seem to be configurable: https://github.com/localstack/localstack/blob/master/localstack/services/stepfunctions/stepfunctions_starter.py#L15

`lambda_endpoint = aws_stack.get_local_service_url('lambda')`

Would it be possible to expose this as a localstack environment variable, eg. `STEPFUNCTIONS_LAMBDA_ENDPOINT`?

That way we could use localstack with sam in the same way stepfunctions-local can be used with sam, to talk to a sam API running locally outside of localstack.

This would also allow running lambci Docker images locally and communicating with them from a step function, again this is often easier than uploading via CLI.
if ping(ip):
                DOCKER_BRIDGE_IP = ip
                break
try:
    DOCKER_HOST_FROM_CONTAINER = DOCKER_BRIDGE_IP
    if not is_in_docker and not is_in_linux:
        
        
        if LOCALSTACK_HOSTNAME == HOSTNAME:
            DOCKER_HOST_FROM_CONTAINER = 'host.docker.internal'
    
    if is_in_docker:
        DOCKER_HOST_FROM_CONTAINER = socket.gethostbyname('host.docker.internal')
        if LOCALSTACK_HOSTNAME == DOCKER_BRIDGE_IP:
            LOCALSTACK_HOSTNAME = DOCKER_HOST_FROM_CONTAINER
except socket.error:
    pass
if is_in_docker and not os.environ.get('LAMBDA_REMOTE_DOCKER', '').strip():
    LAMBDA_REMOTE_DOCKER = True
CONFIG_FILE_PATH = os.path.join(expanduser('~'), '.localstack')
no_proxy = ','.join(set((LOCALSTACK_HOSTNAME, HOSTNAME, LOCALHOST, '127.0.0.1', '[::1]')))
if os.environ.get('no_proxy'):
    os.environ['no_proxy'] += ',' + no_proxy
elif os.environ.get('NO_PROXY'):
    os.environ['NO_PROXY'] += ',' + no_proxy
else:
    os.environ['no_proxy'] = no_proxy
CLI_COMMANDS = {}
VALID_REGIONS = set(Session().get_available_regions('sns'))
def parse_service_ports():