### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

Lambda refs get lost

### Expected Behavior

Lambda refs work in state machines

### How are you starting LocalStack?

With a docker-compose file

### Steps To Reproduce

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)

    docker run localstack/localstack

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

    awslocal s3 mb s3://mybucket


### Environment

```markdown
- OS: 
- LocalStack:
```


### Anything else?

This is based on a conversation I had with @dominikschubert 
local_urls = [
            "http://localhost",
            "https://localhost",
            "http://localhost:4566",
            "https://localhost:4566",
            "http://localhost.localstack.cloud:4566",
            "https://s3.localhost.localstack.cloud",
            "http://mybucket.s3.localhost.localstack.cloud:4566",
            "https://mybucket.s3.localhost",
        ]
        remote_urls = [
            "https://mybucket.s3.amazonaws.com",
            "http://mybucket.s3.us-east-1.amazonaws.com",
        ]
        for url in local_urls:
            self.assertTrue(template_preparer.is_local_service_url(url))
        for url in remote_urls:
            self.assertFalse(template_preparer.is_local_service_url(url))