Cannot enable ilm with custom indices in my apm-server.yml

Kibana version:
7.6.0

Elasticsearch version:
7.6.0

APM Server version:
7.6.0

APM Agent language and version:
1.15

Fresh install or upgraded from other version?
Fresh install

Is there anything special in your setup? For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.

Trying to setup custom indices with:

    setup:
      template:
        name: "apm-%{[observer.version]}"
        pattern: "*apm-*"
        enabled: true
        overwrite: true

    queue.mem.events: 4096
    max_procs: 4

    output.elasticsearch:
      hosts: ["http://elasticsearch:9200"]
      indices:
        - index: "customnamespace-apm-%{[observer.version]}-sourcemap"
          when.contains:
            processor.event: "sourcemap"
        - index: "customnamespace-apm-%{[observer.version]}-error-%{+yyyy.MM.dd}"
          when.contains:
            processor.event: "error"
        - index: "customnamespace-apm-%{[observer.version]}-transaction-%{+yyyy.MM.dd}"
          when.contains:
            processor.event: "transaction"
        - index: "customnamespace-apm-%{[observer.version]}-span-%{+yyyy.MM.dd}"
          when.contains:
            processor.event: "span"
        - index: "customnamespace-apm-%{[observer.version]}-metric-%{+yyyy.MM.dd}"
          when.contains:
            processor.event: "metric"
        - index: "customnamespace-apm-%{[observer.version]}-onboarding-%{+yyyy.MM.dd}"
          when.contains:
            processor.event: "onboarding"

Whenever i enable ilm, i either don't see my custom indices anymore or i don't see an ilm policy, depending on whether i set ilm.enabled: "auto" or ilm.enabled: "true".

How can I attach my own ilm policies to my custom indices without either of them disappearing or not being displayed at all?

This is what my ilm looks like:

    apm-server:
      host: "0.0.0.0:8200"
      concurrent_requests: 5
      ilm:
        enabled: "auto"
        setup:
          mapping:
            - event_type: "error"
              policy_name: "customnamespace-apm-error-span-policy"
            - event_type: "span"
              policy_name: "customnamespace-apm-error-span-policy"
            - event_type: "transaction"
              policy_name: "customnamespace-apm-transaction-metric-policy"
            - event_type: "metric"
              policy_name: "customnamespace-apm-transaction-metric-policy"
          enabled: true
          policies:
            - name: "customnamespace-apm-error-span-policy"
              policy:
                phases:
                  hot:
                    actions:
                      rollover:
                        max_size: "50gb"
                        max_age: "1d"
                      set_priority:
                        priority: 100
                  warm:
                    min_age: "7d"
                    actions:
                      set_priority:
                        priority: 50
                      readonly: {}
                  cold:
                    min_age: "30d"
                    actions:
                      set_priority:
                        priority: 0
                      freeze: {}
                  delete:
                    min_age: "60d"
                    actions:
                      delete: {}
            - name: "customnamespace-apm-transaction-metric-policy"
              policy:
                phases:
                  hot:
                    actions:
                      rollover:
                        max_size: "50gb"
                        max_age: "30d"
                      set_priority:
                        priority: 100
                  warm:
                    min_age: "60d"
                    actions:
                      set_priority:
                        priority: 50
                      readonly: {}
                  cold:
                    min_age: "90d"
                    actions:
                      set_priority:
                        priority: 0
                      freeze: {}

Configuring custom rollover aliases when using ILM is not currently supported. You can follow the enhancement request issue for that.