<!-- 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()
```
new_statement = generate_policy_statement(sid, action, arn, sourcearn, principal)
    policy = {
        'Version': IAM_POLICY_VERSION,
        'Id': 'LambdaFuncAccess-%s' % sid,
        'Statement': [new_statement]
    }
    return policy
@app.route('%s/functions/<function>/policy' % PATH_ROOT, methods=['POST'])
def add_permission(function):
    data = json.loads(to_str(request.data))
    iam_client = aws_stack.connect_to_service('iam')
    sid = data.get('StatementId')
    action = data.get('Action')
    principal = data.get('Principal')
    sourcearn = data.get('SourceArn')
    qualifier = request.args.get('Qualifier')
    arn = func_arn(function)
    previous_policy = get_lambda_policy(function)
    if arn not in ARN_TO_LAMBDA:
        return not_found_error(func_arn(function))
    if not re.match(r'lambda:[*]|lambda:[a-zA-Z]+|[*]', action):
        return error_response('1 validation error detected: Value "%s" at "action" failed to satisfy '
                              'constraint: Member must satisfy regular expression pattern: '
                              '(lambda:[*]|lambda:[a-zA-Z]+|[*])' % action,
                              400, error_type='ValidationException')
    q_arn = func_qualifier(function, qualifier)
    new_policy = generate_policy(sid, action, q_arn, sourcearn, principal)