/bosh-event-resource

Concourse resource for detecting BOSH events

Primary LanguageShellApache License 2.0Apache-2.0

BOSH Event Resource

A Concourse resource to trigger pipelines based on events generated by a BOSH Director.

This resource is based off the "BOSH deployment event" Concourse resource.

Known Issues

This resource will emit metadata which lists deployment changes. However, due to Concourse's architecture it may not perfectly reflect the content of the backup. This is because the metadata is collected during resource GET but backup is performed by your pipeline later (how much later depends on multiple factors, including what steps are there in your pipeline). Therefore some tasks can complete between the moment GET was executed and when the actual backup was taken and therefore the backup can contain changes not listed in the metadata.

Source Configuration

For the source configuration you can specify either Bosh credentials or Pivotal Operations Manager credentials.

  • Using Bosh credentials

    Field Required Type Description
    target Y** String BOSH Director URL (eg. https://192.168.50.6:25555)
    client Y** String BOSH client (eg. admin)
    client_secret Y** String BOSH client's secret (password)
    ca_cert N** String BOSH Director CA Cert (as you would provide for BOSH CLI)
    event_source N String The user causing the event (i.e. health_monitor)
    object_type N String The type of object associated with the event (i.e. deployment)
    excluded_deployments N Array Deployment names that should be ignored (eg. ["bat", "dummy"])
  • Using Pivotal Operations Manager credentials to access the managed Bosh director

    Field Required Type Description
    opsman_host N** String Pivotal Operations Manager DNS name or Host IP
    opsman_username Y** String Login username
    opsman_password Y** String Login password
    opsman_client_id N** String Pivotal Operations Manager UAA client ID
    opsman_client_secret N** Array Pivotal Operations Manager UAA client ID's secret
    skip_ssl_validation N Array To skip SSL validation
    event_source N String The user causing the event (i.e. health_monitor)
    object_type N String The type of object associated with the event (i.e. deployment)
    excluded_deployments N Array Deployment names that should be ignored (eg. ["bat", "dummy"])

** If Bosh credentials are provided they will override the Operations Manager credentials. So provide only one to avoid confusion.

Behavior

check: Returns the date of the most recent create/update/delete deployment event since the previous check (version).

in: Does nothing.

out: Does nothing.

Example Configuration

Resource Type

resource_types:
- name: bosh-deployment-event-resource
  type: docker-image
  source:
    repository: mkuratczyk/bosh-deployment-event-resource

Resource

resources:
- name: deployment-changes
  type: bosh-deployment-event-resource
  source:
    target: https://192.168.50.6:25555
    client: admin
    client_secret: password
    ca_cert: |
      -----BEGIN CERTIFICATE-----
      ...
      -----END CERTIFICATE-----
    excluded_deployments: ["dummy", "bat"]

Plan

This resource will only trigger your pipeline. You should have another task that perform the actual backup. Take a look bbr-pcf-pipeline-tasks for an example.

jobs:
- name: backup
  plan:
  - get: deployment-changes
    trigger: true
  - task: actual-backup-task
    ...

License

Apache License 2.0, see LICENSE.