---
name: loggr-udp-forwarder

templates:
  bpm.yml.erb: config/bpm.yml
  loggregator_ca.crt.erb: config/certs/loggregator_ca.crt
  loggregator_agent.crt.erb: config/certs/loggregator_agent.crt
  loggregator_agent.key.erb: config/certs/loggregator_agent.key
  metrics_ca.crt.erb: config/certs/metrics_ca.crt
  metrics.crt.erb: config/certs/metrics.crt
  metrics.key.erb: config/certs/metrics.key
  prom_scraper_config.yml.erb: config/prom_scraper_config.yml

packages:
- udp-forwarder

consumes:
- name: cloud_controller
  type: cloud_controller

properties:
  loggregator.tls.ca:
    description: |
      When the forwarder communicates with the Loggregator Agent it must
      validate the Loggregator Agent's certificate was signed by a trusted CA.
      This is the CA trusted by the forwarder for that communication.
  loggregator.tls.cert:
    description: |
      This certificate is sent to the Loggregator Agent when initiating a
      connection. It must be signed by a CA that is trusted by the Loggregator
      Agent.
  loggregator.tls.key:
    description: |
      This is the private key for the certificate sent to the Loggregator Agent
      when initiating a connection.
  loggregator.ingress_port:
    description: |
      The gRPC port to forward the converted v2 envelopes to.
    default: 3458
  udp_port:
    description: |
      The port to listen for incoming v1 (dropsonde) envelopes via UDP.
    default: 3457
  deployment:
    description: "Name of deployment (added as tag on all outgoing v2 envelopes)"
    default: ""

  metrics.port:
    description: "Port the agent uses to serve metrics and debug information"
    default: 14829
  metrics.ca_cert:
    description: "TLS CA cert to verify requests to metrics endpoint."
  metrics.cert:
    description: "TLS certificate for metrics server signed by the metrics CA"
  metrics.key:
    description: "TLS private key for metrics server signed by the metrics CA"
  metrics.server_name:
    description: "The server name used in the scrape configuration for the metrics endpoint"