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

# Type of request: This is a ...

[x] bug report

# Detailed description

 have aws s3 localstack in docker-compose declared as:

```
version: "3"

services:
...
 localstack:
    image: localstack/localstack
    environment:
      - SERVICES=s3
      - USE_SSL=false
      - DEBUG=1
      - DATA_DIR=/tmp/localstack/data
    ports:
      - "4572:4572"
      - "4566:4566"
      - "8083:8080"
    networks:
      - mynetwork
```

After build everything works fine. I am able to connect to the image:
```
docker exec -ti my-project_localstack_1 /bin/bash
```

And make a new bucket using command line:
```
awslocal s3 mb s3://my-bucket
```

Initially I was able to put new objects into the bucket from my php app.
But was not able to see/view list of them from php/postman/browser.

I've made some research and found [this][1] solution.
```
awslocal s3 mb s3://my-bucket

awslocal s3api put-bucket-acl --bucket my-bucket --acl public-read
```

Now, I am able to get list of objects by prefix in anonymous mode (no credentials or tokens) in my Chrome browser and using Postman.

But I fail to get `$s3Client->listObjects(...)`. It always returns empty result.

Note: I am still able to execute `$s3Client->putObject(...)`.
And I checked another commands `$s3client->getBucketAcl(...)` and `$s3Client->getObjectUrl(...)`. They work fine. 
What I want to say, connection to the localstack host from php is fine and instance is working and responding fine.

Here is the code on php side that I use to instantiate `$s3Client`:
```
class S3
{
	/** @var \Aws\S3\S3Client  */
	private static $client = null;
	private static function init()  // Lazy S3client initiation
	{
		if (is_null (self::$client)) {
            self::$client = new Aws\S3\S3Client ([
                'region'  => 'us-east-1',
                'version' => '2006-03-01',
                'credentials'   => false,
                'endpoint' => "http://localstack:4572",
                'use_path_style_endpoint' => true,
                'debug' => true
            ]);
		}
	}  
    ...
    public static function list_objects($bucket, array $options)
	{
		self::init();

        return self::$client->listObjects([
            'Bucket'    => "my-bucket",
            'Prefix'    => "year/month/folder/",
            'Delimiter' => $options['delimiter'] ? $options['delimiter'] : '/',
        ]);
	}
    ...
}
```

This method returns `@metadata->effectiveUri` :
```
 array (size=2)
    'instance' => string '0000000040d78e4d00000000084dbdb3' (length=32)
    'data' => 
      array (size=1)
        '@metadata' => 
          array (size=4)
            'statusCode' => int 200
            'effectiveUri' => string 'http://localstack:4572/my-bucket?prefix=year%2Fmonth%2Ffolder%2F&delimiter=%2F&encoding-type=url'
```

If I take this url and run it in **browser** or **postman** or php docker terminal **curl** it returns list of my files. It only returns empty array when I call it though s3Client in php.

I have a feeling that something is wrong with permissions. But since I don't have that much knowledge and experience with aws-s3 service I can't figure that out. And it seem confusing that some "default" permissions allows client to put objects but restrict to read index. And I can read index of objects using browser or curl, but not through the app.

I've asked[ this question](https://stackoverflow.com/questions/62244318/cant-get-list-objects-from-localstack-s3-bucket-using-php-aws-s3client) on SO.

And someone recommended me to downgrade docker image to `localstack/localstack:0.11.0` and that fixed the issue. 

## Expected behavior

Php aws s3client `listObjects` should return list of objects stored in bucket same as it is returned for curl or browser.

## Actual behavior

Empty list returned


return 1000 * 60
def cleanup():
    global event_source_mappings, arn_to_lambda
    arn_to_lambda = {}
    event_source_mappings = []
    LAMBDA_EXECUTOR.cleanup()
def func_arn(function_name):
    return aws_stack.lambda_function_arn(function_name)
def check_batch_size_range(source_arn, batch_size=None):
    batch_size_entry = BATCH_SIZE_RANGES.get(source_arn.split(':')[2].lower())
    if not batch_size_entry:
        raise ValueError(
            INVALID_PARAMETER_VALUE_EXCEPTION, 'Unsupported event source type'
        )
    batch_size = batch_size or batch_size_entry[0]
    if batch_size > batch_size_entry[1]:
        raise ValueError(
            INVALID_PARAMETER_VALUE_EXCEPTION,
            'BatchSize {} exceeds the max of {}'.format(batch_size, batch_size_entry[1])
        )
    return batch_size
def add_function_mapping(lambda_name, lambda_handler, lambda_cwd=None):
    arn = func_arn(lambda_name)
    arn_to_lambda[arn].versions.get('$LATEST')['Function'] = lambda_handler
    arn_to_lambda[arn].cwd = lambda_cwd
def add_event_source(function_name, source_arn, enabled, batch_size=None):