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

# Type of request: This is a ...

[x] bug report
[ ] feature request

# Detailed description

When using java-aws-sdk `CreateFunctionRequest` and `UpdateFunctionCodeRequest` with `publish` flag set to `true` should publish new version of lambda function. When I tried such operations against localstack container in version `localstack/localstack:0.11.2` those operations didn't publish new function version.

## Expected behavior

`CreateFunctionResponse` nad `UpdateFunctionCodeResponse` when `publish` flag is set to `true` will return under `version` field new version of changed AWS lambda function.

## Actual behavior

Even flag `publish` is set to `true`, above operations responses return in version `$LATEST` value what indicate that operation didn't produce new function version

# Steps to reproduce
- check available versions of given function
- create function or update existing with `publish` flag set to `true`
```
CreateFunctionRequest.builder
      .functionName(functionName)
      .runtime(runtimeName)
      .handler(handlerName)
      .layers(functionLayers)
      .role(lambdaExecutionRole)
      .tags(cdsLambdaTags)
      .memorySize(memorySize)
      .code(functionCode)
      .publish(true)
      .build
//or
UpdateFunctionCodeRequest.builder()
      .functionName(functionName)
      .zipFile(functionCode.zipFile())
      .publish(true)
      .build()
```
- check available versions of given function

## Command used to start LocalStack

Used testcontainers java localstack library.

## Client code (AWS SDK code snippet, or sequence of "awslocal" commands)

```
CreateFunctionRequest.builder
      .functionName(functionName)
      .runtime(runtimeName)
      .handler(handlerName)
      .layers(functionLayers)
      .role(lambdaExecutionRole)
      .tags(cdsLambdaTags)
      .memorySize(memorySize)
      .code(functionCode)
      .publish(true)
      .build
//or
UpdateFunctionCodeRequest.builder()
      .functionName(functionName)
      .zipFile(functionCode.zipFile())
      .publish(true)
      .build()
```
'-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=1234',
            '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:1234',
            '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:1234',
            '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:1234'
        ]
        for item in options:
            result = self.prepare_java_opts(item)
            self.assertEqual('1234', lambda_executors.Util.debug_java_port)
            self.assertEqual(item, result)
    def prepare_java_opts(self, java_opts):
        lambda_executors.config.LAMBDA_JAVA_OPTS = java_opts
        result = lambda_executors.Util.get_java_opts()
        return result
    def test_get_java_lib_folder_classpath(self):
        jar_file = os.path.join(new_tmp_dir(), 'foo.jar')
        save_file(jar_file, '')
        classpath = lambda_executors.Util.get_java_classpath(jar_file)
        self.assertIn('.:foo.jar', classpath)
        self.assertIn('*.jar', classpath)
    def test_get_java_lib_folder_classpath_no_directories(self):
        base_dir = new_tmp_dir()
        jar_file = os.path.join(base_dir, 'foo.jar')
        save_file(jar_file, '')
        lib_file = os.path.join(base_dir, 'lib', 'lib.jar')
        mkdir(os.path.dirname(lib_file))
        save_file(lib_file, '')
        classpath = lambda_executors.Util.get_java_classpath(jar_file)
        self.assertIn(':foo.jar', classpath)
        self.assertIn('lib/lib.jar:', classpath)
        self.assertIn(':*.jar', classpath)