name: "example_mail"
description: "Example: a mail instance hosted by the metapaas control plane, created declaratively via the mailaas element API"
schema_version: 1
version: "0.0.2"
api_version: "v1"

requirements:
  core:
    from_version: "0.0.0"
  mailaas:
    from_version: "0.0.0"

resources:

  # A mail instance in the metapaas project. The metapaas db-back core-agent
  # reconciles this into the metapaas DB (kind em_mailaas_types_mail_instances);
  # the mail plugin's infra builder then launches an exim4 dataplane node.
  $mailaas.types.mail.instances:
    example_mail:
      name: "example-mail"
      project_id: "4d657461-0000-0000-0000-000000000002"
      domain: "example.local"
      cpu: 1
      ram: 1024
      disk_size: 10
      version: $example_mail.imports.$exim4_1:uuid

imports:
  exim4_1:
    element: "$mailaas"
    kind: "resource"
    link: "$mailaas.types.mail.versions.$exim4_1"

exports:
  instance:
    link: "$mailaas.types.mail.instances.$example_mail"