Add the Contrast service broker tile for Node.js

Before you add the Contrast service broker tile, you must have:

  • Pivotal Apps Manager and Ops Manager

  • An active Contrast account

  • The default Node.js buildpack for any application using Contrast. If you have a custom buildpack, you must copy the Contrast framework support and configuration into it.

With a service broker VMware Tanzu Network applications can easily bind to, and consume services from the Apps Manager or the command line. You can deploy the Contrast service broker as a Node.js application on VMware Tanzu Network, and use one or more Contrast accounts. The broker exposes the Contrast service on the VMware Tanzu Network marketplace so you can create a service instance.

When you add a tile, it creates one organization: the contrast-security-service-broker-org. Use this organization to deploy the Contrast service broker application. This requires 512MB of memory.

Tip

If you want, you can try this first with a sample application called Spring Music. Clone, build, and push the sample applications with the following commands:

git clone https://github.com/cloudfoundry-samples/spring-music.git
cd spring-music
./gradlew assemble
cf push spring-music

To add the Contrast service broker tile for Node.js:

  1. Download the Contrast service broker tile from the VMware Tanzu Network.

  2. Select Import a Product then select the contrast-security-service-broker-#.#.#.pivotal tile that you downloaded.

    Note

    If the file you downloaded has a ZIP extension, rename it to contrast-security-service-broker-#.#.#.pivotal.

  3. The tile requires some configuration before you can deploy it. The service broker does not include service plans by default. You must add at least one before you can deploy the Contrast service broker tile. To add a service plan, select Service Plansin the Contrast service broker tile and select Add.

  4. Complete these configuration parameters in the service plan:

    • TeamServer: URL to your Contrast application instance

    • TeamServer Service Key:Organization service key

    • TeamServer API Key:Organization API key

    • Organization UUID:Organization ID to which the application will belong

    • Username: Your Contrast username

    • Plan Name: Name of the plan as it will appear in Apps Manager

    • Proxy Host: The hostname of a proxy for the service broker to communicate with Contrast

    • Proxy Port: The proxy port

    • Proxy Username: The proxy username if it requires authentication

    • Plan Password: The proxy password

  5. After you define the service plan, select Save. If you want some applications to belong to different organizations, define the other plans you will need.

  6. Select the Apply Changes in the dashboard. This may take some time to finish.

  7. After you successfully deploy the service broker, you can bind the credentials to an application. Go to the Marketplace to find the Contrast service broker option.

  8. Select the Contrast service broker option to see the available plans that you created in the Pivotal Ops Manager.

  9. Use Select this Plan to choose the plan you want to bind to an application.

  10. Specify an instance name for the plan. This doesn't affect the service broker. You can name the instance what you want.

  11. In the Bind to App drop-down menu, select the application to bind to this service. Then restage the application. This will retrieve the latest agent from Contrast to instrument your application.

  12. If you want to override agent properties, such as the application name, you can set environment variables in VMware Tanzu Network. Here is a command line example:

    cf set-env APP-NAME JAVA_OPTS " -Dcontrast.app.name.override=PivotalSpringApp
    -Dcontrast.server=PivotalServerName "